/* Migrated ownership from 14-trail-b.css — family consolidation */
#bubble-pop-panel #bubbleZone {margin-top: 8px;}
#fishing-panel {background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  position: absolute !important;
  z-index: 1800 !important;}
#fishing-panel > .panel-body.fishing-panel-body {padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;}
#fishing-panel #fishing-ui {flex: 0 0 130px;}
#fishing-panel #fishing-results {flex: 0 0 130px;}
#repair-panel {position: absolute !important;
  z-index: 1800 !important;}
#repair-panel > .panel-body.repair-panel-body {padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow: auto;}
#chaoregon-setup-panel > .panel-body.chaoregon-setup-body {display: block;}
#chaoregon-setup-panel .shop-row {display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;}
#chaoregon-bg-panel {z-index: 10010 !important;}
#trail-screen-panel > .panel-body.trail-screen-panel-body {display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 10px;
  box-sizing: border-box;}
#trail-canvas {width: 100%;
  height: 354px;
  max-width: none;
  margin-bottom: 0;}
#trail-hud {min-height: 0;}

/* Migrated ownership from 14-trail-a.css — family consolidation */
#chaoregon-bg-panel {background-size: cover;
  display: flex;
  flex-direction: column;
  min-height: 0;}
#trail-screen-panel {display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  background: #0d1b2a;
  border: 2px solid #415a77;
  border-radius: 12px;
  color: white;
  padding: 10px;
  box-sizing: border-box;
  min-height: 0;}
#trail-canvas {width: 640px;
  height: 320px;
  background: #0d1b2a;
  border: 2px solid #415a77;
  border-radius: 8px;
  display: block;
  image-rendering: pixelated;
  margin-bottom: 6px;}
#trail-hud {flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: row;
  background: rgba(0,0,0,0.7);
  border-top: 2px solid #415a77;
  color: white;
  font-size: 14px;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 360px;}
#trail-hud-right {flex: 1 1 42%;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0;}
#trail-party-stats {display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;}
#trail-party-stats .party-member {display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 0;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(0,0,0,0.22);}
#tree-shake-panel {background: url("../assets/camp/forest.png") no-repeat center;
  background-size: cover;
  color: #fff;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;}
#treeGameZone {width: 360px;
  height: 240px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border: 2px solid #183d1c;
  background: #1b263b;
  border-radius: 8px;}
#bubble-pop-panel {background: url("../assets/camp/river.png") no-repeat center;
  background-size: cover;
  color: #fff;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;}
#bubbleZone {border: 2px solid #4a6fa5;
  border-radius: 8px;
  background: #001f3f;
  position: relative;
  margin: 0 auto;
  overflow: hidden;}
#fishing-panel {background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  z-index: 1000 !important;}
#fishing-scene {position: relative;
  width: 100%;
  height: 320px;
  background: url("../assets/bgs/fishing_water.png") center/cover no-repeat;
  overflow: hidden;
  border-bottom: 2px solid #415a77;}
#repair-panel {width: auto;
  height: auto;
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 10px;
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 12px;}

/* ============================
   Display pass nextsteps3 — remove remaining root inline panel chrome
   ============================ */

#chaoregon-leader {
  margin-bottom: 10px;
  text-align: center;
}

#setup-party-preview {
  margin-bottom: 10px;
}

#setup-shop {
  margin-top: 10px;
}

#setup-confirm-btn {
  margin-top: 15px;
}

#chaoregon-setup-panel .setup-rings-left {
  margin-top: 10px;
}

#trail-canvas {
  background: #0d1b2a !important;
  border: 2px solid #415a77;
  border-radius: 8px;
  image-rendering: pixelated;
  display: block;
}

#chaoregon-bg-panel {
  background: url('../assets/bgs/bg_chaoregontrail.png') no-repeat center/cover !important;
  z-index: 10010 !important;
}

/* Consolidated exact trail fit/helper owner blocks moved from 19-panel-fit-helpers.css */
#tree-shake-panel {
  position: absolute !important;
  z-index: 1800 !important;
}

#bubble-pop-panel {
  position: absolute !important;
  z-index: 1800 !important;
}

#chaoregon-bg-panel {
  width: 1020px;
  height: 840px;
  max-width: min(1020px, calc(var(--app-authored-width) - 24px));
  max-height: min(840px, calc(var(--app-authored-height) - 24px));
  min-width: 0;
  min-height: 0;
}

#trail-screen-panel {
  z-index: 100 !important;
  min-width: 0;
  min-height: 0;
}

#chaoregon-bg-panel > .panel-body,
#trail-screen-panel > .panel-body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#chaoregon-setup-panel {
  min-width: 0;
  min-height: 0;
  max-width: min(420px, calc(var(--app-authored-width) - 24px));
  z-index: 10020 !important;
}

#chaoregon-setup-panel > .panel-body {
  min-width: 0;
  min-height: 0;
}

#river-panel {
  z-index: 1550 !important;
}

#trailshop-panel {
  z-index: 1500 !important;
}

#chaoregon-camp-panel {
  min-height: 0;
  max-width: min(340px, calc(var(--app-authored-width) - 24px));
  z-index: 1600 !important;
}

/* ===== Late patch: Chaoregon trail panel sizing + microgame header normalization ===== */
#trail-screen-panel {
  width: 1560px !important;
  height: 1020px !important;
}

#trail-hud {
  min-height: 420px !important;
}

#trail-hud-right {
  min-width: 0;
  min-height: 0;
}

#trail-party-stats {
  min-height: 0;
}

#trail-party-stats .party-member {
  min-height: 0;
}

:is(#tree-shake-panel, #bubble-pop-panel, #toy-hunt-panel, #chaoregon-camp-panel, #repair-panel, #river-panel) > .panel-header {
  min-height: 46px !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
}

:is(#tree-shake-panel, #bubble-pop-panel, #toy-hunt-panel, #chaoregon-camp-panel, #repair-panel, #river-panel) > .panel-header > .panel-header-controls {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

:is(#tree-shake-panel, #bubble-pop-panel, #toy-hunt-panel, #chaoregon-camp-panel, #repair-panel, #river-panel) > .panel-header .panel-pin-btn,
:is(#tree-shake-panel, #bubble-pop-panel, #toy-hunt-panel, #chaoregon-camp-panel, #repair-panel, #river-panel) > .panel-header .panel-close-x {
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#tree-shake-panel,
#bubble-pop-panel,
#fishing-panel,
#repair-panel {
  overflow: hidden !important;
}

#tree-shake-panel > .panel-body.tree-shake-body,
#bubble-pop-panel > .panel-body.bubble-pop-body,
#fishing-panel > .panel-body.fishing-panel-body {
  padding: 8px !important;
  overflow: hidden !important;
}

#treeGameZone,
#bubbleZone,
#fishing-scene {
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
}

#treeGameZone {
  min-height: 520px !important;
}

#bubbleZone {
  min-height: 520px !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

#bubbleZone #bubbleCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

#fishing-scene {
  min-height: 460px !important;
}

#fishing-panel #fishing-ui,
#fishing-panel #fishing-results {
  flex: 0 0 auto !important;
}

#repair-panel {
  width: 1160px !important;
  height: 740px !important;
  padding: 0 !important;
}

#repair-panel > .panel-body.repair-panel-body {
  padding: 12px !important;
}

/* ===== Late patch: Chaoregon trail sizing + header controls normalization fix ===== */
#trail-screen-panel { width: 1520px !important; height: 900px !important; max-width: min(1520px, calc(var(--app-authored-width) - 24px)) !important; max-height: min(900px, calc(var(--app-authored-height) - 24px)) !important; }
#trail-screen-panel > .panel-body.trail-screen-panel-body { padding: 10px !important; gap: 10px !important; }
:is(#tree-shake-panel, #bubble-pop-panel, #toy-hunt-panel, #chaoregon-camp-panel, #repair-panel, #river-panel) > .panel-header .panel-close-x { font-size: 24px !important; }

/* Bubble Pop + Chaoregon setup: stop using the flatter utility shell */
#bubble-pop-panel,
#chaoregon-setup-panel {
  background:
    linear-gradient(180deg, rgba(18, 29, 44, 0.96), rgba(9, 15, 25, 0.985)) !important;
  border: 2px solid rgba(96, 131, 171, 0.82) !important;
  border-radius: 24px !important;
  box-shadow:
    0 18px 38px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.035) !important;
}

#bubble-pop-panel > .panel-header,
#chaoregon-setup-panel > .panel-header {
  min-height: 54px !important;
  height: 54px !important;
  padding: 0 14px 0 18px !important;
  background:
    linear-gradient(180deg, rgba(66, 100, 139, 0.92), rgba(26, 42, 64, 0.96)) !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.22);
}

#bubble-pop-panel > .panel-header .panel-title,
#chaoregon-setup-panel > .panel-header .panel-title {
  color: #eef6ff !important;
  font-weight: 800;
  letter-spacing: 0.35px;
}

#bubble-pop-panel > .panel-body.bubble-pop-body,
#chaoregon-setup-panel > .panel-body.chaoregon-setup-body {
  padding: 16px !important;
  background:
    radial-gradient(circle at top center, rgba(64, 104, 145, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(15, 24, 37, 0.95), rgba(8, 14, 24, 0.98)) !important;
}

#bubble-pop-panel .bubble-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(114, 153, 196, 0.20);
  background: linear-gradient(180deg, rgba(21, 34, 51, 0.94), rgba(10, 17, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

#bubble-pop-panel .bubble-hud > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #e9f3ff;
  font-weight: 700;
}

#bubble-pop-panel #bubbleZone {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid rgba(118, 158, 201, 0.18);
  background:
    radial-gradient(circle at top center, rgba(94, 148, 215, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(20, 31, 48, 0.92), rgba(9, 16, 27, 0.97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#chaoregon-setup-panel #chaoregon-leader,
#chaoregon-setup-panel #setup-party-preview,
#chaoregon-setup-panel #setup-shop,
#chaoregon-setup-panel .setup-rings-left,
#chaoregon-setup-panel #chaoregon-starting-rings {
  border-radius: 18px;
  border: 1px solid rgba(114, 154, 196, 0.18);
  background: linear-gradient(180deg, rgba(20, 32, 49, 0.92), rgba(10, 17, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#chaoregon-setup-panel #chaoregon-leader,
#chaoregon-setup-panel #setup-party-preview,
#chaoregon-setup-panel #setup-shop {
  padding: 14px;
}

#chaoregon-setup-panel #chaoregon-starting-rings,
#chaoregon-setup-panel .setup-rings-left {
  padding: 12px 14px;
}

#chaoregon-setup-panel .shop-row {
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#chaoregon-setup-panel .shop-row:first-of-type {
  border-top: 0;
}

#chaoregon-setup-panel button {
  cursor: pointer !important;
  border-radius: 14px;
  border: 1px solid rgba(170, 206, 244, 0.42);
  background: linear-gradient(180deg, rgba(90, 132, 180, 0.98), rgba(33, 55, 84, 0.98));
  color: #f6fbff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.08);
}

#chaoregon-setup-panel button:hover {
  background: linear-gradient(180deg, rgba(108, 151, 200, 0.98), rgba(40, 66, 98, 0.98));
}

/* ============================================================
   Panel style pass 8 — results/header cleanup + remaining Chaoregon family
   + classroom duplicate controls/seat alignment
   ============================================================ */

/* Results panel duplicate body/list authority block trimmed here.
   Later global-results layout + root-shell blocks remain authoritative. */

/* Remaining Chaoregon Trail subpanels / minigame family */
#toy-hunt-panel.panel {
  position: absolute !important;
  z-index: 1800 !important; /* above camp, shop, river, trail */
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) {
  min-width: 0;
  min-height: 0;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-header {
  flex: 0 0 auto;
  min-width: 0;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-body > * {
  min-width: 0;
}

#tree-shake-panel .tree-shake-body,
#toy-hunt-panel .toy-hunt-body,
#repair-panel .repair-panel-body,
#river-panel .river-panel-body,
#trailshop-panel .trailshop-panel-body,
#chaoregon-camp-panel .chaoregon-camp-body,
#trailshop-panel .trail-shop-shell,
#chaoregon-camp-panel #chaoregon-log-output {
  min-width: 0;
  min-height: 0;
}
   Party Scroll Grid (Chao List & Move)
   ============================ */
.party-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #415a77;
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
}
.party-scroll-grid .chao-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  transition: background 0.2s, border 0.2s;
}
.party-scroll-grid .chao-slot:hover {
  background: rgba(91, 99, 255, 0.2);
  border-color: #5b63ff;
}
.party-scroll-grid .sprite-wrap {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.party-scroll-grid .sprite-wrap img {
  width: 100%;
  height: 100%;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  image-rendering: pixelated;
}


/* === moved from 03-panel-contract.css in pass25: trail-minigame-panels === */
/* ============================
   Chaoregon Minigame Panels
   ============================ */


/* ===== moved from 03-panel-contract.css: Trail microgames / setup / camp compat ===== */

/* ===== moved from 03-panel-contract.css: Trail background ordering compat ===== */
/* Chaoregon trail background ordering merged into earlier #chaoregon-bg-panel block */

/* ===== moved from 03-panel-contract.css: Unified Trail Screen compat ===== */
/* ============================
   Unified Chaoregon Trail Screen
   ============================ */
#trail-screen-panel {
  width: 1560px;
  height: 1020px;
  padding: 0;
}


/* Cleanup pass: trail camp/setup ownership migrated from 14-trail-b.css and 99-legacy-overrides-c.css */
/* ============================
   Chaoregon Camp Panel
   ============================ */
#chaoregon-camp-panel {
  text-align: center;
}

#chaoregon-camp-panel h3 {
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 10px 0;
}

#chaoregon-camp-panel .camp-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
}

#chaoregon-camp-panel .camp-btn:hover:not(:disabled) {
  background: #5b63ff;
  transform: scale(1.03);
}

#chaoregon-camp-panel .camp-btn:disabled {
  opacity: 0.5;
  background: #222;
}

#camp-exit-btn {
  margin-top: 10px;
  background: #a02020;
  border: none;
  border-radius: 6px;
  color: white;
  padding: 6px 12px;
  font-weight: bold;
  transition: background 0.2s;
}
#camp-exit-btn:hover {
  background: #d03030;
}

#chaoregon-setup-panel button:hover {
  filter: brightness(1.08);
}

#chaoregon-setup-panel button:active {
  transform: translateY(1px);
}

#chaoregon-setup-panel #chaoregon-leader,
#chaoregon-setup-panel #setup-party-preview,
#chaoregon-setup-panel #setup-shop,
#chaoregon-setup-panel .setup-rings-left,
#chaoregon-setup-panel #chaoregon-starting-rings {
  background:
    linear-gradient(180deg, rgba(255,255,255,calc(var(--panel-body-alpha, 1) * 0.045)) 0%, rgba(255,255,255,0.00) 20%),
    rgba(8,12,19,calc(var(--panel-body-alpha, 1) * 0.34)) !important;
}

/* ============================================================
   Trail setup + camp late authority fix
   Purpose: restore canonical header controls, force internal scroll,
   and make camp/setup bodies follow the same panel contract.
   ============================================================ */
#chaoregon-setup-panel:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  max-height: min(760px, calc(var(--app-authored-height, 1080px) - 36px)) !important;
}

#chaoregon-setup-panel > .panel-header {
  flex: 0 0 auto !important;
}

#chaoregon-setup-panel > .panel-body.chaoregon-setup-body {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

#chaoregon-setup-panel > .panel-body.chaoregon-setup-body > * {
  position: relative;
  z-index: 1;
  flex: 0 0 auto !important;
}

#chaoregon-setup-panel > .panel-header > .panel-header-controls,
#chaoregon-camp-panel > .panel-header > .panel-header-controls {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

#chaoregon-setup-panel > .panel-header .panel-pin-btn,
#chaoregon-setup-panel > .panel-header .panel-close-x,
#chaoregon-camp-panel > .panel-header .panel-pin-btn,
#chaoregon-camp-panel > .panel-header .panel-close-x {
  position: static !important;
  top: auto !important;
  right: auto !important;
  width: auto !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  border: 1px solid rgba(181, 212, 242, 0.28) !important;
  background: linear-gradient(180deg, rgba(50, 74, 102, 0.98) 0%, rgba(28, 44, 63, 0.98) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.22) !important;
  color: #f6fbff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  line-height: 36px !important;
  text-transform: none !important;
}

#chaoregon-setup-panel > .panel-header .panel-close-x,
#chaoregon-camp-panel > .panel-header .panel-close-x {
  min-width: 38px !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 36px !important;
  background: linear-gradient(180deg, rgba(52, 70, 96, 0.98) 0%, rgba(30, 43, 61, 0.98) 100%) !important;
}

#chaoregon-setup-panel > .panel-header .panel-pin-btn:hover,
#chaoregon-camp-panel > .panel-header .panel-pin-btn:hover {
  background: linear-gradient(180deg, rgba(70, 103, 140, 0.98) 0%, rgba(35, 57, 82, 0.98) 100%) !important;
  border-color: rgba(161, 208, 255, 0.48) !important;
  transform: translateY(-1px) !important;
}

#chaoregon-setup-panel > .panel-header .panel-close-x:hover,
#chaoregon-camp-panel > .panel-header .panel-close-x:hover {
  background: linear-gradient(180deg, rgba(88, 52, 68, 0.98) 0%, rgba(60, 34, 46, 0.98) 100%) !important;
  border-color: rgba(255, 170, 190, 0.52) !important;
  transform: translateY(-1px) !important;
}

#chaoregon-camp-panel {
  overflow: hidden !important;
}

#chaoregon-camp-panel > .panel-body.chaoregon-camp-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,calc(var(--panel-body-alpha, 1) * 0.04)) 0%, rgba(255,255,255,0.00) 20%),
    linear-gradient(180deg, rgba(8,12,19,calc(var(--panel-body-alpha, 1) * 0.36)) 0%, rgba(8,12,19,calc(var(--panel-body-alpha, 1) * 0.18)) 100%) !important;
}

#chaoregon-camp-panel > .panel-body.chaoregon-camp-body hr {
  width: 100% !important;
  margin: 2px 0 !important;
  border: 0 !important;
  border-top: 1px solid rgba(255,255,255,0.14) !important;
}

#chaoregon-camp-panel .camp-btn,
#chaoregon-camp-panel #camp-exit-btn {
  display: block !important;
  width: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(170, 206, 244, 0.42) !important;
  background: linear-gradient(180deg, rgba(var(--panel-header-rgb, 70,103,137), 0.98), rgba(var(--panel-header-rgb-deep, 34,56,79), 0.98)) !important;
  color: #f6fbff !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.10) !important;
  transform: none !important;
}

#chaoregon-camp-panel .camp-btn:hover:not(:disabled),
#chaoregon-camp-panel #camp-exit-btn:hover:not(:disabled) {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
}

#chaoregon-camp-panel .camp-btn:disabled,
#chaoregon-camp-panel #camp-exit-btn:disabled {
  opacity: 0.55 !important;
  filter: none !important;
  cursor: default !important;
}

/* ============================================================
   Trail setup compact relayout authority
   ============================================================ */

#chaoregon-setup-panel .trail-setup-card {
  border-radius: 16px !important;
}

#chaoregon-setup-panel .trail-setup-route-wrap,
#chaoregon-setup-panel .trail-setup-info-grid,
#chaoregon-setup-panel #setup-shop {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#chaoregon-setup-panel .trail-setup-section-label {
  margin: 0 !important;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
}

#chaoregon-setup-panel .trail-setup-route-select {
  width: 100%;
  min-height: 34px;
}

#chaoregon-setup-panel .trail-setup-route-info {
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.95;
}

#chaoregon-setup-panel .trail-setup-leader-card {
  display: flex;
  flex-direction: column;
}

#chaoregon-setup-panel .trail-setup-leader-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

#chaoregon-setup-panel .trail-setup-nav-btn {
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
  font-size: 18px !important;
}

#chaoregon-setup-panel .trail-setup-leader-wrap,
#chaoregon-setup-panel #chaoregon-leader {
  min-width: 0;
}

#chaoregon-setup-panel #chaoregon-leader {
  padding: 8px 10px !important;
  margin: 0 !important;
}

#chaoregon-setup-panel #chaoregon-leader .chao-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#chaoregon-setup-panel #chaoregon-leader .sprite-wrap {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chaoregon-setup-panel #setup-party-preview.trail-setup-party-strip {
  display: flex !important;
  flex-wrap: wrap;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#chaoregon-setup-panel .trail-setup-party-chip {
  border-radius: 12px;
  border: 1px solid rgba(170,208,246,0.18);
  background: rgba(7,12,20,0.26);
  cursor: pointer;
}

#chaoregon-setup-panel .trail-setup-party-chip.is-active {
  border-color: rgba(255, 223, 116, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 223, 116, 0.28) inset, 0 0 10px rgba(255, 223, 116, 0.16);
}

#chaoregon-setup-panel .trail-setup-info-grid > p,
#chaoregon-setup-panel .trail-setup-info-grid > div,
#chaoregon-setup-panel .setup-rings-left {
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

#chaoregon-setup-panel .trail-setup-rings-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#chaoregon-setup-panel .trail-setup-ring-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

#chaoregon-setup-panel .trail-setup-supply-row {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  margin: 0 !important;
}

#chaoregon-setup-panel .trail-setup-supply-label {
  min-width: 0;
  line-height: 1.15;
}

#chaoregon-setup-panel .trail-setup-supply-controls {
  display: inline-flex;
  align-items: center;
}

#chaoregon-setup-panel .trail-setup-step-btn {
  padding: 0 !important;
}

#chaoregon-setup-panel .trail-setup-supply-count {
  text-align: center;
  font-weight: 800;
}

#chaoregon-setup-panel .trail-setup-confirm-btn,
#chaoregon-setup-panel #setup-confirm-btn,
/* ============================================================
   Trail setup compact follow-up pass
   ============================================================ */
#chaoregon-setup-panel > .panel-body.chaoregon-setup-body {
  gap: 8px !important;
  padding: 10px !important;
}

#chaoregon-setup-panel .trail-setup-card {
  padding: 8px 10px !important;
}

#chaoregon-setup-panel .trail-setup-route-card,
#chaoregon-setup-panel .trail-setup-leader-card,
#chaoregon-setup-panel .trail-setup-supplies-card {
  margin: 0 !important;
}

#chaoregon-setup-panel .trail-setup-leader-card {
  gap: 6px !important;
}

#chaoregon-setup-panel .trail-setup-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 2px 0;
}

#chaoregon-setup-panel .trail-setup-confirm-btn,
#chaoregon-setup-panel #setup-confirm-btn {
  margin: 0 !important;
  min-height: 34px !important;
  padding: 6px 16px !important;
  width: min(220px, 100%);
  align-self: center;
}

#chaoregon-setup-panel .trail-setup-leader-stage {
  gap: 8px !important;
}

#chaoregon-setup-panel .trail-setup-info-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px !important;
}

#chaoregon-setup-panel .trail-setup-info-grid > p,
#chaoregon-setup-panel .trail-setup-info-grid > div {
  min-height: 0 !important;
  display: flex;
  align-items: center;
}

#chaoregon-setup-panel #setup-party-preview.trail-setup-party-strip {
  gap: 4px !important;
  justify-content: center;
}

#chaoregon-setup-panel .trail-setup-party-chip {
  width: 48px;
  min-width: 48px;
  padding: 3px 2px;
}

#chaoregon-setup-panel .trail-setup-party-chip .sprite-wrap {
  min-height: 38px;
}

#chaoregon-setup-panel #setup-shop {
  gap: 2px !important;
}

#chaoregon-setup-panel .setup-rings-left {
  margin-top: 2px !important;
  padding: 6px 10px !important;
}

#chaoregon-setup-panel .trail-setup-supply-row {
  gap: 6px !important;
  padding: 2px 0 !important;
}

#chaoregon-setup-panel .trail-setup-supply-label {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

#chaoregon-setup-panel .trail-setup-supply-controls {
  gap: 4px !important;
}

#chaoregon-setup-panel .trail-setup-step-btn {
  min-width: 24px !important;
  width: 24px !important;
  height: 22px !important;
  font-size: 14px !important;
  line-height: 20px !important;
  border-radius: 8px !important;
}

#chaoregon-setup-panel .trail-setup-supply-count {
  min-width: 18px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

/* Cleanup pass: trail setup shell ownership migrated from 99-legacy-overrides-c.css */
/* ============================================================
   Trail setup panel canonical shell sync
   Purpose: make Chaoregon setup use the same live panel theming
   variables/options shell as the rest of the project instead of
   its older hardcoded blue gradients.
   ============================================================ */
#chaoregon-setup-panel {
  color: #eef6ff !important;
  border-color: var(--panel-shell-border) !important;
  border-radius: var(--panel-shell-radius) !important;
  box-shadow: var(--panel-shell-shadow) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,calc(var(--panel-shell-alpha, 1) * 0.045)) 0%, rgba(255,255,255,calc(var(--panel-shell-alpha, 1) * 0.018)) 9%, rgba(255,255,255,0.00) 16%),
    linear-gradient(180deg, rgba(var(--panel-shell-rgb, 16,26,40),calc(var(--panel-shell-alpha, 1) * 0.98)) 0%, rgba(var(--panel-shell-rgb-deep, 11,19,31),calc(var(--panel-shell-alpha, 1) * 0.98)) 100%) !important;
}

#chaoregon-setup-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: var(--panel-pattern-layer, none);
  opacity: calc(var(--panel-shell-alpha, 1) * var(--panel-pattern-alpha, 1));
}

#chaoregon-setup-panel > .panel-header,
body.panel-bg-pattern-active #chaoregon-setup-panel > .panel-header {
  min-height: var(--panel-header-h, 52px) !important;
  height: var(--panel-header-h, 52px) !important;
  padding: 0 var(--panel-header-pad-x, 14px) !important;
  gap: var(--panel-header-gap, 12px) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,calc(var(--panel-header-alpha, 1) * 0.12)) 0%, rgba(255,255,255,calc(var(--panel-header-alpha, 1) * 0.03)) 12%, rgba(255,255,255,0.00) 100%),
    linear-gradient(180deg, rgba(var(--panel-header-rgb, 70,103,137),var(--panel-header-alpha, 1)) 0%, rgba(var(--panel-header-rgb-deep, 34,56,79),var(--panel-header-alpha, 1)) 100%) !important;
  border-bottom: 1px solid var(--panel-header-divider, rgba(131, 182, 232, 0.38)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), inset 0 -1px 0 rgba(0,0,0,0.22) !important;
}

#chaoregon-setup-panel > .panel-header .panel-title {
  color: #eef6ff !important;
  font-weight: 800 !important;
  letter-spacing: 0.35px !important;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

#chaoregon-setup-panel > .panel-body.chaoregon-setup-body,
body.panel-bg-pattern-active #chaoregon-setup-panel > .panel-body.chaoregon-setup-body {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,calc(var(--panel-body-alpha, 1) * 0.05)) 0%, rgba(255,255,255,0.00) 18%),
    linear-gradient(180deg, rgba(8,12,19,calc(var(--panel-body-alpha, 1) * 0.36)) 0%, rgba(8,12,19,calc(var(--panel-body-alpha, 1) * 0.18)) 100%) !important;
}

#chaoregon-setup-panel > .panel-body.chaoregon-setup-body::before,
body.panel-bg-pattern-active #chaoregon-setup-panel > .panel-body.chaoregon-setup-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--panel-pattern-layer, none);
  opacity: var(--panel-body-alpha, 1);
  z-index: 0;
}

#chaoregon-setup-panel > .panel-header,
#chaoregon-setup-panel > .panel-body,
#chaoregon-setup-panel > .panel-header > *,
#chaoregon-setup-panel > .panel-body > * {
  position: relative;
  z-index: 1;
}

#chaoregon-setup-panel #chaoregon-leader,
#chaoregon-setup-panel #setup-party-preview,
#chaoregon-setup-panel #setup-shop,
#chaoregon-setup-panel .setup-rings-left,
#chaoregon-setup-panel #chaoregon-starting-rings {
  border-radius: 18px;
  border: 1px solid rgba(170, 208, 246, 0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(7, 12, 20, 0.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 8px 18px rgba(0,0,0,0.12) !important;
}

#chaoregon-setup-panel p,
#chaoregon-setup-panel span,
#chaoregon-setup-panel b,
#chaoregon-setup-panel label,
#chaoregon-setup-panel div {
  color: inherit;
}

#chaoregon-setup-panel button {
  border-radius: 14px;
  border: 1px solid rgba(170, 206, 244, 0.42);
  background:
    linear-gradient(180deg, rgba(var(--panel-header-rgb, 70,103,137), 0.98), rgba(var(--panel-header-rgb-deep, 34,56,79), 0.98)) !important;
  color: #f6fbff !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.10) !important;
}


.trail-mp-choice-btn.is-selected {
  outline: 2px solid rgba(255,255,255,0.55);
}
.trail-mp-choice-votes {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.9;
}

/* Trail MP banner/status polish */
.lp-stage-choice-summary {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.92;
  color: #eaf7ff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}

.trail-mp-label-layer .trail-mp-label {
  max-width: 220px;
}

/* ============================================================
   Trail MP presentation polish pass
   ============================================================ */

/* ============================================================
   Trail branch / Trail MP decision ownership migrated from 99-legacy-overrides-c.css
   ============================================================ */
.trail-branch-panel-body,
.trail-mp-decision-panel-body {
  display: flex;
  flex-direction: column;
}

.trail-branch-title {
  font-size: 18px;
  font-weight: 700;
}

.trail-branch-body,
.trail-branch-summary {
  font-size: 13px;
  line-height: 1.35;
}

.trail-branch-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trail-branch-choice-btn,
.trail-mp-choice-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.trail-branch-choice-btn {
  gap: 2px;
}

.trail-branch-choice-btn > div {
  pointer-events: none;
}

.trail-mp-choice-btn {
  gap: 4px;
}

.trail-mp-choice-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.trail-mp-choice-preview {
  opacity: 0.85;
  font-size: 12px;
}

.trail-mp-chao-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.trail-mp-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.trail-mp-label {
  position: absolute;
  transform: translate(-50%, -120%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 214, 10, 0.55);
  color: #ffd60a;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.trail-mp-label.is-branch {
  border-color: rgba(94, 203, 200, 0.8);
  color: #bdf6f3;
}

.trail-mp-status-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(170, 208, 246, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), rgba(7,12,20,0.30);
}

.trail-mp-status-route {
  font-weight: 800;
  color: #eef7ff;
}

.trail-mp-status-summary,
.trail-mp-status-copy {
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.94;
}

.trail-mp-status-phase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.trail-mp-status-pill,
.trail-mp-decision-pill,
.trail-mp-voter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(181, 212, 242, 0.22);
  background: rgba(7, 12, 20, 0.34);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.trail-mp-status-pill.is-vote {
  border-color: rgba(255, 214, 10, 0.45);
  color: #ffe579;
}

.trail-mp-status-pill.is-interlude {
  border-color: rgba(94, 203, 200, 0.65);
  color: #bdf6f3;
}

.trail-mp-status-title {
  font-weight: 800;
  color: #ffffff;
}

.trail-mp-res-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.trail-mp-res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  font-size: 12px;
}

.trail-mp-decision-meta-row,
.trail-branch-choice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.trail-mp-decision-copy {
  font-size: 12px;
  line-height: 1.25;
}

.trail-mp-choice-btn {
  padding: 10px 12px !important;
  border-radius: 14px !important;
}

.trail-mp-choice-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.trail-mp-voter-chip {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
}

.trail-mp-interlude-banner {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 4;
  min-width: min(360px, calc(100% - 40px));
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(94, 203, 200, 0.52);
  background: linear-gradient(180deg, rgba(10, 18, 30, 0.94) 0%, rgba(7, 12, 20, 0.90) 100%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  pointer-events: none;
  text-align: center;
}

.trail-mp-interlude-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.trail-mp-interlude-name {
  font-size: 18px;
  font-weight: 900;
  color: #bdf6f3;
}

.trail-mp-interlude-copy {
  font-size: 12px;
  opacity: 0.9;
}

.trail-mp-interlude-inline{margin-top:8px;padding:8px 10px;border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(0,0,0,.18);display:flex;flex-direction:column;gap:2px;font-size:12px}.trail-mp-interlude-inline.is-complete{border-color:rgba(120,220,140,.35)}

/* ===== Trail polish phase AJ ===== */
:is(#trail-branch-panel, #trail-mp-decision-panel) > .panel-header,
#trail-authoring-panel > .panel-header {
  background: var(--panel-header-bg, rgba(44,94,142,.92)) !important;
  color: var(--panel-header-fg, #f3fbff) !important;
}
:is(#trail-branch-panel, #trail-mp-decision-panel) > .panel-header > .panel-header-controls,
#trail-authoring-panel > .panel-header > .panel-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
:is(#trail-branch-panel, #trail-mp-decision-panel) > .panel-header .panel-pin-btn,
:is(#trail-branch-panel, #trail-mp-decision-panel) > .panel-header .panel-close-x,
#trail-authoring-panel > .panel-header .panel-pin-btn,
#trail-authoring-panel > .panel-header .panel-close-x {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.28);
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.08));
  color: #eef9ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 2px 5px rgba(0,0,0,.22);
}
:is(#trail-branch-panel, #trail-mp-decision-panel) > .panel-header .panel-close-x,
#trail-authoring-panel > .panel-header .panel-close-x {
  font-size: 21px;
}
.trail-branch-panel-body,
.trail-mp-decision-panel-body {
  gap: 10px;
}
.trail-branch-summary,
#trail-mp-decision-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trail-branch-meta-pill,
.trail-mp-choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(140, 205, 255, 0.28);
  background: rgba(38, 73, 109, 0.32);
  color: #d8f2ff;
  font-size: 11px;
  line-height: 1.2;
}
.trail-branch-choice-btn,
.trail-mp-choice-btn {
  text-align: left;
}
.trail-branch-choice-title {
  font-size: 14px;
  margin-bottom: 6px;
}
.trail-branch-choice-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 11px;
  color: #dff5ff;
}
.trail-branch-choice-copy,
.trail-mp-choice-preview,
.trail-mp-choice-voters {
  margin-top: 6px;
}
.trail-mp-status-callout {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #eef8ff;
  font-size: 12px;
  line-height: 1.35;
}

/* ===== Trail MP final cleanup polish ===== */
.trail-mp-status-pill.is-hold {
  border-color: rgba(255, 184, 107, 0.42);
  color: #ffd7a3;
}
.trail-mp-inline-muted {
  display: block;
  margin-top: 2px;
  opacity: 0.82;
  font-size: 11px;
}
.trail-mp-interlude-copy-sub {
  margin-top: 2px;
  opacity: 0.82;
  font-size: 11px;
}
.trail-mp-decision-waiting {
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  line-height: 1.3;
}

/* ===== Trail authoring validation panel ===== */
.trail-authoring-panel-body {
  display:flex; flex-direction:column; gap:10px; min-height:0; overflow-y:auto;
}
.trail-authoring-toolbar { display:flex; gap:8px; flex-wrap:wrap; }
.trail-authoring-btn {
  border:1px solid rgba(255,255,255,.16); border-radius:10px; padding:8px 12px;
  background: rgba(34,68,102,.42); color:#e9f7ff; font:inherit; cursor:pointer;
}
.trail-authoring-btn:disabled { opacity:.6; cursor:default; }
.trail-authoring-status-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.trail-authoring-card {
  border:1px solid rgba(255,255,255,.12); background: rgba(7,20,34,.32); border-radius:12px; padding:10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.trail-authoring-card-title { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:#bfe8ff; margin-bottom:8px; }
.trail-authoring-status-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.trail-authoring-subtext { font-size:12px; color:#cfe6f7; opacity:.88; margin-top:6px; word-break:break-word; }
.trail-authoring-badge { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.03em; }
.trail-authoring-badge.ok { background: rgba(62,145,84,.35); border:1px solid rgba(120,220,140,.35); color:#dffff0; }
.trail-authoring-badge.warn { background: rgba(148,124,44,.35); border:1px solid rgba(255,219,117,.28); color:#fff1bf; }
.trail-authoring-badge.error { background: rgba(138,54,54,.38); border:1px solid rgba(255,138,138,.35); color:#ffe2e2; }
.trail-authoring-current-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.trail-authoring-key { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.05em; opacity:.8; color:#a8d5f2; }
.trail-authoring-value { display:block; margin-top:3px; color:#eef8ff; font-size:13px; word-break:break-word; }
.trail-authoring-chip-row { display:flex; flex-wrap:wrap; gap:6px; }
.trail-authoring-chip { display:inline-flex; align-items:center; padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); font-size:11px; color:#dff5ff; }
.trail-authoring-chip.active { border-color: rgba(141, 215, 255, 0.45); background: rgba(65, 123, 175, 0.3); }
.trail-authoring-chip[data-route-id] { cursor:pointer; }
.trail-authoring-graph-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.trail-authoring-graph-label { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:#a8d5f2; }
.trail-authoring-graph-select {
  min-width: 220px; max-width: 340px; border-radius: 10px; padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.15); background: rgba(15,34,52,.72); color:#eef8ff; font:inherit;
}
.trail-authoring-graph-meta { font-size:12px; color:#d7ecfa; opacity:.9; }
.trail-authoring-graph-wrap {
  border:1px solid rgba(255,255,255,.1); border-radius:14px; background: rgba(7,20,34,.24);
  overflow:auto; max-height: 360px;
}
.trail-authoring-graph-view { min-width: 760px; min-height: 220px; padding: 8px; }
.trail-authoring-graph-svg { width:100%; height:auto; display:block; }
.trail-authoring-graph-edge { fill:none; stroke: rgba(157, 213, 255, .5); stroke-width: 3; }
.trail-authoring-graph-edge-label { font-size: 11px; fill:#d9efff; letter-spacing:.02em; }
.trail-authoring-graph-node circle { stroke: rgba(255,255,255,.14); stroke-width: 2; }
.trail-authoring-graph-node.start circle { fill: rgba(84, 186, 133, .42); }
.trail-authoring-graph-node.end circle { fill: rgba(173, 103, 208, .4); }
.trail-authoring-graph-node.branch circle { fill: rgba(230, 188, 88, .4); }
.trail-authoring-graph-node.fort circle { fill: rgba(94, 146, 226, .42); }
.trail-authoring-graph-node.river circle { fill: rgba(79, 180, 204, .42); }
.trail-authoring-graph-node.landmark circle { fill: rgba(129, 132, 208, .4); }
.trail-authoring-graph-node.default circle { fill: rgba(255,255,255,.14); }
.trail-authoring-graph-node-type { font-size: 9px; fill:#9dd5ff; letter-spacing:.08em; font-weight:700; }
.trail-authoring-graph-node-label { font-size: 10px; fill:#f4fbff; font-weight:700; }
@media (max-width: 900px) {
  .trail-authoring-graph-toolbar { align-items:flex-start; }
  .trail-authoring-graph-meta { width:100%; }
}
.trail-authoring-issues { display:flex; flex-direction:column; gap:6px; max-height:280px; overflow:auto; }
.trail-authoring-issue { display:grid; grid-template-columns:auto auto 1fr; gap:8px; align-items:start; padding:7px 8px; border-radius:10px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); }
.trail-authoring-issue.error { border-color: rgba(255,138,138,.24); }
.trail-authoring-issue.warning { border-color: rgba(255,219,117,.18); }
.trail-authoring-issue-badge { font-size:10px; font-weight:800; letter-spacing:.04em; }
.trail-authoring-issue-badge.error { color:#ffd4d4; }
.trail-authoring-issue-badge.warning { color:#ffeab7; }
.trail-authoring-issue-scope { font-size:11px; color:#9ad9ff; }
.trail-authoring-issue-msg { font-size:12px; color:#eef8ff; }
.trail-authoring-empty { font-size:12px; color:#cfe6f7; opacity:.82; }
@media (max-width: 900px) {
  .trail-authoring-status-grid, .trail-authoring-current-grid { grid-template-columns:1fr; }
}

.trail-authoring-action-status { min-height: 18px; font-size:12px; color:#dff5ff; margin:2px 0 10px; }
.trail-authoring-action-status.ok,
.trail-authoring-graph-issue-meta.ok { color:#d8ffe8; }
.trail-authoring-action-status.warn,
.trail-authoring-graph-issue-meta.warn { color:#ffeeb9; }
.trail-authoring-action-status.error,
.trail-authoring-graph-issue-meta.error { color:#ffd5d5; }
.trail-authoring-graph-issue-meta { font-size:12px; opacity:.92; }
.trail-authoring-graph-edge.has-warning { stroke: rgba(255, 219, 117, .85); stroke-width: 4; }
.trail-authoring-graph-edge.has-error { stroke: rgba(255, 138, 138, .95); stroke-width: 5; }
.trail-authoring-graph-node.has-warning circle { stroke: rgba(255,219,117,.95); stroke-width:4; }
.trail-authoring-graph-node.has-error circle { stroke: rgba(255,138,138,.98); stroke-width:5; }

.trail-authoring-draft {
  width: 100%; min-height: 120px; resize: vertical; box-sizing: border-box;
  border-radius: 12px; border: 1px solid rgba(130,190,230,.28);
  background: rgba(7,18,28,.72); color: #eaf7ff; padding: 10px 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 4px 0 10px;
}
.trail-authoring-issue { cursor:pointer; width:100%; text-align:left; background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.06); }
.trail-authoring-issue:hover { background: rgba(255,255,255,.07); }
.trail-authoring-graph-edge.focused { stroke: #ffffff; stroke-width: 6; filter: drop-shadow(0 0 8px rgba(255,255,255,.35)); }
.trail-authoring-graph-node.focused circle { stroke: #ffffff; stroke-width: 6; filter: drop-shadow(0 0 10px rgba(255,255,255,.4)); }

/* Trail Authoring phase AR */
.trail-authoring-file-input { display:none; }
.trail-authoring-draft-toolbar,
.trail-authoring-issues-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:6px 0 8px; }
.trail-authoring-toggle { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.10); font-size:12px; }
.trail-authoring-toggle input { margin:0; }
.trail-authoring-issues-toolbar { justify-content:space-between; }
.trail-authoring-issues-meta { margin-left:auto; }

.trail-authoring-issues-search {
  min-width: 220px;
  flex: 1 1 240px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.22);
  color: inherit;
}

.trail-authoring-issues-search::placeholder {
  color: rgba(255,255,255,0.58);
}

.trail-authoring-preset-row,
.trail-authoring-bucket-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.trail-authoring-bucket-chip {
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#fff;
  border-radius:999px;
  padding:5px 10px;
  font:inherit;
  cursor:pointer;
}
.trail-authoring-bucket-chip span {
  display:inline-block;
  min-width:18px;
  margin-left:6px;
  padding:1px 6px;
  border-radius:999px;
  background:rgba(0,0,0,.25);
}
.trail-authoring-bucket-chip.active {
  background:rgba(94,203,200,.22);
  border-color:rgba(94,203,200,.55);
  box-shadow:0 0 0 1px rgba(94,203,200,.18) inset;
}

/* Race track layering + vertical track aspect fix */
.race-arena-root canvas {
  display: block !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  z-index: 1 !important;
}

.race-arena-root [id$="-chao-container"] {
  overflow: hidden !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

#race4-arena-panel.race-arena-root > .panel-body {
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  background: #000 !important;
}

#race4-canvas,
#race4-chao-container {
  inset: auto !important;
  width: 460px !important;
  height: 1980px !important;
  max-width: none !important;
  max-height: none !important;
}
