/* =========================================================
   PIXEL PET STUDIO – UI v2 "Sims 4 Forest Shell"
   Target: /index.html (desktop)
   - Keeps all existing ids/classes used by JS and patches
   - Sims 4 style: glassy HUD, plumbob, teal/green accents
   ========================================================= */

/* ---------- ROOT + GLOBAL ---------- */

:root {
  --pps-bg: #020617;
  --pps-bg-alt: #020617;
  --pps-panel: rgba(15, 23, 42, 0.92);
  --pps-panel-elevated: rgba(15, 23, 42, 0.98);
  --pps-border-subtle: rgba(148, 163, 184, 0.2);
  --pps-border-strong: rgba(56, 189, 248, 0.7);

  --pps-ink: #f9fafb;
  --pps-muted: #9ca3af;

  --pps-sims-green: #00e676;
  --pps-sims-green-soft: rgba(0, 230, 118, 0.18);
  --pps-sims-teal: #0ea5e9;
  --pps-sims-teal-soft: rgba(14, 165, 233, 0.22);

  --pps-accent: #22c55e;
  --pps-accent-soft: rgba(34, 197, 94, 0.18);
  --pps-accent2: #38bdf8;
  --pps-danger: #f97373;

  --pps-radius-sm: 10px;
  --pps-radius-md: 16px;
  --pps-radius-lg: 20px;
  --pps-radius-pill: 999px;

  --pps-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.65);
  --pps-shadow-panel: 0 18px 44px rgba(15, 23, 42, 0.9);

  --pps-ui-transition-fast: 0.12s ease-out;
  --pps-ui-transition: 0.18s ease-out;
  --pps-ui-transition-slow: 0.35s ease-out;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.pps-shell {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--pps-ink);

  /* Base gradient */
  background:
    radial-gradient(circle at 10% -20%, rgba(56, 189, 248, 0.32), transparent 55%),
    radial-gradient(circle at 90% 120%, rgba(16, 185, 129, 0.3), transparent 55%),
    radial-gradient(circle at 65% -35%, rgba(168, 85, 247, 0.2), transparent 60%),
    linear-gradient(180deg, #020617 0%, #020617 65%, #000000 100%);

  position: relative;
  overflow-x: hidden;
}

/* Animated aurora layer */
body.pps-shell::before {
  content: "";
  position: fixed;
  inset: -15% -25%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(56, 189, 248, 0.35), transparent 58%),
    radial-gradient(circle at 92% 6%, rgba(244, 114, 182, 0.3), transparent 60%),
    radial-gradient(circle at 65% 120%, rgba(34, 197, 94, 0.36), transparent 65%);
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: ppsAuroraFloat 36s linear infinite alternate;
}

/* Animated hills / horizon glow */
body.pps-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 120%, rgba(16, 185, 129, 0.7) 0, transparent 60%),
    radial-gradient(circle at 45% 118%, rgba(34, 197, 94, 0.55) 0, transparent 58%),
    radial-gradient(circle at 80% 125%, rgba(56, 189, 248, 0.55) 0, transparent 60%);
  opacity: 0.7;
  transform-origin: bottom center;
  animation: ppsHillsDrift 40s ease-in-out infinite alternate;
}

@keyframes ppsAuroraFloat {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: hue-rotate(0deg) saturate(1);
  }
  50% {
    transform: translate3d(-18px, -10px, 0) scale(1.03);
    filter: hue-rotate(12deg) saturate(1.1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: hue-rotate(0deg) saturate(1);
  }
}

@keyframes ppsHillsDrift {
  0% {
    transform: translate3d(0, 4px, 0) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translate3d(0, 0, 0) scale(1.03);
    opacity: 0.82;
  }
  100% {
    transform: translate3d(0, 6px, 0) scale(1);
    opacity: 0.55;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.pps-shell::before,
  body.pps-shell::after {
    animation: none;
  }
}

/* Utilities */
.hide {
  display: none !important;
}

.muted {
  color: var(--pps-muted);
}

.grow {
  flex: 1;
}

/* =========================================================
   TOP BAR – Sims-style HUD strip
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.1rem;

  background:
    linear-gradient(
      120deg,
      #020617 0%,
      #020617 8%,
      #0f172a 28%,
      #142952 57%,
      #026c7c 100%
    );
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(14px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Brand mark: plumbob diamond */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand-mark {
  width: 18px;
  height: 26px;
  position: relative;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.9));
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 3px;
  transform-origin: center;
}

.brand-mark::before {
  top: 0;
  transform: rotate(45deg);
  background:
    radial-gradient(circle at 30% 20%, #bbf7d0 0, var(--pps-sims-green) 58%, #065f46 100%);
  box-shadow:
    0 0 10px rgba(45, 212, 191, 0.95),
    0 0 0 1px rgba(5, 150, 105, 0.9);
}

.brand-mark::after {
  bottom: -3px;
  transform: rotate(45deg);
  background:
    radial-gradient(circle at 70% 80%, #dcfce7 0, #22c55e 55%, #052e16 100%);
  opacity: 0.85;
}

.brand-text {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 0 14px rgba(15, 23, 42, 0.9);
}

/* Version pill – shows sim+UI version */
.version-pill {
  padding: 0.2rem 0.7rem;
  border-radius: var(--pps-radius-pill);
  background:
    radial-gradient(circle at 0 0, rgba(148, 163, 184, 0.42), transparent 70%),
    rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.72rem;
  white-space: nowrap;
  color: #e5f1ff;
}

/* center controls */
.topbar-center {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1.1rem;
}

.sim-speed-label {
  font-size: 0.8rem;
}

/* Topbar action buttons area */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Auth area */
.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.4rem;
  padding-left: 0.4rem;
  border-left: 1px solid rgba(30, 64, 175, 0.55);
}

/* =========================================================
   BUTTONS / CHIPS
   ========================================================= */

button {
  font-family: inherit;
}

.chip {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(51, 65, 85, 0.95);
  color: var(--pps-ink);
  padding: 0.38rem 0.9rem;
  border-radius: var(--pps-radius-pill);
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2rem;

  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 10px 20px rgba(15, 23, 42, 0.9);

  transition:
    background var(--pps-ui-transition),
    border-color var(--pps-ui-transition),
    transform var(--pps-ui-transition-fast),
    box-shadow var(--pps-ui-transition);
}

.chip:hover {
  border-color: rgba(148, 163, 184, 0.95);
  background: rgba(15, 23, 42, 1);
  box-shadow:
    0 12px 22px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 1);
}

.chip:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.9);
}

/* Primary / Save button */
.primary {
  background: radial-gradient(circle at 0 0, #bbf7d0, transparent 60%),
    linear-gradient(135deg, #16a34a, #22c55e, #22c55e, #22c55e);
  border-radius: var(--pps-radius-pill);
  border: 1px solid rgba(21, 128, 61, 0.8);
  color: #022c22;
  padding: 0.45rem 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2.1rem;

  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.75),
    0 11px 26px rgba(21, 128, 61, 0.9);

  transition:
    transform var(--pps-ui-transition-fast),
    box-shadow var(--pps-ui-transition),
    filter var(--pps-ui-transition);
}

.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(187, 247, 208, 0.95),
    0 15px 30px rgba(22, 163, 74, 0.95);
}

.primary:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 5px 14px rgba(21, 128, 61, 0.9);
}

/* Sim speed select piggybacks on .chip look */
.sim-speed-select {
  min-width: 4.5rem;
}

/* =========================================================
   LAYOUT: sidebar + world stage
   ========================================================= */

.layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1rem 1.25rem;

  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
}

/* Sidebar (palette + goals + inspector) */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Panels */
.panel {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.96),
      rgba(30, 64, 175, 0.18)
    );
  border-radius: var(--pps-radius-lg);
  border: 1px solid var(--pps-border-subtle);
  box-shadow: var(--pps-shadow-panel);
  overflow: hidden;
  backdrop-filter: blur(12px);

  animation: ppsPanelIn 0.35s var(--pps-ui-transition) backwards;
}

@keyframes ppsPanelIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-header {
  padding: 0.6rem 0.9rem 0.3rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.95);
  background:
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.96),
      rgba(59, 130, 246, 0.12)
    );
}

.panel-header h3 {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.panel-body {
  padding: 0.65rem 0.9rem 0.8rem;
  font-size: 0.85rem;
}

/* Palette specifics */
.panel-palette .panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#palette label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pps-muted);
}

#palette select,
#palette input[type="text"] {
  width: 100%;
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
  border-radius: var(--pps-radius-sm);
  border: 1px solid rgba(30, 64, 175, 0.8);
  background: rgba(15, 23, 42, 0.95);
  color: var(--pps-ink);
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  transition:
    border-color var(--pps-ui-transition),
    box-shadow var(--pps-ui-transition),
    background var(--pps-ui-transition);
}

#palette select:focus,
#palette input[type="text"]:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.85),
    0 0 18px rgba(56, 189, 248, 0.45);
}

/* Goals */
.goals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Inspector */
.panel-inspector .inspect-body {
  font-size: 0.82rem;
  line-height: 1.4;
}

/* =========================================================
   WORLD STAGE + MINIMAP
   ========================================================= */

.stage-wrap {
  position: relative;
  min-height: 0;
}

.stage-frame {
  position: relative;
  border-radius: 26px;
  padding: 0.3rem;
  background:
    radial-gradient(circle at 0 0, rgba(125, 211, 252, 0.35), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(74, 222, 128, 0.3), transparent 55%),
    linear-gradient(145deg, #020617, #020617 40%, #020617 100%);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.95),
    0 24px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

/* Sub-frame border around canvas */
.stage-frame::before {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    0 0 40px rgba(15, 23, 42, 0.9) inset;
  pointer-events: none;
}

/* Main canvas */
#game {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #020617;
}

/* Hint overlay */
.hint {
  position: absolute;
  left: 1.5rem;
  bottom: 1rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--pps-radius-pill);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.75rem;
  color: var(--pps-muted);
  backdrop-filter: blur(10px);
}

/* Toast container; toast.css handles individual toasts */
#toasts {
  position: absolute;
  right: 1.5rem;
  top: 1rem;
  z-index: 10;
}

/* Minimaps – fixed HUD chip on desktop */
#minimap {
  position: fixed;
  top: 4.4rem;
  right: 1.0rem;
  width: 220px;
  max-width: 26vw;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.95);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.98),
    0 0 0 1px rgba(15, 23, 42, 0.95);
  z-index: 12;
}

/* Hide minimap when god toolbar toggles it via dataset */
#minimap[data-gtHidden="1"] {
  display: none !important;
}

/* =========================================================
   GOD TOOLBAR (html fragment from /ui/god_toolbar_removed)
   Class names from js/patches/god_toolbar_loader_v1.js
   ========================================================= */

#ppsGodToolbarRoot {
  position: fixed;
  right: 1.2rem;
  bottom: 1.1rem;
  z-index: 30;
  font-family: inherit;
}

/* Toggle button */
#ppsGodToolbarToggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background:
    radial-gradient(circle at 0 0, rgba(74, 222, 128, 0.4), transparent 60%),
    linear-gradient(135deg, #0f172a, #020617);
  color: var(--pps-ink);
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  transition:
    transform var(--pps-ui-transition-fast),
    box-shadow var(--pps-ui-transition),
    filter var(--pps-ui-transition);
}

#ppsGodToolbarToggle:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.96),
    0 0 0 1px rgba(56, 189, 248, 0.9);
}

#ppsGodToolbarRoot.pps-gtb-open #ppsGodToolbarToggle {
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.95),
    0 18px 40px rgba(22, 163, 74, 0.9);
}

/* Panel */
#ppsGodToolbarPanel {
  margin-top: 0.5rem;
  min-width: 260px;
  max-width: 320px;
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.97),
      rgba(12, 74, 110, 0.8)
    );
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.96),
    0 0 0 1px rgba(15, 23, 42, 0.98);
  color: var(--pps-ink);
  overflow: hidden;
  backdrop-filter: blur(14px);
  padding: 0.5rem 0.55rem 0.6rem;

  transform-origin: bottom right;
  transform: scale(0.96) translateY(6px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--pps-ui-transition-slow),
    opacity var(--pps-ui-transition-slow);
}

#ppsGodToolbarRoot.pps-gtb-open #ppsGodToolbarPanel {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Close button inside panel, if present */
#ppsGodToolbarClose {
  border: none;
  background: transparent;
  color: var(--pps-muted);
  cursor: pointer;
}

/* Nav row */
.pps-gtb-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.pps-gtb-nav-item {
  flex: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: var(--pps-muted);
  transition:
    background var(--pps-ui-transition),
    color var(--pps-ui-transition),
    border-color var(--pps-ui-transition);
}

.pps-gtb-nav-item:hover {
  color: var(--pps-ink);
  border-color: rgba(148, 163, 184, 0.7);
}

.pps-gtb-nav-item--active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
  border-color: rgba(34, 197, 94, 0.9);
}

/* Pages */
.pps-gtb-page {
  display: none;
  padding: 0.25rem;
  max-height: 260px;
  overflow-y: auto;
}

.pps-gtb-page--active {
  display: block;
}

/* Tool grid inside pages (assumes cards) */
.pps-gtb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.pps-gtb-item {
  padding: 0.35rem 0.45rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  transition:
    background var(--pps-ui-transition),
    border-color var(--pps-ui-transition),
    transform var(--pps-ui-transition-fast),
    box-shadow var(--pps-ui-transition);
}

.pps-gtb-item:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(56, 189, 248, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.9);
}

.pps-gtb-item-title {
  font-weight: 500;
}

.pps-gtb-item-sub {
  font-size: 0.68rem;
  color: var(--pps-muted);
}

/* Mode tools visual emphasis */
.pps-gtb-item[data-tool="guide-path"],
.pps-gtb-item[data-tool="sanctuary-aura"],
.pps-gtb-item[data-tool="forgetfulness-fog"],
.pps-gtb-item[data-tool="show-lessons"] {
  border-style: solid;
  border-width: 1px;
  border-color: rgba(56, 189, 248, 0.9);
}

/* Trash / cleanup highlight */
body.pps-cleanup-mode .stage-frame {
  box-shadow:
    0 0 0 2px rgba(248, 113, 113, 0.9),
    0 24px 50px rgba(0, 0, 0, 0.96);
}

/* Overlay debug states coming from god toolbar flags */
body.pps-route-heatmap-on .stage-frame::after {
  content: "ROUTE HEATMAP";
  position: absolute;
  top: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(8, 47, 73, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.8);
  color: #e0f2fe;
}

body.pps-fire-heatmap-on .stage-frame::after {
  content: "FIRE HEATMAP";
  background: rgba(127, 29, 29, 0.94);
  border-color: rgba(248, 113, 113, 0.95);
  color: #fee2e2;
}

body.pps-culture-overlay-on .topbar {
  box-shadow:
    0 18px 40px rgba(22, 163, 74, 0.9),
    0 0 0 1px rgba(34, 197, 94, 0.9);
}

body.pps-show-colliders-on .stage-frame {
  border: 1px dashed rgba(251, 191, 36, 0.88);
}

/* =========================================================
   TOUCH BEHAVIOUR (desktop & tablets)
   ========================================================= */

canvas,
#game {
  touch-action: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    order: 2;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
  }

  .panel {
    min-width: 260px;
    flex: 1;
  }

  #minimap {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    width: 180px;
  }
}

@media (max-width: 780px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 0.3rem;
  }

  .layout {
    padding-inline: 0.65rem;
  }
}

/* Done – desktop shell v2 */


/* =========================================================
   PIXEL PET STUDIO – INSPECTOR PANEL LAYOUT (v3)
   - Fix: new theme + draggable floating inspector
   - .is-floating is handled by /css/pixelpet-inspector.css
   - Docked (no .is-floating): keep in sidebar but make body scroll-safe
   ========================================================= */

body.pps-shell .layout{
  align-items: flex-start;
}

/* Ensure inspector uses a flex column so the body can scroll */
#inspector.panel-inspector{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#inspector.panel-inspector .panel-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden; /* the scroller is #inspectBody */
}

/* Scroll container for long inspector content */
#inspectBody{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Docked mode: keep it from stretching the whole page */
#inspector.panel-inspector:not(.is-floating){
  position: relative;
  width: 100%;
  max-height: min(62vh, calc(100vh - 7rem));
}

/* Tidy headings */
#inspectBody h1,
#inspectBody h2{
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 600;
}

#inspectBody h3{
  margin: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Inventory & trait chips inside the inspector */
#inspectBody .chip,
#inspectBody button.chip{
  font-size: 0.78rem;
  padding: 0.24rem 0.7rem;
  min-height: 0;
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* ===== end inspector layout v3 ===== */

