:root {
  --ce-bg: #0b0f14;
  --ce-surface: #0f172a;
  --ce-surface-2: #111827;
  --ce-border: rgba(255, 255, 255, 0.10);
  --ce-text: #f8fafc;
  --ce-muted: #94a3b8;
  --ce-accent: #f59e0b; /* amber */
  --ce-primary: #3b82f6; /* blue */
  --ce-logo-color: var(--ce-accent);
  --ce-role-color: var(--ce-logo-color);
  --ce-radius: 0px;
  --ce-nav-h: 56px;
  --ce-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --ce-sidebar-w-collapsed: 64px;
  --ce-sidebar-w-expanded: 260px;
}

/* No rounded corners anywhere */
*, *::before, *::after {
  border-radius: var(--ce-radius) !important;
}

html, body {
  height: 100%;
}

body.ce-body {
  background: radial-gradient(1200px 600px at 30% -10%, rgba(59, 130, 246, 0.15), transparent 55%),
              radial-gradient(900px 500px at 90% 0%, rgba(245, 158, 11, 0.12), transparent 50%),
              var(--ce-bg);
  color: var(--ce-text);
  font-family: var(--ce-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Never scroll the whole tab — scrolling is contained inside view areas. */
  overflow: hidden;
}

.ce-body--no-scroll {
  height: 100vh;
  overflow: hidden;
}

.ce-sidebar-toggle {
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.35);
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
}
.ce-sidebar-toggle__icon {
  width: 1.25em;
  height: 1.25em;
}

.ce-navbar {
  background: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid var(--ce-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  /* Must be above sidebar so dropdowns/tooltips aren't clipped */
  z-index: 1300;
}

/* Mobile nav should overlay content (do not push the view down) */
@media (max-width: 991.98px) {
  .ce-navbar {
    /* anchor absolute-positioned collapse */
    position: sticky;
  }
  .ce-navbar .navbar-collapse {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1301;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid var(--ce-border);
    /* Tighter mobile spacing */
    padding: 8px 8px;
    backdrop-filter: blur(10px);
  }

  /* Mobile: sidebar is hidden when collapsed (only toggle remains), so use full width. */
  body.ce-layout-push .ce-main {
    margin-left: 0;
    width: 100%;
  }

  /* Mobile: when sidebar is collapsed, the expand button sits at top-left and can overlap page titles. */
  body.ce-layout-push:not(.ce-sidebar-expanded) .ce-page-title,
  body.ce-layout-push:not(.ce-sidebar-expanded) .ce-page-subtitle{
    padding-left: calc(var(--ce-sidebar-w-collapsed) + 10px);
  }
}

/* Bootstrap dropdowns should appear above sidebar */
.ce-navbar .dropdown-menu {
  z-index: 1302;
}

.navbar .nav-link {
  color: var(--ce-muted);
}
.navbar .nav-link.active,
.navbar .nav-link:hover {
  color: var(--ce-text);
}

/* Tabs (User edit: Account / About Me) */
.ce-tabs{
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.ce-tabs .nav-link{
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.55);
  border-bottom: 0;
  background: transparent;
  margin-right: 8px;
}
.ce-tabs .nav-link:hover{
  color: rgba(255,255,255,1);
  border-color: rgba(255,255,255,0.85);
}
.ce-tabs .nav-link.active{
  color: rgba(15, 23, 42, 0.98);
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.95);
}

/* Dropzone (User About Me bio image upload) */
.ce-dropzone{
  position: relative;
  border: 2px dashed rgba(255,255,255,0.35);
  border-radius: 14px;
  padding: 14px 14px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.ce-dropzone.is-over{
  border-color: rgba(245, 158, 11, 0.95);
  background: rgba(245, 158, 11, 0.08);
}
.ce-dropzone__title{
  font-weight: 900;
  color: rgba(255,255,255,0.92);
}
.ce-dropzone__subtitle{
  margin-top: 2px;
  color: rgba(255,255,255,0.70);
  font-size: 0.9rem;
}
.ce-dropzone__file{
  margin-top: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 700;
}
.ce-dropzone__input{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ce-bio-preview{
  display: block;
  width: 100%;
  max-height: 260px;
  margin-top: 10px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}

/* User edit form: keep the profile image preview at a sane "thumbnail/hero" size
   instead of spanning the full content width. */
.ce-bio-preview--user-edit{
  width: min(100%, 420px);
  height: 240px;
  max-height: none;
}

/* Avatar icon (desktop user dropdown) */
.ce-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ce-avatar {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.55);
}
.ce-avatar__icon {
  width: 14px;
  height: 14px;
  color: var(--ce-logo-color);
}

/* Ensure hamburger icon is visible on dark nav (some browsers lose contrast) */
.navbar-toggler {
  border: 1px solid var(--ce-border);
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
}
.navbar-toggler-icon {
  /* Use mask so we can tint with CSS variable (matches logo/spinner color) */
  background-color: var(--ce-logo-color);
  -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Make nav-link buttons inside forms look like links (mobile logout) */
.ce-nav-logout-btn {
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  color: var(--ce-muted);
  padding: 0.5rem 0;
}
.ce-nav-logout-btn:hover,
.ce-nav-logout-btn:focus {
  color: var(--ce-text);
}
.ce-nav-role-btn.is-active,
.ce-nav-role-btn[aria-pressed="true"]{
  color: var(--ce-text);
  font-weight: 800;
}

.ce-main {
  height: calc(100vh - var(--ce-nav-h));
  height: calc(100dvh - var(--ce-nav-h));
  overflow: hidden;
}
.ce-main--no-nav {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.ce-map-shell {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.ce-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Map context menu + marker styling */
.ce-map-context {
  position: absolute;
  z-index: 2500;
  min-width: 180px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--ce-border);
  padding: 8px;
  backdrop-filter: blur(10px);
}
.ce-map-context__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ce-text);
  padding: 8px 8px;
}
.ce-map-context__item:hover {
  background: rgba(245, 158, 11, 0.10);
}
.ce-map-marker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ce-text);
}
.ce-map-marker__dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ce-logo-color);
  background: transparent;
}
.ce-map-marker__label {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 10px 24px rgba(0,0,0,0.55);
}

/* Scrollable page content inside fixed-height shell */
.ce-page-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
.ce-table {
  border: 1px solid var(--ce-border);
}

/* Simple card container (reusable) */
.ce-card {
  border: 1px solid var(--ce-border);
  background: rgba(15, 23, 42, 0.82);
  padding: 12px;
}
.ce-card__title {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ce-card__subtitle {
  margin-top: 4px;
  color: var(--ce-muted);
  font-size: 0.92rem;
}
.ce-perm-grid {
  display: grid;
  gap: 10px;
}
.ce-perm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.55);
}
.ce-perm-title {
  font-weight: 700;
}

/* Reusable list pattern: table on md+; cards on mobile */
.ce-list-table {
  border: 1px solid var(--ce-border);
}
.ce-list-cards {
  display: grid;
  gap: 10px;
}
.ce-list-card {
  border: 1px solid var(--ce-border);
  background: rgba(15, 23, 42, 0.82);
  padding: 12px;
}
.ce-list-card__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ce-list-card__meta {
  margin-top: 4px;
  color: var(--ce-muted);
  font-size: 0.92rem;
}
.ce-list-card__actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
.ce-list-card__actions--scroll{
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px; /* room for scrollbar */
}
.ce-list-card__actions--scroll > *{
  flex: 0 0 auto;
}
.ce-drag-handle {
  cursor: grab;
  user-select: none;
  color: var(--ce-muted);
  display: inline-grid;
  place-items: center;
}
.ce-drag-handle:active {
  cursor: grabbing;
}
.ce-drag-row {
  opacity: 0.85;
}
.ce-btn-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.55);
  color: var(--ce-text);
}
.ce-btn-icon:hover {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.10);
  color: var(--ce-text);
}
.ce-btn-icon--danger:hover {
  border-color: rgba(245, 158, 11, 0.75);
  background: rgba(245, 158, 11, 0.14);
}
.ce-btn-icon__svg {
  width: 18px;
  height: 18px;
  color: var(--ce-logo-color);
}

/* Role mode toast */
.ce-role-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(1.2rem, 4.8vw, 2.1rem);
  color: var(--ce-role-color);
  text-shadow: 0 18px 50px rgba(0,0,0,0.55);
  padding: 10px 14px;
}
.ce-role-toast.is-showing {
  animation: ce-role-toast 1.6s ease-in-out both;
}
@keyframes ce-role-toast {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.00); }
  82%  { opacity: 1; transform: translate(-50%, -50%) scale(1.00); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.02); }
}

/* Role switcher (top + bottom) */
.ce-role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ce-role-switcher--top {
  overflow-x: auto;
  max-width: 46vw;
  padding: 2px 0;
}
.ce-role-switcher--bottom {
  overflow-x: auto;
  width: 100%;
}
.ce-role-btn {
  border: 1px solid var(--ce-border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--ce-text);
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.ce-role-btn.is-active {
  border-color: rgba(245, 158, 11, 0.75);
  background: rgba(245, 158, 11, 0.14);
}
.ce-role-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
}

.ce-rolebar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
}
.ce-rolebar .ce-role-switcher--bottom {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--ce-border);
  padding: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* Prevent map controls being covered by the bottom role bar on mobile */
@media (max-width: 991.98px) {
  /* Mobile: reduce wasted spacing */
  .ce-role-switcher { gap: 4px; }
  .ce-role-switcher--top { max-width: 56vw; }

  /* Role bar should start to the right of the always-visible collapsed sidebar rail */
  .ce-rolebar {
    left: calc(8px + var(--ce-sidebar-w-collapsed));
    right: 8px;
    bottom: 8px;
  }
  .ce-rolebar .ce-role-switcher--bottom {
    padding: 6px;
  }
  /* Bottom role buttons: no gaps (save space) */
  .ce-rolebar .ce-role-switcher { gap: 0; }
  .ce-rolebar .ce-role-btn { padding: 8px 8px; }
  .ce-rolebar .ce-role-btn + .ce-role-btn { margin-left: -1px; }

  .mapboxgl-ctrl-bottom-left,
  .mapboxgl-ctrl-bottom-right {
    bottom: 76px !important;
  }
}

/* Sidebar layout */
.ce-sidebar {
  position: fixed;
  top: var(--ce-nav-h);
  left: 0;
  height: calc(100vh - var(--ce-nav-h));
  width: var(--ce-sidebar-w-collapsed);
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid var(--ce-border);
  backdrop-filter: blur(10px);
  z-index: 1200;
  transform: translateX(0);
  transition: width 180ms ease-in-out;
  display: flex;
  flex-direction: column;
}
.ce-sidebar__top{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 0 0 10px;
}
.ce-sidebar__toggle {
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.45);
  color: var(--ce-text);
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.ce-sidebar__toggle-icon {
  width: 16px;
  height: 16px;
  background-color: var(--ce-logo-color);
  /* Collapsed state icon should indicate ACTION: expand (chevron-right) */
  -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23000' d='M8.5 18.5 15 12 8.5 5.5l1.4-1.4 7.9 7.9-7.9 7.9-1.4-1.4Z'/%3e%3c/svg%3e");
  mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23000' d='M8.5 18.5 15 12 8.5 5.5l1.4-1.4 7.9 7.9-7.9 7.9-1.4-1.4Z'/%3e%3c/svg%3e");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.ce-sidebar__nav {
  padding: 10px 12px;
  overflow: auto;
  flex: 1;
}
.ce-sidebar__tabs{
  display:flex;
  gap:8px;
  width: 100%;
}
.ce-sidebar:not(.ce-sidebar--has-map-tab) [data-ce-sidebar-tab="map"],
.ce-sidebar:not(.ce-sidebar--has-map-tab) [data-ce-sidebar-panel="map"]{
  display:none !important;
}
.ce-sidebar__tab{
  border:1px solid var(--ce-border);
  background: rgba(17,24,39,0.45);
  color: var(--ce-muted);
  padding: 8px 10px;
  font-weight: 800;
  width: 100%;
  text-align: center;
}
.ce-sidebar__tab.is-active{
  border-color: rgba(245,158,11,0.75);
  background: rgba(245,158,11,0.14);
  color: var(--ce-text);
}
.ce-sidebar__panel{
  display:none;
}
.ce-sidebar__panel.is-active{display:block}
.ce-sidebar__mapTools{
  margin-bottom: 10px;
}
.ce-sidebar__panelTitle{
  font-weight: 900;
  letter-spacing: -0.02em;
}
.ce-sidebar__panelHint{
  margin-top: 4px;
  color: var(--ce-muted);
  font-size: 0.9rem;
}
.ce-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.ce-sidebar__link {
  display: block;
  padding: 10px 10px;
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.55);
  color: var(--ce-text);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile: tighten sidebar spacing (fuller width, less wasted padding) */
@media (max-width: 991.98px) {
  .ce-sidebar__nav { padding: 8px 6px; }
  .ce-sidebar__top { gap: 6px; padding: 0 0 8px; }
  .ce-sidebar__tabs { gap: 6px; }
  .ce-sidebar__tab { padding: 8px 6px; }
  .ce-sidebar__list { gap: 6px; }
  .ce-sidebar__link { padding: 10px 8px; gap: 8px; }
}
.ce-sideicon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--ce-logo-color);
}
.ce-sidebar__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ce-sidebar__link:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--ce-text);
}
.ce-sidebar__link.is-active{
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.75);
  color: var(--ce-text);
}
.ce-sidebar__empty {
  color: var(--ce-muted);
  font-size: 0.95rem;
  padding: 10px 4px;
}
.ce-sidebar-backdrop {
  position: fixed;
  inset: 0;
  top: var(--ce-nav-h);
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
}

/* Mobile: when expanded, show backdrop; when collapsed, keep it hidden */
@media (max-width: 991.98px) {
  .ce-sidebar-backdrop {
    display: block;
  }
  body:not(.ce-sidebar-expanded) .ce-sidebar-backdrop {
    display: none;
  }
}

/* Expanded state */
.ce-sidebar-expanded .ce-sidebar {
  width: var(--ce-sidebar-w-expanded);
}
/* Expanded state icon should indicate ACTION: collapse (chevron-left) */
.ce-sidebar-expanded .ce-sidebar__toggle-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23000' d='M15.5 5.5 9 12l6.5 6.5-1.4 1.4L6.2 12l7.9-7.9 1.4 1.4Z'/%3e%3c/svg%3e");
  mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23000' d='M15.5 5.5 9 12l6.5 6.5-1.4 1.4L6.2 12l7.9-7.9 1.4 1.4Z'/%3e%3c/svg%3e");
}
/* Hide labels when collapsed */
body:not(.ce-sidebar-expanded) .ce-sidebar__text {
  display: none;
}
body:not(.ce-sidebar-expanded) .ce-sidebar__link {
  justify-content: center;
  padding: 12px 0;
}

/* Collapsed: show ONLY the expand/collapse button row. Nothing else should interfere with the view. */
body:not(.ce-sidebar-expanded) .ce-sidebar{
  height: auto;
  background: transparent;
  border-right: 0;
  backdrop-filter: none;
}
body:not(.ce-sidebar-expanded) .ce-sidebar__nav{
  overflow: visible;
}
body:not(.ce-sidebar-expanded) .ce-sidebar__tabs{
  display:none;
}
body:not(.ce-sidebar-expanded) .ce-sidebar__panel{
  display:none;
  padding: 10px 0 12px;
}
/* Collapsed: hide panels entirely (no icon rail / no tabs). */
body:not(.ce-sidebar-expanded) .ce-sidebar__panel.is-active{
  display:none;
}
body:not(.ce-sidebar-expanded) .ce-sidebar__mapTools{
  display:none;
}

/* Desktop: default open and content shifted */
@media (min-width: 992px) {
  .ce-sidebar-backdrop {
    display: none !important;
  }
  /* Default (non-map views): push content to the right of the sidebar */
  body.ce-layout-push .ce-main {
    margin-left: var(--ce-sidebar-w-collapsed);
    width: calc(100% - var(--ce-sidebar-w-collapsed));
  }
  body.ce-layout-push.ce-sidebar-expanded .ce-main {
    margin-left: var(--ce-sidebar-w-expanded);
    width: calc(100% - var(--ce-sidebar-w-expanded));
  }

  /* Map view: sidebar overlays the map (do not push content) */
  body.ce-layout-map .ce-main {
    margin-left: 0;
    width: 100%;
  }
}
.ce-map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.65), rgba(11, 15, 20, 0.85));
  border-top: 1px solid transparent;
}
.ce-map-fallback__title {
  font-weight: 800;
  font-size: 1.2rem;
  text-align: center;
}
.ce-map-fallback__subtitle {
  margin-top: 6px;
  color: var(--ce-muted);
  text-align: center;
  max-width: 28rem;
}

/* Login overlay (primary action) */
/* Home CTA (primary action) */
.ce-home-cta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
}
.ce-home-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--ce-border);
  padding: 12px 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.ce-home-cta__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  line-height: 1.1;
}
.ce-home-cta__subtitle {
  color: var(--ce-muted);
  margin-top: 2px;
  font-size: 0.9rem;
}
.ce-home-cta__btn {
  white-space: nowrap;
  min-width: 104px;
}
@media (min-width: 992px) {
  .ce-home-cta {
    display: none;
  }
}

/* Navbar "login" styled like a button on desktop, simple link on mobile */
@media (min-width: 992px) {
  .navbar .nav-link.ce-nav-login {
    background: var(--ce-accent);
    border: 1px solid var(--ce-accent);
    color: #111827 !important;
    padding: 0.45rem 0.8rem;
    margin-left: 0.6rem;
    font-weight: 700;
  }
  .navbar .nav-link.ce-nav-login:hover {
    filter: brightness(1.02);
    text-decoration: none;
  }
}

/* Dropdown styling to match theme */
.ce-dropdown {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--ce-border);
  padding: 6px;
  z-index: 2000;
}
.ce-dropdown__item {
  color: var(--ce-text);
}
.ce-dropdown__item:hover,
.ce-dropdown__item:focus {
  background: rgba(245, 158, 11, 0.12);
  color: var(--ce-text);
}
/* Active role inside dropdown (mobile role switch items) */
.ce-dropdown__item.is-active,
.ce-dropdown__item[aria-pressed="true"]{
  background: rgba(245, 158, 11, 0.14);
  border-radius: 6px;
  font-weight: 800;
}

.ce-form-label {
  color: var(--ce-muted);
  font-size: 0.9rem;
}
.ce-form-control {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--ce-border);
  color: var(--ce-text);
}
.ce-form-control:focus {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
  color: var(--ce-text);
}
.ce-link {
  color: rgba(245, 158, 11, 0.95);
  text-decoration: none;
}
.ce-link:hover {
  color: rgba(245, 158, 11, 1);
  text-decoration: underline;
}

/* Auth (login page) */
.ce-auth {
  width: min(440px, 100%);
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--ce-border);
  padding: 18px 16px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.ce-auth--wide {
  width: min(860px, 100%);
}
.ce-auth-shell {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}
.ce-auth__brand {
  font-weight: 700;
  color: var(--ce-text);
}
.ce-auth__title {
  margin-top: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
}
.ce-auth__subtitle {
  margin-top: 4px;
  color: var(--ce-muted);
  font-size: 0.95rem;
}
.ce-auth__form {
  margin-top: 14px;
}

.ce-choice-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.ce-choice-card {
  border: 1px solid var(--ce-border);
  background: rgba(17, 24, 39, 0.55);
  padding: 12px;
}
.ce-choice-card__title {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ce-choice-card__subtitle {
  margin-top: 4px;
  color: var(--ce-muted);
  font-size: 0.92rem;
}

.ce-landing-hero {
  margin-top: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: clamp(1.4rem, 4vw, 2.05rem);
  line-height: 1.05;
}
.ce-landing-lede {
  margin-top: 10px;
  color: var(--ce-muted);
  font-size: 1.02rem;
  max-width: 62ch;
}
.ce-landing-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
@media (min-width: 768px) {
  .ce-landing-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.ce-landing-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ce-text);
}
.ce-landing-bullets li {
  margin: 6px 0;
  color: var(--ce-muted);
}

.ce-alert {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--ce-text);
}

/* Mapbox UI tweaks to match theme */
.mapboxgl-ctrl-group {
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid var(--ce-border) !important;
}
.mapboxgl-ctrl-group button {
  filter: invert(1) brightness(1.1);
}

.ce-page-title {
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
}
.ce-page-subtitle {
  margin-top: 0.35rem;
  color: var(--ce-muted);
}

.ce-splash {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.ce-splash__stack {
  width: min(680px, 100%);
  text-align: center;
}
.ce-splash__title {
  font-weight: 800;
  font-size: clamp(1.65rem, 6vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.ce-splash__subtitle {
  margin-top: 0.5rem;
  color: var(--ce-muted);
  font-size: 0.98rem;
}

/* Global logo tinting (subscription tiers can override --ce-logo-color) */
.ce-logo {
  color: var(--ce-logo-color);
}
.ce-logo--brand {
  color: var(--ce-logo-color);
}

/* Global Spinner */
.ce-spinner {
  display: inline-grid;
  place-items: center;
  margin-top: 18px;
  color: var(--ce-logo-color);
}
.ce-spinner__icon {
  display: block;
  /* SVG transform quirks: make origin behave consistently */
  transform-box: fill-box;
  transform-origin: center;
  animation: ce-spinner-spin 1.2s ease-in-out infinite;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.45));
}
@keyframes ce-spinner-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Global page loading overlay (shown during navigation) */
.ce-loading-overlay{
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
}
.ce-loading-overlay.is-showing{display:flex}
.ce-loading-overlay__panel{
  width: min(260px, calc(100% - 48px));
  padding: 14px 14px 12px;
  border: 1px solid var(--ce-border);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  border-radius: 12px;
  text-align: center;
}
.ce-loading-overlay__label{
  margin-top: 10px;
  color: var(--ce-muted);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Map: long-press selection ring (mobile) */
.ce-hold-ring{
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2600; /* above map overlays, below modals */
  display: none;
}
.ce-hold-ring.is-showing{display:block}
.ce-hold-ring svg{display:block;width:46px;height:46px}
.ce-hold-ring circle{
  fill: none;
  stroke: rgba(59, 130, 246, 0.95);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 126; /* 2*pi*r where r=20 */
  stroke-dashoffset: 126;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.ce-hold-ring.is-animating circle{
  animation: ce-hold-ring 1s linear forwards;
}
@keyframes ce-hold-ring{
  from { stroke-dashoffset: 126; }
  to   { stroke-dashoffset: 0; }
}

/* Map: edit mode badge (top-right) */
.ce-map-editmode{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2600;
  width: min(240px, calc(100% - 24px));
  background: rgba(15, 23, 42, 0.80);
  border: 1px solid var(--ce-border);
  backdrop-filter: blur(8px);
  padding: 10px 10px;
  pointer-events: auto;
}
/* If the sidebar is expanded (esp. mobile), the map overlays should sit UNDER it. */
body.ce-sidebar-expanded .ce-map-editmode{
  z-index: 1100;
}
.ce-map-editmode--toggle{
  top: 12px;
  /* ~20% opacity so map stays visible under the Edit Legs toggle */
  background: rgba(15, 23, 42, 0.20);
}

/* Vessel drawer (map) */
.ce-vessel-drawer{
  width: min(520px, 100vw);
  background: rgba(10, 10, 10, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  /* Must sit above map overlays (sidebar/edit legs), but below modals (z ~3600) */
  z-index: 3200;
  --bs-offcanvas-zindex: 3200;
}
.offcanvas-backdrop{
  /* Offcanvas backdrop must also sit above sidebar/edit legs */
  z-index: 3190;
}
.ce-vessel-drawer__heroWrap{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
}
.ce-vessel-drawer__heroImg{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ce-vessel-drawer__heroEmpty{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}
.ce-vessel-drawer__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.40);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
}
.ce-vessel-drawer__nav--prev{ left: 10px; }
.ce-vessel-drawer__nav--next{ right: 10px; }
.ce-vessel-drawer__nav[disabled]{
  opacity: 0.35;
  pointer-events: none;
}
.ce-vessel-drawer__thumbs{
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ce-vessel-drawer__thumb{
  flex: 0 0 auto;
  width: 74px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.ce-vessel-drawer__thumb--loading{
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: ce-skel 1.2s ease-in-out infinite;
}
.ce-vessel-drawer__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ce-vessel-drawer__thumb.is-active{
  border-color: rgba(245, 158, 11, 0.95);
}

.ce-vessel-drawer__thumb--missing{
  background: rgba(255,255,255,0.05);
}
.ce-vessel-drawer__thumbMissing{
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}

.ce-vessel-drawer__captainHead{
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.ce-vessel-drawer__rating{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ce-stars{
  letter-spacing: 2px;
  font-size: 1.05rem;
  color: rgba(245, 158, 11, 0.95);
  line-height: 1;
}
.ce-stars--hollow{
  color: rgba(255,255,255,0.35);
}
.ce-stars__meta{
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Upcoming legs list (vessel drawer) */
.ce-upcoming-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* (User drawer now scrolls like the vessel drawer; no special scroll region needed.) */

/* Request details: message thread (chat) */
.ce-chat{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
}
.ce-chat{
  /* Desktop-friendly: keep history in a scrollable panel */
  max-height: 52vh;
  overflow-y: auto;
}
@media (max-width: 767.98px){
  .ce-chat{ max-height: none; }
}
.ce-chat__row{
  display: flex;
}
.ce-chat__row.is-me{
  justify-content: flex-end;
}
.ce-chat__row.is-them{
  justify-content: flex-start;
}
.ce-chat__row.is-system{
  justify-content: center;
}
.ce-chat__bubble{
  max-width: min(560px, 92%);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ce-chat__row.is-me .ce-chat__bubble{
  background: rgba(255,193,7,0.14);
  border-color: rgba(255,193,7,0.20);
}
.ce-chat__row.is-them .ce-chat__bubble{
  background: rgba(255,255,255,0.05);
}
.ce-chat__row.is-system .ce-chat__bubble{
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.22);
}
.ce-chat__meta{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.ce-chat__sender{
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.ce-chat__time{
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}
.ce-chat__text{
  color: rgba(255,255,255,0.92);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Global unread badge (desktop + mobile) */
.ce-msg-badge{
  border-radius: 999px;
  white-space: nowrap;
}
.ce-msg-badge--mobile{
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Requests list: image corner badges (New / Message) */
.ce-thumbwrap{
  position: relative;
  display: inline-block;
  line-height: 0;
  overflow: visible;
}
.ce-thumb-badge{
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.35);
  z-index: 5;
}
.ce-thumb-badge--new{
  background: rgba(13,110,253,0.95);
  color: #fff;
}
.ce-thumb-badge--message{
  background: rgba(255,193,7,0.95);
  color: #111;
}

/* Requests list: dedicated "alert" badge column */
.ce-req-flag{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(0,0,0,0.35);
}
.ce-req-flag--new{
  background: rgba(13,110,253,0.95);
  color: #fff;
}
.ce-req-flag--message{
  background: rgba(255,193,7,0.95);
  color: #111;
}
.ce-upcoming-item{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  overflow: hidden;
}
.ce-upcoming-head{
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
}
.ce-upcoming-title{
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1.2;
}
.ce-upcoming-dur{
  font-weight: 800;
  color: rgba(255,255,255,0.70);
}
.ce-upcoming-toggle{
  flex: 0 0 auto;
  color: rgba(255,255,255,0.65);
  font-weight: 900;
}
.ce-upcoming-item.is-open .ce-upcoming-toggle{
  transform: rotate(180deg);
}
.ce-upcoming-body{
  padding: 10px 12px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ce-upcoming-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.ce-upcoming-k{
  color: rgba(255,255,255,0.65);
  font-weight: 800;
  font-size: 0.85rem;
}
.ce-upcoming-v{
  color: rgba(255,255,255,0.92);
  font-weight: 800;
  font-size: 0.85rem;
  text-align: right;
}
.ce-vessel-drawer__captainImg{
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  margin-bottom: 12px;
}

/* User drawer: make profile image match vessel hero height/behavior (cover + center). */
#ceUserDrawerImg.ce-vessel-drawer__captainImg{
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  margin-top: 8px;
}

.ce-vessel-drawer__loading{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: ce-skel 1.2s ease-in-out infinite;
  pointer-events: none;
}
.ce-vessel-drawer__loading--captain{
  position: relative;
  height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 12px;
}

@keyframes ce-skel{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* Vessel drawer: title + tabs fixed; only tab content scrolls */
.ce-vessel-drawer .offcanvas-body{
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevent whole drawer scrolling */
}
.ce-vessel-drawer .offcanvas-body .nav-tabs{
  flex: 0 0 auto;
}
.ce-vessel-drawer .offcanvas-body .tab-content{
  flex: 1 1 auto;
  min-height: 0; /* required for nested overflow in flex */
  overflow: hidden;
}
.ce-vessel-drawer .offcanvas-body .tab-pane{
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

/* Vessel drawer tabs: single line + horizontal scroll on mobile, tabs touch and share borders */
.ce-vessel-drawer .nav-tabs{
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* firefox */
}
.ce-vessel-drawer .nav-tabs::-webkit-scrollbar{ display: none; }
.ce-vessel-drawer .nav-tabs .nav-item{ margin: 0; }
.ce-vessel-drawer .nav-tabs .nav-link{
  white-space: nowrap;
  margin: 0;
  border-radius: 0 !important;
}
/* prevent double borders between adjacent tabs */
.ce-vessel-drawer .nav-tabs .nav-item + .nav-item .nav-link{
  border-left: 0;
}

.ce-vessel-drawer__props{
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.ce-vessel-drawer__prop{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
}
.ce-vessel-drawer__propKey{
  color: rgba(255,255,255,0.72);
  font-weight: 700;
  font-size: 0.9rem;
}
.ce-vessel-drawer__propVal{
  color: rgba(255,255,255,0.92);
  font-weight: 800;
  font-size: 0.95rem;
  text-align: right;
}
/* When toggle is shown, push the create/edit badge down a bit */
#cePassageEditModeBadge{
  top: 62px;
}
.ce-map-editmode__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ce-map-editmode__title{
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ce-text);
}
.ce-map-editmode__done{
  border: 1px solid var(--ce-border);
  background: rgba(245, 158, 11, 0.90);
  color: #111827;
  font-weight: 800;
  padding: 6px 10px;
}

/* Sidebar: passage list rows (button + delete grouped to match height) */
.ce-pass-row{
  align-items: stretch;
}
.ce-pass-btn{
  white-space: normal;
  line-height: 1.15;
  padding-top: 8px;
  padding-bottom: 8px;
}
.ce-pass-btn__line{
  font-weight: 800;
}
.ce-pass-btn__date{
  font-weight: 900;
}
.ce-pass-btn__sep{
  opacity: 0.65;
}
.ce-pass-btn__v{
  font-weight: 700;
}
.ce-pass-del{
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Sidebar: My Passage panel (map tab) */
.ce-pass-panel{
  border: 1px solid var(--ce-border);
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
}
.ce-pass-panel__head{
  display: flex;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
}
.ce-pass-panel__edit{
  border: 0;
  border-left: 1px solid var(--ce-border);
  background: rgba(0,0,0,0.10);
  color: var(--ce-text);
  font-weight: 800;
  padding: 0 12px;
}
.ce-pass-panel__edit:hover{
  background: rgba(0,0,0,0.18);
}
.ce-pass-panel__title{
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ce-text);
  text-align: left;
  padding: 10px 10px;
}
.ce-pass-panel__title.is-active{
  outline: 2px solid rgba(245, 158, 11, 0.55);
  outline-offset: -2px;
}
.ce-pass-panel__titleText{
  font-weight: 900;
  line-height: 1.15;
}
.ce-pass-panel__sub{
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.70);
}
.ce-pass-panel__expand{
  width: 44px;
  border: 0;
  border-left: 1px solid var(--ce-border);
  background: rgba(0,0,0,0.10);
  color: var(--ce-text);
  font-weight: 900;
}
.ce-pass-panel__expand.is-open{
  background: rgba(245, 158, 11, 0.12);
}
.ce-pass-panel__empty{
  padding: 10px 10px;
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
}
.ce-pass-panel__legs{
  border-top: 1px solid var(--ce-border);
  overflow-y: auto;
  /* Scroll legs inside panel; keep header & tools above steady */
  max-height: clamp(180px, 34vh, 520px);
  overscroll-behavior: contain;
}
.ce-pass-leg{
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ce-pass-leg__main{
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ce-text);
  text-align: left;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ce-pass-leg__main.is-active{
  background: rgba(245, 158, 11, 0.12);
}
.ce-pass-leg__num{
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(59, 130, 246, 0.95);
  background: rgba(59, 130, 246, 0.95);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
}
.ce-pass-leg__end{
  font-weight: 800;
  line-height: 1.1;
}
.ce-pass-leg__expand{
  width: 44px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.10);
  color: var(--ce-text);
  font-weight: 900;
}
.ce-pass-leg__expand.is-open{
  background: rgba(245, 158, 11, 0.12);
}
.ce-pass-leg__details{
  padding: 8px 10px 10px 46px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.08);
}
.ce-pass-leg__details.is-active{
  background: rgba(245, 158, 11, 0.10);
}
.ce-pass-leg__meta{
  margin-top: 4px;
  color: rgba(255,255,255,0.68);
  font-size: 0.78rem;
}

/* Bootstrap modals must appear above sidebar/nav overlays */
.modal{ z-index: 3600; }
.modal-backdrop{ z-index: 3590; }

/* Mobile: keep modals within viewport and readable */
@media (max-width: 991.98px){
  .modal-dialog{
    margin: 10px;
  }
  .modal-content{
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }
}

/* Buttons (for later) */
.btn-primary {
  background-color: var(--ce-primary);
  border-color: var(--ce-primary);
}
.btn-warning {
  background-color: var(--ce-accent);
  border-color: var(--ce-accent);
  color: #111827;
}

