/* =========================================================
   WEAVE / ALCHEMII STUDIO — BRIEF UI SHELL RESTORATION
   FULL REPLACEMENT
   ========================================================= */

:root{
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.42);
  --glass-shadow: 0 18px 48px rgba(15,23,42,0.16);

  --text-main: #1f2937;
  --text-soft: #4b5563;
  --text-muted: #6b7280;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --container-max: 1440px;
}

/* =========================================================
   GLOBAL
   ========================================================= */

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  min-height:100%;
}

body.page{
  font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--text-main);
  position:relative;
  overflow-x:hidden;
}

/* =========================================================
   BACKGROUND
   ========================================================= */

#bg-layer{
  position:fixed;
  inset:0;
  z-index:-20;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}

#bg-overlay{
  position:fixed;
  inset:0;
  z-index:-19;
  background:rgba(225,235,245,0.28);
  backdrop-filter: blur(2px);
}

/* =========================================================
   PAGE WRAP
   ========================================================= */

.wrap,
#wrap,
main.wrap{
  width:min(1280px, calc(100% - 48px));
  margin:110px auto 40px auto;
  position:relative;
  z-index:10;

  display:flex;
  flex-direction:column;
  gap:32px;
  box-sizing:border-box;
}

/* =========================================================
   TOP SHELL
   ========================================================= */

#topbar,
.appbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  border-radius:22px;
  background:var(--glass-bg);
  border:1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  margin-bottom:20px;
  position:sticky;
  top:14px;
  z-index:100;
}

.app-logo,
.logo{
  height:54px;
  width:auto;
  object-fit:contain;
}

.spacer{
  flex:1;
}

.appbar .btn,
#topbar .btn{
  border:none;
  border-radius:999px;
  padding:10px 16px;
  background:rgba(255,255,255,0.82);
  cursor:pointer;
  font-size:14px;
  color:var(--text-main);
  box-shadow:0 4px 14px rgba(0,0,0,0.08);
}

.appbar .btn:hover,
#topbar .btn:hover{
  transform:translateY(-1px);
}

/* =========================================================
   SECTION SHELL
   ========================================================= */

section.card,
.card,
.glass-card{
  background:var(--glass-bg);
  border:1px solid var(--glass-border);
  border-radius:24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
  padding:22px;
  margin-bottom:20px;
  position:relative;
}

.section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}

.section-title,
h2.section-title{
  margin:0;
  font-size:24px;
  font-weight:700;
  color:var(--text-main);
}

.tip{

    display:none;

}

.has-tip{

    position:relative;

}

.has-tip .tip{

    display:none;

    position:absolute;

    bottom:calc(100% + 12px);

    left:50%;

    transform:translateX(-50%);

    width:260px;

    padding:12px 14px;

    border-radius:12px;

    background:#F4A641;

    color:#111111;

    font-size:13px;

    font-weight:600;

    line-height:1.4;

    text-align:center;

    white-space:normal;

    box-shadow:0 10px 28px rgba(0,0,0,.25);

    z-index:99999;

}

.has-tip:hover .tip{

    display:block;

}

/* =========================================================
   ZIP BUTTONS
   ========================================================= */

.pill.zip{
  border:none;
  border-radius:999px;
  padding:10px 18px;
  background:#000000;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
}

.zip-body{
  margin-top:16px;
}

/* =========================================================
   FORM SYSTEM
   ========================================================= */

label{
  display:block;
  margin-bottom:8px;
  font-size:18px;
  font-weight:600;
  color:#f5f5f5 ;
}

input[type="text"],
input[type="email"],
textarea,
select{
  width:100%;
  border:1px solid rgba(203,213,225,0.9);
  border-radius:12px;
  padding:14px 16px;
  font-size:15px;
  color:var(--text-main);
  background:rgba(255,255,255,0.94);
  outline:none;
}

input:focus,
textarea:focus,
select:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,0.18);
}

textarea{
  resize:vertical;
  min-height:180px;
  line-height:1.5;
}

/* =========================================================
   BUTTON SYSTEM
   ========================================================= */

button,
.button{
  border:none;
  border-radius:12px;
  padding:12px 18px;
  background:#111111;
  color:#ffffff;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:all .18s ease;
}

button:hover,
.button:hover{
  transform:translateY(-1px);
}

.primary{
  background:var(--primary);
  color:white;
}

.primary:hover{
  background:var(--primary-hover);
}

.ghost{
  background:rgba(255,255,255,0.82);
  color:var(--text-main);
}

.btn-success{
  background:var(--success);
  color:white;
}

/* =========================================================
   CHANNEL CHIPS
   ========================================================= */

.chips,
#channels{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,0.88);
  border:1px solid rgba(255,255,255,0.42);
}

/* =========================================================
   STRATEGIC CONTEXT
   ========================================================= */

#audCard{
  width:100%;
}

#audCard .section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#audCard .pill.zip{
  border:none;
  border-radius:999px;
  padding:10px 18px;
  background:#000000;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
  width:240px;
  min-width:240px;
  flex:none !important;
}

#audCard .zip-body{
  width:100%;
  padding:0;
  margin:0;
}

#audCard .aud-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:56px;
  width:100%;
  align-items:start;
  box-sizing:border-box;
}

#audCard .col{
  width:100%;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

#audCard .funnel-col{
  display:flex;
  flex-direction:column;
  gap:8px;
  width:100%;
}

#audCard .funnel-col select{
  width:100%;
  max-width:260px;
  min-width:260px;
  box-sizing:border-box;
}

#audCard .field-help{
  font-size:14px;
  font-weight:500;
  color:#5b616b;
}
#audCard .stretch{
  grid-column:1 / -1;
}

#audCard .project-name-row{

    display:flex;

    align-items:center;

    gap:16px;

    width:100%;

}

#audCard .project-name-row label{

    flex:0 0 140px;

    margin:0;

    color:#3f3f3f;

    font-size:16px;

    font-weight:700;

}

#audCard .project-name-row input{

    flex:1;

    width:100%;

}

#audCard select,
#audCard input,
#audCard button{
  width:100%;
  box-sizing:border-box;
}

#audCard .multi{
  width:100%;
}

#audCard .multi [data-ms="btn"]{
  width:100%;
  max-width:260px;
  min-width:260px;
  justify-content:space-between;
}

#audCard .goals-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap:14px 28px;
  width:100%;
  align-items:center;
}

#audCard .goals-grid label{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
  margin:0;
  cursor:pointer;
}

#audCard .goals-grid input[type="radio"]{
  margin:0;
  width:auto;
  flex:0 0 auto;
}

#audCard .goals-grid label span{
  display:inline-block;
}

#audCard #channels{
  display:grid;
  grid-template-columns:repeat(3, minmax(180px, 1fr));
  gap:14px 24px;
  width:100%;
  align-items:center;
}

#audCard #channels label{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  white-space:nowrap;
  cursor:pointer;
  width:100%;
}

#audCard #channels input[type="checkbox"]{
  width:auto;
  margin:0;
  flex:0 0 auto;
}

/* =========================================================
   NARRATIVE COMPASS

   CRITICAL
   ========================================================= */

#audCard .grid-2,
#profilesCard .grid-2{
  display:grid;
 grid-template-columns: 42% 52%;
  gap:18px;
  align-items:stretch;
  width:100%;
  min-width:0;
  flex:1;
}

#profilesCard .zip-body{
  display:flex;
  width:100%;
  padding:0;
  margin:0;
}

#profilesCard .block{
  display:flex;
  flex-direction:column;
  min-height:100%;
  width:100%;
  padding:16px;
  border-radius:20px;
  background:rgba(255,255,255,0.68);
  border:1px solid rgba(255,255,255,0.42);
  backdrop-filter: blur(12px);
  box-sizing:border-box;
}

#profilesCard textarea{
  flex:1;
  min-height:260px;
}

#profilesCard select{
  margin-bottom:14px;
}

#profilesCard .grid-2 > div{
  width:100%;
  min-width:0;
  max-width:none;
  margin:0;
}

#profilesCard .grid-2 .block{
  width:100%;
  height:100%;
}

#profilesCard .block select,
#profilesCard .block textarea,
#profilesCard .block input{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

/* =========================================================
   PROMPT BUILDER
   ========================================================= */

#promptCard .grid-2 > div{
  min-width:0;
}

/* =========================================================
   ACTION ROWS
   ========================================================= */

.row-tools{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* =========================================================
   SMALL TEXT
   ========================================================= */

.muted{
  color:var(--text-muted);
  font-size:13px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px){
#audCard .aud-grid{
  grid-template-columns:1fr;
}

#audCard .goals-grid{
  grid-template-columns:1fr;
}
  #audCard .zip-body,
  #profilesCard .zip-body,
  #promptCard .grid-2,
  .grid-2{
    grid-template-columns:1fr;
  }

.wrap,
#wrap,
main.wrap{
  width:min(1500px, calc(100vw - 48px));
  margin:0 auto;
}
}
/* ==========================================
   PROMPT BUILDER — FINAL CLEAN LAYOUT
   ========================================== */
#promptCard{
  padding:24px;
  box-sizing:border-box;
}

#promptCard .prompt-grid{
  display:grid;
  grid-template-columns: 38% 58%;
  gap:24px;
  width:100%;
  max-width:100%;
  align-items:start;
  box-sizing:border-box;
  padding-right:2px;
}

#promptCard .prompt-left,
#promptCard .prompt-right{
  width:100%;
  display:flex;
  min-width:0;
}
#promptCard .prompt-left .block,
#promptCard .prompt-right .block{
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
}

#trendsSel,
#pillarsSel{
  width:100%;
  min-height:360px;
  height:360px;
}

#trendsSel optgroup,
#pillarsSel optgroup{
  font-weight:700;
  font-size:16px;
  color:#3f3f3f;
}

#compiledPrompt{
  width:100%;
  min-height:420px;
  height:420px;
  resize:vertical;
  display:block;
}
/* NARRATIVE COMPASS HARD FIX */

#challengeCard{
  width:100%;
}

#profilesCard .profile-challenge-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap:24px;
  width:100%;
  padding:0 24px 0 24px;
  align-items:stretch;
  box-sizing:border-box;
}

#profilesCard .profile-panel,
#profilesCard .challenge-panel{
  width:100%;
  min-width:0;
  max-width:none;
  box-sizing:border-box;
}
#audCard input[type="radio"]{
  accent-color:#000;
}
#audCard input[type="checkbox"]{
  accent-color:#000 !important;
}

#audCard .zip-body > label,
#audCard .col.stretch > label{
  color:#3f3f3f;
  font-size:16px;
  font-weight:700;
}
/* =========================================================
   TOP NAVBAR
   ========================================================= */

#appTopbar{
  position:sticky;
  top:0;
  z-index:9999;

  display:flex;
  align-items:center;
  justify-content:space-between;

  width:100%;
  padding:14px 28px;

 background:rgba(120,120,120,0.30);
  backdrop-filter:blur(18px);

  border-bottom:1px solid rgba(255,255,255,0.08);

  box-sizing:border-box;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:36px;
}

.brand-wrap{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.brand-logo{
  height:46px;
  width:auto;
  display:block;
}

.top-nav{
  display:flex;
  align-items:center;
  gap:14px;
}

.top-nav-link{
  text-decoration:none;
  color:#ffffff;
  font-size:15px;
  font-weight:600;

  padding:8px 10px;
  border-radius:10px;

  background:transparent;
  border:none;

  transition:all 0.2s ease;
}

.top-nav-link:hover{
  color:#fff;
  opacity:0.85;
}

.top-nav-link.active{
  background:#000;
  color:#fff;
  padding:10px 14px;
  border-radius:12px;
}

.topbar-right{
  display:flex;
  align-items:center;
}

.token-pill{
  padding:10px 18px;
  border-radius:999px;

  background:rgba(255,255,255,0.92);
  color:#222;

  font-size:13px;
  font-weight:700;

  box-shadow:0 6px 18px rgba(0,0,0,0.12);
}
#promptCard label{
  color:#3a3a3a;
  font-size:17px;
  font-weight:700;
}
/* =========================================================
   SIGN IN PAGE
   ========================================================= */

.signin-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  box-sizing:border-box;
}

.signin-page #topbar{
  display:none !important;
}

.signin-shell{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.signin-card{
  width:100%;
  max-width:520px;
  padding:40px;
  border-radius:28px;
  background:rgba(255,255,255,0.22);
  border:1px solid rgba(255,255,255,0.28);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 20px 50px rgba(0,0,0,0.18);

  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
  box-sizing:border-box;
}

.signin-logo{
  width:440px;
  height:auto;
  display:block;
}

.signin-title{
  margin:0;
  font-size:32px;
  font-weight:700;
  color:#000000;
  text-align:center;
}

.signin-subtitle{
  margin:0;
  font-size:16px;
  font-weight:700;
  color:#000000;
  text-align:center;
}

.signin-input{
  width:100%;
  height:54px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.35);
  background:rgba(255,255,255,0.88);
  color:#1f2937;
  font-size:16px;
  box-sizing:border-box;
}

.signin-password-wrap{
  width:100%;
  position:relative;
}

.signin-password-wrap .signin-input{
  padding-right:56px;
}

.signin-eye{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:18px;
}

.signin-btn{
  width:100%;
  height:54px;
  border:none;
  border-radius:14px;
  background:#111827;
  color:#ffffff;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  transition:transform 0.15s ease;
}

.signin-btn:hover{
  transform:translateY(-1px);
}

.shake{
  animation:signinShake 0.4s ease;
}

@keyframes signinShake{
  0%{transform:translateX(0);}
  25%{transform:translateX(-6px);}
  50%{transform:translateX(6px);}
  75%{transform:translateX(-6px);}
  100%{transform:translateX(0);}
}
/* PROMPT BUILDER 2-COLUMN DIVIDER */
#promptCard .prompt-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:24px;
  align-items:stretch;
}

#promptCard .prompt-left{
  padding-right:16px;
  border-right:1px solid rgba(31,41,55,0.18);
}

#promptCard .prompt-right{
  padding-left:16px;
}
.multi{
  position:relative;
}

.multi .panel{
  display:none;
  position:absolute;
  top:100%;
  left:0;
  right:0;
  z-index:1000;
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(0,0,0,0.12);
  border-radius:14px;
  padding:12px;
  box-shadow:0 12px 28px rgba(0,0,0,0.12);
}

.multi.open .panel{
  display:block;
}
.btn-reset-pill{
  width:100%;
  border:none;
  border-radius:14px;
  padding:14px 18px;
  background:#3a3f46;
  color:#fff;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  transition:background 0.2s ease;
}

.btn-reset-pill:hover{
  background:#2f343a;
}

.other-input{
  width:100%;
  margin-top:10px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.25);
  background:rgba(255,255,255,0.95);
  box-sizing:border-box;
}
.button-disabled{
  opacity:0.5;
  pointer-events:none;
  cursor:not-allowed;
}

/* =========================================================
   VIDEO TOOLBAR AUTHORITY
   ========================================================= */

 .video-toolbar-authority{

  display:grid;

  grid-template-columns:
    240px
    240px
    140px
    140px;

  align-items:center;

  justify-content:start;

  column-gap:14px;

  margin-top:12px;

  margin-bottom:20px;
}

.video-pill-control{

  width:160px;

  height:40px;

  border:none;

  border-radius:14px;

  padding:0 14px;

  background:#000000;

  color:#ffffff;

  font-size:13px;

  font-weight:700;

  cursor:pointer;

  box-shadow:0 4px 12px rgba(0,0,0,0.18);

  appearance:none;

  -webkit-appearance:none;

  -moz-appearance:none;

  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='M5 7l5 5 5-5'/%3E%3C/svg%3E");

  background-repeat:no-repeat;

  background-position:right 12px center;

  padding-right:34px;
}

.video-pill-control option{

  color:#111827;

  background:#ffffff;
}

.video-pill-black{

  border:none;

  border-radius:14px;

  height:40px;

  width:240px;

  padding:0 16px;

  background:#000000;

  color:#ffffff;

  font-size:13px;

  font-weight:700;

  cursor:pointer;

  box-shadow:0 4px 12px rgba(0,0,0,0.18);
}

.video-pill-black:hover{

  opacity:0.92;
}

.workspace-btn{

  width:440px;
  min-width:510px;
  height:42px;

  white-space:nowrap;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#111111;
  color:#ffffff;

  border:1px solid #000000;
  border-radius:12px;

  font-weight:700;
  cursor:pointer;

  transition:all .2s ease;
}


#storyboard-monitor{

  display:flex;

  align-items:center;

  justify-content:center;

  gap:12px;
}

#video-zip-toggle{

  width:140px;
}

.story-light{

  width:42px;

  height:42px;

  border-radius:999px;

  border:none;

  font-weight:700;

  background:#6b7280;

  color:#ffffff;
}

.story-light.idle{

  background:#6b7280;
}

.story-light.generating{

  background:#f59e0b;

  animation:pulseLight 1.2s infinite;
}

.story-light.complete{

  background:#16a34a;
}

.story-light.failed{

  background:#dc2626;
}

@keyframes pulseLight{

  0%{
    opacity:0.55;
  }

  50%{
    opacity:1;
  }

  100%{
    opacity:0.55;
  }
}

#sec-videos .section-header{

  display:flex;

  align-items:flex-start;

  justify-content:space-between;

  margin-bottom:20px;
}

#sec-videos .section-title{

  margin-top:-6px;
}

/* =====================================================
   VIDEO TILE CTA
   ===================================================== */

.video-tile-actions{

  display:flex;

  justify-content:center;

  align-items:center;

  margin-top:auto;

  padding-top:12px;

}

.review-produce-btn{

  width:520px;

  height:44px;

  border:none;

  border-radius:14px;

  background:
    linear-gradient(
      180deg,
      rgba(30,30,30,0.95),
      rgba(0,0,0,0.98)
    );

  color:#ffffff;

  font-size:14px;

  font-weight:700;

  letter-spacing:0.2px;

  box-shadow:
    0 4px 12px rgba(0,0,0,0.18);

  cursor:pointer;
}

.review-produce-btn:hover{

  transform:translateY(-1px);

  box-shadow:
    0 8px 18px rgba(0,0,0,0.22);
}

.weave-review-btn {
  width: 650px;
  margin: 0 auto;
  display: block;

  background: rgba(0,0,0,0.85);
  color: #fff;

  font-weight: 700;

  border: 1px solid rgba(255,255,255,0.12);

  border-radius: 12px;

  padding: 12px 18px;

  text-align: center;

  backdrop-filter: blur(10px);

  box-shadow:
    0 4px 20px rgba(0,0,0,.25);
}

.asset-actions {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.signin-legal{
  margin-top:14px;
  margin-bottom:14px;
}

.signin-consent{
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:14px;
  line-height:1.45;
  color:#ffffff;
}

.signin-consent a{
  color:#000000;
  text-decoration:none;
}

.signin-consent a:hover{
  text-decoration:underline;
}

/* =========================================
   TERMS & CONDITIONS PAGE
========================================= */

.legal-page{

  max-width:1400px;

  margin:120px auto 60px auto;

  padding:0 24px;

  position:relative;

  z-index:2;
}

.legal-glass-panel{

  background:rgba(255,255,255,.78);

  backdrop-filter:blur(14px);

  -webkit-backdrop-filter:blur(14px);

  border:1px solid rgba(255,255,255,.45);

  border-radius:24px;

  padding:40px;

  box-shadow:
    0 20px 60px rgba(0,0,0,.20);

  color:#111111;
}

.legal-glass-panel h1{

  font-size:40px;

  font-weight:700;

  margin-bottom:24px;

  color:#111111;
}

.legal-glass-panel h2{

  font-size:22px;

  margin-top:32px;

  margin-bottom:12px;

  color:#111111;
}

.legal-glass-panel p,
.legal-glass-panel li{

  font-size:15px;

  line-height:1.8;

  color:#1f2937;
}

.legal-glass-panel ul{

  padding-left:24px;
}

.legal-glass-panel strong{

  color:#000000;
}

.legal-glass-panel{

  max-height:75vh;

  overflow-y:auto;
}
.legal-update-pill{
  display:inline-flex;
  align-items:center;

  margin-top:14px;
  margin-bottom:24px;

  padding:8px 14px;

  background:#000000;

  border:1px solid rgba(255,255,255,.45);

  border-radius:999px;

  font-size:12px;
  font-weight:600;

  color:#f5f5f5;

  backdrop-filter:blur(12px);
}

/* ==========================================
   LEGAL DOCUMENT BODY
   ========================================== */

.legal-body{
  margin-top:4px;
  line-height:1.8;
  color:#202020;
}

.legal-body p{
  margin:0 0 18px 0;
}

.legal-body h2{
  margin:32px 0 14px 0;
  font-size:20px;
  font-weight:700;
  color:#111111;
}

/* =====================================================
   PAYOFF BEAT IMAGE UPLOAD BUTTON
   ===================================================== */

.weave-payoff-btn {

    background-color: #F4A641 !important;

    border: 1px solid #111111 !important;

    color: #111111 !important;
      
    font-weight: 600;

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        transform 120ms ease,
        box-shadow 180ms ease;

}

.weave-payoff-btn:hover {

    background-color: #4A0404 !important;

    border-color: #4A0404 !important;

}

.weave-payoff-btn:active {

    transform: translateY(1px);

}

.weave-payoff-btn:focus-visible {

    outline: none;

    box-shadow:
        0 0 0 2px rgba(255,255,255,.12),
        0 0 0 4px rgba(193,18,31,.55);

}

/* =====================================================
   STORYBOARD VO HEADER
   ===================================================== */

.sb-editor-heading{

    display:flex;

    align-items:center;

    justify-content:space-between;

    width:100%;

    margin:0 0 8px 0;

}

.sb-editor-heading label{

    display:block;

    margin:0;

    padding:0;

    flex:1 1 auto;

    color:#ffffff;

    font-size:18px;

    font-weight:600;

}

.sb-vo-counter{

    flex:0 0 auto;

    margin-left:20px;

    white-space:nowrap;

    text-align:right;

    font-size:16px;

    font-weight:700;

    color:#ffffff;

    transition:color .15s ease;

}

.sb-vo-counter.warning{

    color:#FFC107;

}

.sb-vo-counter.limit{

    color:#FF1744;

}

/*======================================================
EDIT ASSISTANCE MODAL
======================================================*/

.weave-modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.65);

    display:flex;

    align-items:center;

    justify-content:center;

    padding:24px;

    z-index:10000;

    overflow-y:auto;

}

#sbCharacterModal{

    z-index:30000 !important;

}

#editAssistanceModal .weave-card{

    width:min(1100px,95vw);

    max-height:90vh;

    display:flex;

    flex-direction:column;

    overflow:hidden;

}

#editAssistBody{

    flex:1;

    overflow-y:auto;

    padding:24px;

}

/*======================================================
EDIT ASSISTANCE SEGMENTED CONTROL
======================================================*/

.ea-stage-pills{

    display:grid;

    grid-template-columns:repeat(3,1fr);

    gap:0;

    margin:20px 24px 0;

    background:#1f2937;

    border-radius:999px;

    overflow:hidden;

}

.ea-pill{

    appearance:none;

    border:none;

    background:transparent;

    color:#9ca3af;

    font-weight:700;

    font-size:14px;

    padding:14px 12px;

    cursor:pointer;

    transition:.18s;

}

.ea-pill:hover{

    background:rgba(255,255,255,.05);

}

.ea-pill.active{

    background:#2563eb;

    color:#ffffff;

}

/* ==========================================
   EDIT ASSISTANCE HEADER
   ========================================== */

.sb-assist-header{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:16px;

    margin-bottom:10px;

}

.sb-assist-header-left{

    display:flex;

    align-items:center;

    gap:12px;

    flex-wrap:nowrap;

}

.sb-assist-header-right{

    display:flex;

    align-items:center;

    gap:8px;

    margin-left:auto;

}

.sb-font-btn{

    display:flex;

    align-items:center;

    justify-content:center;

    width:36px;

    height:28px;

    padding:0;

    line-height:1;

    border:1px solid #2b3550;

    border-radius:999px;

    background:#121826;

    color:#ffffff;

    font-size:12px;

    font-weight:700;

    font-family:inherit;

    cursor:pointer;

    box-sizing:border-box;

    appearance:none;

    -webkit-appearance:none;

    transition:background .15s,border-color .15s;

}

.sb-font-btn:hover{

    background:#1c2640;

}

.sb-font-btn:hover{

    background:#1c2640;

}

.sb-assist-heading{

    font-size:18px;

    font-weight:700;

    white-space:nowrap;

}

.sb-assist-stage-number{

    font-size:13px;

    font-weight:700;

    color:#60a5fa;

    letter-spacing:.05em;

    text-transform:uppercase;

    white-space:nowrap;

}

.sb-assist-pills{

    display:flex;

    align-items:center;

    gap:10px;

    margin-left:12px;

}

.sb-assist-pill{

    height:28px;

    padding:0 14px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:14px;

    border:1px solid #374151;

    background:#1b2233;

    color:#d1d5db;

    font-size:11px;

    font-weight:700;

    text-transform:uppercase;

    cursor:pointer;

    transition:.15s;

}

.sb-assist-pill:hover{

    border-color:#5aa3ff;

}

.sb-assist-pill.active{

    background:#2563eb;

    border-color:#2563eb;

    color:#ffffff;

}

.sb-assist-stage-copy{

    margin-top:8px;

    margin-bottom:12px;

    font-size:13px;

    line-height:1.4;

}

#sb-assist-core{

    min-height:90px;

    resize:none;

}

#sb-assist-working{

    min-height:180px;

    resize:vertical;

}

/* ==========================================================
   CHARACTER LIBRARY
   ========================================================== */

.cl-card{

    width:min(960px,94vw);

    min-height:560px;

    display:flex;

    flex-direction:column;

}

.cl-grid{

    display:grid;

    grid-template-columns:340px 1fr;

    gap:28px;

    margin-top:20px;

    flex:1;

}

.cl-left{

    display:flex;

    flex-direction:column;

    gap:16px;

}

.cl-source{

    display:flex;

    align-items:center;

    gap:10px;

    font-weight:700;

    color:#111827;

}

.cl-source input{

    accent-color:#111111;

}

.cl-name{

    min-height:44px;

    padding:12px;

    border:1px solid rgba(0,0,0,.12);

    border-radius:12px;

    background:rgba(255,255,255,.88);

    font-weight:600;

}

.cl-summary{

    min-height:130px;

    padding:14px;

    border:1px solid rgba(0,0,0,.12);

    border-radius:12px;

    background:rgba(255,255,255,.88);

    line-height:1.5;

    overflow:auto;

}

.cl-status{

    font-size:13px;

    font-weight:700;

    color:#6b7280;

}

.cl-dropdown{

    position:relative;

    width:100%;

}

.cl-dropdown-btn{

    width:100%;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.cl-dropdown-panel{

    display:none;

    position:absolute;

    top:calc(100% + 8px);

    left:0;

    right:0;

    max-height:240px;

    overflow-y:auto;

    background:rgba(255,255,255,.97);

    border:1px solid rgba(0,0,0,.12);

    border-radius:14px;

    box-shadow:0 12px 28px rgba(0,0,0,.18);

    z-index:100;

}

.cl-dropdown.open .cl-dropdown-panel{

    display:block;

}

.cl-item{

    padding:12px 14px;

    cursor:pointer;

    transition:background .15s;

}

.cl-item:hover{

    background:rgba(59,130,246,.08);

}

.cl-right{

    display:flex;

    justify-content:center;

    align-items:flex-start;

}

.cl-preview{

    width:340px;

    aspect-ratio:3/4;

    border-radius:18px;

    border:1px solid rgba(0,0,0,.14);

    background:rgba(255,255,255,.86);

    overflow:hidden;

    display:flex;

    align-items:center;

    justify-content:center;

}

.cl-preview img{

    width:100%;

    height:100%;

    object-fit:cover;

}

.cl-footer{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-top:28px;

}

.cl-brand{

    margin-top:22px;

    display:flex;

    justify-content:center;

}

.cl-brand img{

    max-width:200px;

    height:auto;

}

@media (max-width:900px){

    .cl-grid{

        grid-template-columns:1fr;

    }

    .cl-preview{

        width:100%;

        max-width:340px;

        margin:auto;

    }

    .cl-footer{

        flex-wrap:wrap;

        gap:12px;

    }

}

/* ==========================================
   STORYBOARD - UPLOAD PAYOFF BUTTON
   ========================================== */

#sb-upload-payoff-btn,
.weave-payoff-btn{

    width:100px;

    min-width:100px;

    white-space:normal;

    line-height:1.15;

    text-align:center;

    padding:8px 10px;
}

/* =====================================================
   STORYBOARD BUTTON TOOLTIPS
   ===================================================== */

.has-tip{

    position:relative;

}

.has-tip::after{

    content:attr(data-tip);

    position:absolute;

    left:50%;

    bottom:calc(100% + 10px);

    transform:translateX(-50%);

    white-space:nowrap;

    padding:8px 12px;

    border-radius:10px;

    background:#111111;

    color:#ffffff;

    font-size:12px;

    font-weight:600;

    opacity:0;

    visibility:hidden;

    transition:opacity .15s ease;

    pointer-events:none;

    z-index:99999;

}

.has-tip:hover::after{

    opacity:1;

    visibility:visible;

}

/* =====================================================
   Rename Storyboard Modal
===================================================== */

#sbRenameModal .weave-card{

    width:520px;

    max-width:92vw;

}

#sbRenameModal label{

    display:block;

    margin-bottom:10px;

    color:#FFFFFF;

    font-weight:700;

}

#sbRenameModal input{

    width:100%;

}

#sbRenameModal .weave-ft{

    display:flex;

    justify-content:flex-end;

    gap:12px;

    padding:20px;

}

/* ==========================================================
   CHARACTER MANAGER PANEL
   ========================================================== */

/* Panel */



/* Layout */



/* Left Column */



/* Centre Column */



/* Right Column */



/* Image Viewer */



/* Buttons */



/* Responsive */


/* ==========================================================
   CHARACTER MANAGER PANEL
   ========================================================== */


   .sb-character-panel.open{

    right:0;

}

.sb-character-shell{

    width:100%;

    height:100%;

    display:flex;

    flex-direction:column;

}

/* =========================================================
   CHARACTER MANAGER PANEL
   ========================================================= */

.sb-character-panel {
    position: fixed !important;

    top: 50% !important;
    left: 50% !important;
    right: auto !important;

    transform: translate(-50%, -50%) !important;

    width: 95vw !important;
    height: 92vh !important;

    display: none;
    visibility: hidden;
    opacity: 0;

    background: #0c0f14;

    overflow-y: auto;
    overflow-x: hidden;

    z-index: 2147483647 !important;

    pointer-events: none;
}

.sb-character-panel.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    z-index: 2147483647 !important;

    pointer-events: auto !important;
}

.sb-character-panel .weave-card{

    width:100%;

    height:100%;

    max-width:none;

    margin:0;

    border-radius:0;

    display:flex;

    flex-direction:column;

}

.sb-character-shell{

    display:flex;

    flex-direction:column;

    height:100%;

    min-height:900px;

}

.sb-character-header{

    height:72px;

    display:flex;

    align-items:center;

    justify-content:center;

    position:relative;

    border-bottom:1px solid #d8d8d8;

    background:#f4f4f4;

}

.sb-character-header h2{

    margin:0;

}

.sb-character-layout{

    flex:1;

    display:grid;

    grid-template-columns:60% 25% 15%;

    width:100%;

    min-width:0;

    min-height:0;

}

.sb-character-images,

.sb-character-centre,

.sb-character-actions{

    padding:32px;

    display:flex;

    flex-direction:column;

    gap:18px;

    box-sizing:border-box;

}

.sb-character-images{

    padding:24px;

    border-right:1px solid #d8d8d8;

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:flex-start;

}

#sb-character-image-frame{

    width:100%;

    aspect-ratio:1 / 1;

    max-height:520px;

    min-height:320px;

}

.sb-character-centre{

    padding:28px;

    display:flex;

    flex-direction:column;

    align-items:center;

    width:100%;

    height:100%;

}

#sb-character-image-frame{

    width:100%;

    aspect-ratio:1 / 1;

    border:1px solid #5f5f5f;

    border-radius:10px;

    background:#111;

    display:flex;

    justify-content:center;

    align-items:center;

    position:relative;

    overflow:hidden;

}
/* Character image fullscreen view */
#sb-character-image-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sb-character-image-frame:fullscreen
#sb-character-image-preview {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.sb-character-image-nav{

    margin-top:18px;

    display:flex;

    justify-content:center;

    align-items:center;

    gap:18px;

    flex-shrink:0;

}

#sb-character-image-preview{

    max-width:100%;

    max-height:100%;

    object-fit:contain;

}

/* Character Panel empty-state placeholder */
#sb-character-image-preview.character-preview-placeholder {
    background: #d7d7d7;
    object-fit: contain;
}

.sb-character-image-nav{

    display:flex;

    justify-content:center;

    align-items:center;

    gap:18px;

}

/* Subtle image-generation progress indicator */
.sb-character-generation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    margin-right: 2px;
    font-size: 55px;
    line-height: 1;
    color: #ffffff;
    opacity: 0.9;
    white-space: nowrap;
}

.sb-character-generation-status[hidden] {
    display: none;
}

.sb-character-actions{

    align-items:stretch;
    width:100%;
    height:100%;
    justify-content:flex-start;

    padding-bottom:40px;

    overflow:visible;
}

.sb-character-actions button{

    width:100%;

    font-size:1.15rem;

    font-weight:600;

}

.sb-character-actions .sb-brand-pill{

    margin-top:77px;

    align-self:center;

}

#sb-character-list,

#sb-character-name,

#sb-character-age{

    width:100%;

    padding:0 12px;

    border:1px solid #666;

    border-radius:10px;

    background:#fff;

    color:#111;

    box-sizing:border-box;

}

#sb-character-name,
#sb-character-age{

    height:38px;
}

#sb-character-list{

    height:48px;

    font-size:15px;

    line-height:48px;

    padding:0 14px;

}

.sb-character-brandmark{

    width:100%;

    display:flex;

    justify-content:center;

    align-items:center;

    margin-top:24px;

    padding-top:12px;

    overflow:visible;

    flex-shrink:0;

}

.sb-character-brandmark img{

    width:170px;

    height:auto;

    display:block;

    object-fit:contain;

}

.sb-character-centre{

    padding:32px;

}

.sb-character-actions{

    padding:28px;

    display:flex;

    flex-direction:column;

    align-items:center;

    gap:18px;

}

/* ==========================================================
   STORYBOARD SHELL
   ========================================================== */

.sb-shell{

    position:relative;

    display:flex;

    height:100%;

    overflow:hidden;

}

/* ==========================================================
   CHARACTER MANAGER — COMPACT ACTION STACK
   ========================================================== */

.sb-character-actions {
    position: relative;
    height: 100%;
    box-sizing: border-box;
}

/* Remove the old <br><br> spacing inside the action column. */
.sb-character-actions > br {
    display: none;
}

/* Five buttons share the existing Generate → logo space. */
#sb-character-regenerate,
#sb-character-delete,
#sb-character-approve,
#sb-character-save,
#sb-character-close {
    position: absolute;

    left: 0;
    right: 0;

    width: 90%;
    height: 60px;
    min-height: 46px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Even vertical distribution from Generate to just above logo. */
#sb-character-regenerate {
    top: 18px;
}

#sb-character-delete {
    top: 126px;
}

#sb-character-approve {
    top: 236px;
}

#sb-character-save {
    top: 386px;
}

#sb-character-close {
    top: 546px;
}

/* Keep the logo anchored independently of the buttons. */
.sb-brand-pill {
    position: absolute;
    right: 60px;
    bottom: 68px;

    transform: none;
}

/* ==========================================================
   CHARACTER MANAGER — CENTER FORM TEXT
   ========================================================== */

#sb-character-list,
#sb-character-name,
#sb-character-age {
    text-align: center;
}

#sb-character-list {
    text-align-last: center;
}

/* =========================================================
   CHARACTER IMAGE FULLSCREEN VIEWER
   ========================================================= */

.sb-character-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 32px;

    background: rgba(0, 0, 0, 0.92);
}

.sb-character-image-lightbox.is-open {
    display: flex;
}

#sb-character-image-lightbox-image {
    display: block;

    max-width: 92vw;
    max-height: 92vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;
}

.sb-character-image-lightbox-close {
    position: absolute;

    top: 20px;
    right: 24px;

    width: 42px;
    height: 42px;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);

    color: #fff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-character-image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* =========================================================
   SETTINGS PAGE — LAYOUT AND READABILITY
   ========================================================= */

.settings-page .settings-wrap {
  width: min(1180px, calc(100% - 48px));
  max-width: 1180px;
  margin: 110px auto 48px;
  padding: 0;
  box-sizing: border-box;
  color: #202936;
}

.settings-page .settings-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 28px;
  color: #202936;
}

.settings-page .settings-card * {
  box-sizing: border-box;
}

.settings-page .settings-heading h1 {
  color: #17212f;
}

.settings-page .settings-intro {
  color: #303b49;
}

/* Swap the visual hierarchy of the section label and heading */
.settings-page .settings-kicker {
  margin: 0 0 10px;
  color: #263445;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.4px;
  text-transform: none;
}

.settings-page .settings-section-heading h2 {
  margin: 0 0 12px;
  color: #465363;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.settings-page .settings-description,
.settings-page .settings-help {
  color: #344253;
  line-height: 1.55;
}

/* Background choices */
.settings-page .settings-background-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 24px 0;
}

.settings-page .settings-background-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  color: #263445;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(45, 60, 80, 0.16);
  border-radius: 14px;
  cursor: pointer;
}

.settings-page .settings-background-option input[type="radio"] {
  width: auto;
  margin: 0 0 4px;
  accent-color: #2563eb;
}

.settings-page .settings-background-option .settings-background-preview {
  display: block;
  width: 100%;
  height: 105px;
  border-radius: 9px;
  background-position: center;
  background-size: cover;
}

.settings-page .settings-preview-water {
  background-image: url("./Zen Wallpaper/water.jpg");
}

.settings-page .settings-preview-sand {
  background-image: url("./Zen Wallpaper/sand.jpg");
}

.settings-page .settings-preview-bamboo {
  background-image: url("./Zen Wallpaper/bamboo.jpg");
}

.settings-page .settings-background-name {
  color: #202936;
  font-size: 15px;
  font-weight: 700;
}

.settings-page .settings-background-detail {
  color: #4b5868;
  font-size: 13px;
  font-weight: 400;
}

.settings-page .settings-background-option:has(input:checked) {
  border-color: #2563eb;
  background: rgba(255, 255, 255, 0.78);
}

/* Blur and overlay controls */
.settings-page .settings-adjustments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  width: 100%;
  margin-top: 24px;
}

.settings-page .settings-adjustment {
  min-width: 0;
}

.settings-page .settings-adjustment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-page .settings-adjustment-heading label {
  display: block;
  margin: 0;
  color: #202936;
  font-size: 14px;
  font-weight: 700;
}

.settings-page .settings-adjustment-heading output {
  flex: 0 0 auto;
  color: #263445;
  font-size: 13px;
  font-weight: 700;
}

.settings-page .settings-adjustment input[type="range"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  accent-color: #2563eb;
}

.settings-page .settings-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(45, 60, 80, 0.15);
}

.settings-page .settings-card-footer .settings-help {
  margin: 0;
}

.settings-page .settings-card-footer button {
  flex: 0 0 auto;
}

/* Administration placeholder */
.settings-page .settings-admin-placeholder {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(45, 60, 80, 0.13);
  border-radius: 14px;
}

.settings-page .settings-admin-placeholder h3 {
  margin: 0 0 6px;
  color: #202936;
}

.settings-page .settings-admin-placeholder p {
  margin: 0;
  color: #344253;
  line-height: 1.55;
}

.settings-page .settings-admin-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: #263445;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  font-size: 22px;
}

/* Responsive layout */
@media (max-width: 700px) {
  .settings-page .settings-wrap {
    width: calc(100% - 28px);
    margin-top: 100px;
  }

  .settings-page .settings-card {
    padding: 20px;
  }

  .settings-page .settings-background-options,
  .settings-page .settings-adjustments {
    grid-template-columns: 1fr;
  }

  .settings-page .settings-background-option .settings-background-preview {
    height: 130px;
  }

  .settings-page .settings-card-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
/* SETTINGS PAGE — HEADING AND TOP SPACING */

.settings-page .settings-wrap {
  margin-top: 28px;
}

.settings-page .settings-heading {
  margin-bottom: 18px;
}

.settings-page .settings-heading h1 {
  color: #ffffff;
  background: transparent;
  padding: 0;
  margin: 0 0 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.settings-page .settings-intro {
  color: #ffffff;
  background: transparent;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

/* =========================================================
   GLOBAL BACKGROUND LAYER — STACKING CONTEXT FIX
   ========================================================= */

html,
body.page {
  background: transparent;
}

body.page {
  isolation: isolate;
}

/* Wallpaper image */
body.page #bg-layer {
  position: fixed !important;
  inset: 0 !important;
  z-index: -2 !important;
  display: block !important;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Wallpaper overlay */
body.page #bg-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  display: block !important;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
}

/* =========================================================
   BRIEF PROMPT BUILDER — FULL-WIDTH, TWO-ROW LAYOUT
   ========================================================= */

#promptCard .prompt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
  align-items: stretch;
}

#promptCard .prompt-left,
#promptCard .prompt-right {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

#promptCard .prompt-left .block,
#promptCard .prompt-right .block {
  display: block;
  width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Story Context controls: one horizontal row */
#promptCard .prompt-left .row-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  width: 100%;
}

#promptCard .prompt-left .row-tools > div {
  width: 100%;
  min-width: 0;
}

#promptCard #lifestyleSel,
#promptCard #industrySel {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
}

#promptCard #btnGenerate {
  width: auto;
  min-width: 140px;
  height: 48px;
  white-space: nowrap;
}

/* Compiled Prompt: full available width */
#promptCard .prompt-right .block {
  width: 100%;
}

#promptCard #compiledPrompt {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 360px;
  height: 420px;
  box-sizing: border-box;
}

/* Responsive fallback */
@media (max-width: 700px) {
  #promptCard .prompt-left .row-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  #promptCard #btnGenerate {
    width: 100%;
  }
}

/* BRIEF PROMPT BUILDER — FINAL SPACING */

#promptCard .story-context-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 12px;
}

#promptCard .story-context-heading label {
  margin: 0;
}

#promptCard .story-context-heading .muted {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  color: inherit;
}

#promptCard .prompt-right {
  padding-top: 12px;
}

#promptCard .prompt-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#promptCard #compiledPrompt {
  margin-top: 0;
}
#promptCard .story-context-heading .muted {
  font-size: inherit;
  font-weight: 600;
  color: inherit;
}