.jbsp-cpd-host{
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b0b0b;
  color: #fff;
}
.jbsp-cpd-host .jbsp-cpd-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.jbsp-cpd-host .form-section {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
}

/* Site selector (button group) */
.jbsp-cpd-host .cpd-site-buttons{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;
  justify-items:stretch;
}
.jbsp-cpd-host .cpd-site-btn{
  background:#222;
  border:1px solid #444;
  color:#fff;
  padding:14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:bold;
  font-size:16px;
  width:100%;
  text-align:center;
}
.jbsp-cpd-host .cpd-site-btn.active{
  background:#4fd8ff;
  color:#000;
  border-color:transparent;
}

@media (max-width: 720px){
  .jbsp-cpd-host .cpd-site-buttons{
    grid-template-columns:1fr;
  }
}
.jbsp-cpd-host .form-section h2 {
  margin-top: 0;
  font-size: 20px;
  text-align: center;
}
.jbsp-cpd-host label{
  display: block;
  margin-top: 12px;
  font-weight: bold;
}
.jbsp-cpd-host input[type="text"], textarea, input[type="color"], select {
  width: 100%;
  background: #000;
  border: 1px solid #444;
  border-radius: 10px;
  color: #fff;
  padding: 10px;
  margin-top: 6px;
  box-sizing: border-box;
}
.jbsp-cpd-host textarea{
  min-height: 150px;
  resize: vertical;
}

/* Toggle switch */
.jbsp-cpd-host .switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 26px;
}
.jbsp-cpd-host .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.jbsp-cpd-host .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #444;
  transition: 0.4s;
  border-radius: 34px;
}
.jbsp-cpd-host .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}
.jbsp-cpd-host .switch input:checked + .slider {
  background-color: #4fd8ff;
}
.jbsp-cpd-host .switch input:checked + .slider:before {
  transform: translateX(34px);
}
.jbsp-cpd-host .toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.jbsp-cpd-host .theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 20px;
  justify-items: center;
}
.jbsp-cpd-host .theme-circle {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background-size: cover;
  background-position: center;
  max-width: 160px;
  max-height: 160px;
}
.jbsp-cpd-host .theme-circle.selected {
  border-color: #00ff7f;
}
.jbsp-cpd-host .theme-circle.selected::after {
  content: "✔";
  position: absolute;
  top: 5px; right: 5px;
  font-size: 20px;
  color: #00ff7f;
  font-weight: bold;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jbsp-cpd-host .theme-circle .label {
  background: rgba(255,255,255,0.9);
  color: #000;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: bold;
  text-align: center;
  position: absolute;
  top: 10px;
}
.jbsp-cpd-host button{
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #4fd8ff;
  color: #000;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}
.jbsp-cpd-host .btn-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.jbsp-cpd-host .btn-row button{
  width:auto;
  flex:1;
  min-width:160px;
}
.jbsp-cpd-host button.secondary{
  background:#222;
  color:#fff;
  border:1px solid #444;
}
.jbsp-cpd-host button.danger{
  background:#ff4b2b;
  color:#000;
}

.jbsp-cpd-host #preview {
  background: transparent; /* builder preview only */
  border: 1px solid #333;
  border-radius: 20px;
  padding: 20px;
  margin-top: 30px;
}
.jbsp-cpd-host #output {
  width: 100%;
  min-height: 200px;
  background: #000;
  border: 1px solid #444;
  color: #0f0;
  padding: 10px;
  margin-top: 20px;
  box-sizing: border-box;
}

/* Advanced Settings */
.jbsp-cpd-host .advanced-header {
  cursor: pointer;
  background: #222;
  padding: 10px 15px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 10px;
  border: 1px solid #333;
}
.jbsp-cpd-host .advanced-content {
  display: block;
  padding: 15px;
  border: 1px solid #333;
  border-radius: 12px;
  margin-bottom: 20px;
}
.jbsp-cpd-host .advanced-content[hidden]{
  display:none !important;
}

/* Advanced theme controls */
.jbsp-cpd-host .theme-advanced{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}
.jbsp-cpd-host .advanced-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.jbsp-cpd-host .advanced-controls label{
  margin-top:0;
  font-weight:bold;
}
.jbsp-cpd-host .advanced-controls input[type="color"]{
  width: 70px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

/* Rules list toggle */
.jbsp-cpd-host .rules-options {
  margin-top: 10px;
}
.jbsp-cpd-host .save-status{
  margin-top:10px;
  font-size:12px;
  color:#bbb;
  text-align:center;
}
.jbsp-cpd-host .warn{
  margin-top:10px;
  font-size:12px;
  color:#ffda6a;
  text-align:center;
}

/* Advanced controls layout */
.jbsp-cpd-host .theme-advanced{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}
.jbsp-cpd-host .advanced-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.jbsp-cpd-host .advanced-controls label{
  margin:0;
  font-weight:bold;
}
.jbsp-cpd-host .advanced-controls input[type="color"]{
  width: 70px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

/* Advanced toggle button */
.jbsp-cpd-host .advanced-header{
  width: 100%;
  border: 1px solid #333;
}
.jbsp-cpd-host .advanced-header .arrow{
  display: inline-block;
  margin-left: 6px;
}

/* Output actions */
.jbsp-cpd-host .output-actions{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 18px;
}
.jbsp-cpd-host .output-actions button{
  width: auto;
}
.jbsp-cpd-host .copy-status{
  font-size: 12px;
  color: #bbb;
}


/* v1.2.7 Advanced Styling layout */
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
@media(max-width:720px){.grid-2{grid-template-columns:1fr;}}

/* v1.2.11 mobile fixes */
.jbsp-cpd, .jbsp-cpd * { box-sizing: border-box; }
.jbsp-cpd { max-width: 100%; overflow-x: hidden; padding: 12px; }
.jbsp-cpd input, .jbsp-cpd select, .jbsp-cpd textarea { max-width: 100% !important; }
@media (max-width: 720px){
  .jbsp-cpd { padding: 10px; }
  .jbsp-cpd button { width: 100%; }
}

/* v1.2.12 responsive preview */
.jbsp-cpd .preview-area,
.jbsp-cpd .output-area,
.jbsp-cpd .preview-container,
.jbsp-cpd .output-container { max-width:100%; overflow-x:hidden; }
.jbsp-cpd .preview-area strong,
.jbsp-cpd .output-area strong { max-width:100%; }

/* v1.2.16 ensure background shows on mobile */
@media (max-width: 768px){
  .jbsp-cpd .widget-container{
    padding-left:12px;
    padding-right:12px;
    box-sizing:border-box;
  }
}

/* v1.2.17 ensure visible background margin on mobile */
@media (max-width: 768px){
  .jbsp-cpd .widget-container{
    margin-left:12px;
    margin-right:12px;
    width:auto;
    max-width:100%;
    box-sizing:border-box;
  }
}

/* small helper note under Generate button */
.jbsp-cpd .cpd-notice{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.15);
  border-radius:12px;
  background:rgba(0,0,0,0.18);
  color:rgba(255,255,255,0.85);
  font-size:13px;
  line-height:1.4;
}
