body.page-setup{
  display:block !important;
  min-height:100vh;
  padding:0 !important;
}

body.page-setup .setup-shell{
  position:relative;
  z-index:1;
  min-height:100vh;
  padding:40px 24px 72px;
}

body.page-setup .setup-wrap{
  width:min(1360px, calc(100vw - 48px));
  margin:0 auto;
}

body.page-setup .steps{
  display:grid;
  gap:20px;
}

body.page-setup .setup-card{
  background:linear-gradient(180deg, rgba(8,15,31,.86), rgba(4,16,31,.74));
  border:1px solid rgba(255,255,255,.08);
  border-radius:22px;
  padding:24px 26px;
  box-shadow:0 22px 48px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
}

body.page-setup .setup-hero-card{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}

body.page-setup .setup-kicker,
body.page-setup .section-step{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(0,196,255,.08);
  border:1px solid rgba(0,196,255,.16);
  color:var(--accent,#00C4FF);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

body.page-setup .setup-hero-card h1{
  margin:10px 0 6px;
  font-size:clamp(2rem, 2.6vw, 2.8rem);
  line-height:1.08;
  color:var(--text-1,#eef4ff);
}

body.page-setup .setup-user-pill{
  flex-shrink:0;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
  color:var(--text-2,#8DAABB);
  font-size:.92rem;
  text-align:right;
}

body.page-setup .section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:12px;
}

body.page-setup .setup-card h2{
  margin:10px 0 0;
  font-size:1.7rem;
  line-height:1.15;
  color:var(--text-1,#eef4ff);
}

body.page-setup .note{
  color:var(--text-2,#8DAABB);
  font-size:.96rem;
  line-height:1.7;
}

body.page-setup .setup-form{
  margin-top:14px;
}

body.page-setup .grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}

body.page-setup .subgrid{
  display:grid;
  grid-template-columns:minmax(0, .95fr) minmax(0, 1.35fr);
  gap:18px;
}

body.page-setup .field label,
body.page-setup .policy-label-main{
  display:block;
  margin-bottom:7px;
  color:var(--text-2,#8DAABB);
  font-size:.86rem;
  font-weight:600;
}

body.page-setup .field input,
body.page-setup .field select,
body.page-setup .field textarea{
  width:100%;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.09);
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  color:var(--text-1,#eef4ff);
  font:inherit;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.page-setup .field select option,
body.page-setup .field select optgroup{
  color:#0f172a;
  background:#f8fbff;
}

body.page-setup .field input:focus,
body.page-setup .field select:focus,
body.page-setup .field textarea:focus,
body.page-setup .policy-editor:focus{
  border-color:rgba(0,196,255,.42);
  box-shadow:0 0 0 4px rgba(0,196,255,.08);
  background:rgba(255,255,255,.06);
}

body.page-setup .field input::placeholder,
body.page-setup .field textarea::placeholder{
  color:var(--text-3,#4E7090);
}

body.page-setup .setup-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  margin-top:16px;
}

body.page-setup .btn{
  min-height:46px;
  padding:0 18px;
  border-radius:14px;
  font-weight:700;
}

body.page-setup .msg{
  margin:0 0 18px;
  padding:14px 16px;
  border-radius:16px;
  font-weight:600;
}

body.page-setup .msg.ok{
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.28);
  color:var(--text-1,#eef4ff);
}

body.page-setup .msg.err{
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.28);
  color:var(--text-1,#eef4ff);
}

body.page-setup .setup-branding-grid{
  align-items:start;
}

body.page-setup .setup-branding-panel,
body.page-setup .setup-policy-panel{
  min-width:0;
}

body.page-setup .setup-policy-panel{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:18px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.03));
}

body.page-setup .policy-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

body.page-setup .switch-row{
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
}

body.page-setup .switch-row input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

body.page-setup .switch-slider{
  width:48px;
  height:28px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  position:relative;
  transition:background .18s ease;
  border:1px solid rgba(255,255,255,.08);
}

body.page-setup .switch-slider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 4px 10px rgba(0,0,0,.22);
  transition:transform .18s ease;
}

body.page-setup .switch-row input:checked + .switch-slider{
  background:rgba(0,94,184,.55);
}

body.page-setup .switch-row input:checked + .switch-slider::after{
  transform:translateX(20px);
}

body.page-setup .switch-copy{
  color:var(--text-1,#eef4ff);
  font-weight:600;
  font-size:.9rem;
}

body.page-setup .policy-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
}

body.page-setup .policy-toolbar-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:0 10px 0 0;
  margin-right:2px;
  border-right:1px solid rgba(255,255,255,.07);
}

body.page-setup .policy-toolbar-group-end{
  margin-left:auto;
  padding-right:0;
  border-right:0;
}

body.page-setup .policy-toolbar button{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
  color:var(--text-1,#eef4ff);
  border-radius:12px;
  min-height:40px;
  padding:9px 12px;
  font:inherit;
  font-size:.86rem;
  font-weight:600;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

body.page-setup .policy-toolbar button:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(0,196,255,.18);
  transform:translateY(-1px);
}

body.page-setup .policy-toolbar-accent{
  background:linear-gradient(180deg, rgba(0,94,184,.28), rgba(0,94,184,.16)) !important;
  border-color:rgba(0,196,255,.24) !important;
  box-shadow:0 8px 20px rgba(0,94,184,.16);
}

body.page-setup .policy-editor-stage{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

body.page-setup .policy-editor-stage.preview-active{
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
}

body.page-setup .policy-editor,
body.page-setup .policy-preview{
  min-height:420px;
  max-height:620px;
  overflow:auto;
  padding:18px 18px 20px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(5,13,24,.82), rgba(6,17,31,.68));
  color:var(--text-1,#eef4ff);
  line-height:1.72;
  font-size:1rem;
  outline:none;
}

body.page-setup .policy-preview{
  display:none;
  background:linear-gradient(180deg, rgba(8,20,36,.92), rgba(8,20,36,.82));
}

body.page-setup .policy-editor-stage.preview-active .policy-preview{
  display:block;
}

body.page-setup .policy-editor h1,
body.page-setup .policy-editor h2,
body.page-setup .policy-editor h3,
body.page-setup .policy-editor h4{
  margin:18px 0 10px;
  line-height:1.2;
}

body.page-setup .policy-editor h2{font-size:1.45rem;}
body.page-setup .policy-editor h3{font-size:1.2rem;}
body.page-setup .policy-editor p{margin:0 0 12px;}
body.page-setup .policy-editor ul,
body.page-setup .policy-editor ol{padding-left:22px; margin:0 0 14px;}
body.page-setup .policy-editor blockquote,
body.page-setup .policy-preview blockquote{margin:14px 0; padding:12px 14px; border-left:3px solid rgba(0,196,255,.35); background:rgba(255,255,255,.04); border-radius:0 12px 12px 0;}
body.page-setup .policy-editor a,
body.page-setup .policy-preview a{color:var(--accent,#00C4FF);}
body.page-setup .policy-editor table,
body.page-setup .policy-preview table{
  width:100%;
  border-collapse:collapse;
  margin:16px 0;
  overflow:hidden;
  border-radius:14px;
}
body.page-setup .policy-editor th,
body.page-setup .policy-editor td,
body.page-setup .policy-preview th,
body.page-setup .policy-preview td{
  border:1px solid rgba(255,255,255,.12);
  padding:10px 12px;
  vertical-align:top;
}
body.page-setup .policy-editor th,
body.page-setup .policy-preview th{
  background:rgba(255,255,255,.07);
  font-weight:700;
}
body.page-setup .policy-preview h1,
body.page-setup .policy-preview h2,
body.page-setup .policy-preview h3,
body.page-setup .policy-preview h4,
body.page-setup .policy-preview p,
body.page-setup .policy-preview ul,
body.page-setup .policy-preview ol{
  margin-top:0;
}

body.page-setup .policy-source{
  display:none;
}

body.page-setup .policy-footnote{
  margin-top:-2px;
}

body.page-setup .foundry-summary{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
  margin:16px 0 6px;
}

body.page-setup .foundry-pill{
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
}

body.page-setup .foundry-pill span{
  display:block;
  margin-bottom:6px;
  color:var(--text-3,#4E7090);
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

body.page-setup .foundry-pill strong{
  display:block;
  color:var(--text-1,#eef4ff);
  word-break:break-word;
  font-size:.95rem;
}

body.page-setup .output{
  margin-top:16px;
  padding:16px;
  border-radius:16px;
  background:#020617;
  border:1px solid rgba(255,255,255,.08);
  max-height:360px;
  overflow:auto;
  white-space:pre-wrap;
  color:var(--text-1,#eef4ff);
}

body.page-setup .section-meta{
  margin-top:12px;
}

body.page-setup .mono{
  font-family:var(--mono, ui-monospace, monospace);
}

@media (max-width: 1240px){
  body.page-setup .grid,
  body.page-setup .foundry-summary{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  body.page-setup .subgrid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 760px){
  body.page-setup .setup-shell{
    padding:24px 16px 40px;
  }
  body.page-setup .setup-wrap{
    width:min(100%, calc(100vw - 32px));
  }
  body.page-setup .setup-card{
    padding:20px 18px;
    border-radius:18px;
  }
  body.page-setup .setup-hero-card,
  body.page-setup .policy-panel-head{
    flex-direction:column;
    align-items:flex-start;
  }
  body.page-setup .grid,
  body.page-setup .foundry-summary{
    grid-template-columns:1fr;
  }
  body.page-setup .policy-toolbar{
    gap:6px;
  }
  body.page-setup .policy-toolbar-group,
  body.page-setup .policy-toolbar-group-end{
    border-right:0;
    padding-right:0;
    width:100%;
    margin-left:0;
  }
  body.page-setup .policy-toolbar button{
    padding:8px 10px;
    font-size:.82rem;
  }
  body.page-setup .policy-editor-stage.preview-active{
    grid-template-columns:1fr;
  }
  body.page-setup .policy-editor,
  body.page-setup .policy-preview{
    min-height:280px;
  }
}
