:root { color-scheme: light dark; }
html, body { margin:0; padding:0; background:#0e0c22; color:#e6e6ee; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
a { color:#c4b5fd; text-decoration:none; }
a:hover { text-decoration:underline; }
.btn { display:inline-block; padding:10px 14px; border-radius:10px; background:#161342; color:#fff; border:1px solid rgba(255,255,255,.18); }
/* === Contrast hotfix: force brighter hero text === */
body .hero h1{
  color:#fff !important;
  text-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 1px rgba(0,0,0,.6) !important;
}

body .hero p,
body .hero .muted{
  color:#f2f3fb !important;
}
/* Limit the Project Setup panel height and enable internal scrolling */
#project-setup,
.project-setup,
[data-section="project-setup"]{
  max-height: 90vh;          /* never taller than viewport */
  overflow: auto;            /* scroll INSIDE the panel */
  overscroll-behavior: contain;
}

/* Make the panel’s header sticky so the Close button is always on-screen */
#project-setup header,
.project-setup header,
[data-section="project-setup"] header,
#project-setup .ps-header,
.project-setup .ps-header,
[data-section="project-setup"] .ps-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface, #120d2a);
  border-bottom: 1px solid var(--line, rgba(255,255,255,.14));
  padding-top: .25rem;
}

/* Keep the Close button aligned to the right and clickable */
#project-setup [data-close],
#project-setup .close,
#project-setup .close-btn,
.project-setup [data-close],
.project-setup .close,
.project-setup .close-btn,
[data-section="project-setup"] [data-close],
[data-section="project-setup"] .close,
[data-section="project-setup"] .close-btn{
  margin-left: auto;
  position: relative; /* ensure it sits above content in the sticky header */
  z-index: 60;
}
/* Project Setup panel sizing + scroll */
#project-setup, .project-setup, [data-section="project-setup"]{
  position: relative;
  max-height: 88vh !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}

/* Sticky header so Close stays visible */
#project-setup header, .project-setup > header, [data-section="project-setup"] > header,
#project-setup .ps-header, .project-setup .ps-header, [data-section="project-setup"] .ps-header{
  position: sticky !important;
  top: 0;
  z-index: 9999;
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface, #0f0b21) !important;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.18));
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  padding: .5rem .75rem;
}

/* Make Close big & bright */
#project-setup [data-close], #project-setup .close, #project-setup .close-btn,
.project-setup [data-close], .project-setup .close, .project-setup .close-btn,
[data-section="project-setup"] [data-close], [data-section="project-setup"] .close, [data-section="project-setup"] .close-btn{
  margin-left: auto !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  padding: .6rem .9rem !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #7c3aed, #a78bfa) !important;
  color: #fff !important;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}

/* Floating fallback Close button (appears when header is off-screen) */
#psCloseFloating{
  display: none;
  position: fixed;
  top: 16px; right: 16px;
  width: 46px; height: 46px;
  border-radius: 999px;
  z-index: 100000;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  font-size: 26px; font-weight: 900; line-height: 46px; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  user-select: none; cursor: pointer;
}
@media (max-width: 600px){
  #psCloseFloating{ top: 10px; right: 10px; width: 44px; height: 44px; line-height: 44px; }
}
/* === Project Setup: size it down & keep it centered === */
:root{
  /* tweak these two numbers if you want it narrower/taller */
  --ps-max-w: 760px;
  --ps-max-h: 82vh;
}

#project-setup,
.project-setup,
[data-section="project-setup"]{
  box-sizing: border-box;
  width: min(92vw, var(--ps-max-w)) !important;  /* narrower container */
  max-height: var(--ps-max-h) !important;        /* never taller than viewport */
  overflow: auto !important;                      /* scroll inside the panel */
  margin: 1rem auto !important;                   /* center horizontally */
  padding: 1rem !important;
  border-radius: 14px !important;
  border: 1px solid var(--line, rgba(255,255,255,.14));
  background: var(--surface, #0f0b21);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

/* If the parent is a flex row, ensure the panel can center & not stretch */
#project-setup, .project-setup, [data-section="project-setup"]{
  align-self: center !important;
  flex: 0 0 auto !important;
}

/* Keep the header (with Close) visible while scrolling */
#project-setup header,
.project-setup > header,
[data-section="project-setup"] > header,
#project-setup .ps-header,
.project-setup .ps-header,
[data-section="project-setup"] .ps-header{
  position: sticky !important;
  top: 0;
  z-index: 10;
  background: var(--surface, #0f0b21);
  border-bottom: 1px solid var(--line, rgba(255,255,255,.18));
  padding: .5rem .75rem;
}

/* Make the close button prominent and right-aligned */
#project-setup [data-close], #project-setup .close, #project-setup .close-btn,
.project-setup [data-close], .project-setup .close, .project-setup .close-btn,
[data-section="project-setup"] [data-close], [data-section="project-setup"] .close, [data-section="project-setup"] .close-btn{
  margin-left: auto !important;
  font-weight: 800 !important;
  padding: .5rem .8rem !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg,#7c3aed,#a78bfa) !important;
  color: #fff !important;
  border: 0 !important;
  cursor: pointer;
}

/* Slightly tighter on small screens */
@media (max-width: 600px){
  :root{ --ps-max-w: 520px; --ps-max-h: 85vh; }
}
/* Templates page contrast fixes */
[data-tpl].card {
  background: #15122e;
  color: #eef;
  border: 1px solid rgba(255,255,255,.16);
}
[data-tpl].card h4,
[data-tpl].card p { color:#fff; }

.btn, .btn.primary { color:#fff !important; }
.post-nav a, .foot-links a { color:#e9e7ff !important; }
[data-tpl].selected{
  outline:2px solid #a78bfa;
  box-shadow:0 0 0 4px rgba(167,139,250,.25);
}
