: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);
}
/* === File Upload Button Fix === */
input[type="file"]::file-selector-button {
  font: inherit;
  background: linear-gradient(135deg, var(--brand, #7c3aed), var(--brand2, #a78bfa));
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  transition: filter 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(.95);
}
input[type="file"]::-webkit-file-upload-button { /* Safari fallback */
  font: inherit;
  background: linear-gradient(135deg, var(--brand, #7c3aed), var(--brand2, #a78bfa));
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  transition: filter 0.2s ease;
}
input[type="file"]::-webkit-file-upload-button:hover {
  filter: brightness(.95);
}
/* === Force Upload Button to match brand theme === */
input[type="file"],
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  font: inherit !important;
  background: linear-gradient(135deg, var(--brand, #7c3aed), var(--brand2, #a78bfa)) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.6rem 1rem !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.35) !important;
  transition: filter 0.2s ease !important;
}

input[type="file"]:hover,
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  filter: brightness(.92) !important;
}
/* === Force Upload Button to match brand theme === */
input[type="file"],
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  font: inherit !important;
  background: linear-gradient(135deg, var(--brand, #7c3aed), var(--brand2, #a78bfa)) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.6rem 1rem !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.35) !important;
  transition: filter 0.2s ease !important;
}

input[type="file"]:hover,
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  filter: brightness(.92) !important;
}
/* === Jenesis Forge Flame Glow === */
@keyframes flameGlow {
  0%   { filter: drop-shadow(0 0 0px rgba(212,175,55,0.20)) brightness(1.00); }
  50%  { filter: drop-shadow(0 0 22px rgba(212,175,55,0.55)) brightness(1.08); }
  100% { filter: drop-shadow(0 0 0px rgba(212,175,55,0.20)) brightness(1.00); }
}

.logo {
  animation: flameGlow 2.8s ease-in-out infinite;
  will-change: filter, transform;
}
/* === Jenesis Forge logo fix === */
.brand .logo {
  height: 56px !important;
  width: auto !important;
  display: inline-block;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  transition: transform 0.3s ease-in-out;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .name {
  font-size: 1.25rem;
  font-weight: 600;
}
@keyframes flameGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(212,175,55,0.2)); }
  50% { filter: drop-shadow(0 0 16px rgba(212,175,55,0.5)); }
}
.brand .logo {
  animation: flameGlow 3s ease-in-out infinite;
}
