.jjcc-root,
.jjcc-root * { box-sizing: border-box; }

.jjcc-root {
  --jjcc-accent: #636099;
  --jjcc-bg: #fff;
  --jjcc-text: #222;
  --jjcc-button-font-size: 12px;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999999;
  font-family: inherit;
  color: var(--jjcc-text);
}

.jjcc-root.jjcc-bottom { bottom: 0; }
.jjcc-root.jjcc-top { top: 0; }

.jjcc-banner {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--jjcc-bg) !important;
  color: var(--jjcc-text) !important;
  border-radius: 10px;
  box-shadow: 0 8px 35px rgba(0,0,0,.18);
}

.jjcc-copy { flex: 1 1 auto; min-width: 0; }
#jjcc-root .jjcc-copy h2,
#jjcc-root .jjcc-modal h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; color: var(--jjcc-text) !important; }
#jjcc-root .jjcc-copy p,
#jjcc-root .jjcc-modal p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--jjcc-text) !important; }
#jjcc-root .jjcc-copy a { color: var(--jjcc-accent) !important; text-decoration: underline; }

.jjcc-actions,
.jjcc-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.jjcc-actions { flex: 0 0 auto; justify-content: flex-end; flex-wrap: nowrap; }
.jjcc-modal-actions { justify-content: flex-end; margin-top: 22px; }

#jjcc-root .jjcc-btn,
#jjcc-root .jjcc-open-preferences {
  appearance: none !important;
  border: 2px solid var(--jjcc-accent) !important;
  border-radius: 5px !important;
  padding: 7px 11px !important;
  min-height: 34px !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: var(--jjcc-button-font-size) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: none !important;
}

.jjcc-btn:hover,
.jjcc-open-preferences:hover { opacity: .85; }
.jjcc-btn:focus-visible,
.jjcc-open-preferences:focus-visible,
.jjcc-close:focus-visible { outline: 3px solid rgba(99,96,153,.35); outline-offset: 2px; }

#jjcc-root .jjcc-btn-primary {
  background: var(--jjcc-accent) !important;
  background-color: var(--jjcc-accent) !important;
  color: #fff !important;
}
#jjcc-root .jjcc-btn-secondary,
#jjcc-root .jjcc-open-preferences {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--jjcc-accent) !important;
}

.jjcc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.56);
}

.jjcc-modal-backdrop[hidden],
.jjcc-root[hidden],
.jjcc-banner[hidden] { display: none !important; }

.jjcc-modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px;
  background: var(--jjcc-bg) !important;
  color: var(--jjcc-text) !important;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.jjcc-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--jjcc-text);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.jjcc-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,.1);
}

.jjcc-category > div { display: grid; gap: 4px; }
.jjcc-category strong { font-size: 15px; }
.jjcc-category span { font-size: 13px; line-height: 1.4; }
.jjcc-always { flex: 0 0 auto; font-weight: 700; color: var(--jjcc-accent); }

.jjcc-toggle-row { position: relative; cursor: pointer; }
.jjcc-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.jjcc-switch {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #aaa;
  transition: background .18s ease;
}
.jjcc-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.jjcc-toggle-row input:checked + .jjcc-switch { background: var(--jjcc-accent); }
.jjcc-toggle-row input:checked + .jjcc-switch::after { transform: translateX(22px); }
.jjcc-toggle-row input:focus-visible + .jjcc-switch { outline: 3px solid rgba(99,96,153,.35); outline-offset: 3px; }

html.jjcc-modal-open { overflow: hidden; }

@media (max-width: 850px) {
  .jjcc-banner { align-items: stretch; flex-direction: column; gap: 18px; }
  .jjcc-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .jjcc-banner { width: calc(100% - 20px); margin: 10px auto; padding: 18px; }
  .jjcc-actions,
  .jjcc-modal-actions { display: grid; grid-template-columns: 1fr; }
  .jjcc-btn { width: 100%; }
  .jjcc-modal { padding: 24px 20px; }
}

/* Banner style variants */
.jjcc-root.jjcc-style-float-left,
.jjcc-root.jjcc-style-float-right {
  left: 0;
  right: 0;
  pointer-events: none;
}

.jjcc-root.jjcc-style-float-left .jjcc-banner,
.jjcc-root.jjcc-style-float-right .jjcc-banner {
  width: min(440px, calc(100% - 32px));
  margin: 16px;
  padding: 22px;
  align-items: stretch;
  flex-direction: column;
  gap: 18px;
  pointer-events: auto;
}

.jjcc-root.jjcc-style-float-left .jjcc-banner { margin-right: auto; }
.jjcc-root.jjcc-style-float-right .jjcc-banner { margin-left: auto; }

.jjcc-root.jjcc-style-float-left .jjcc-actions,
.jjcc-root.jjcc-style-float-right .jjcc-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
}

.jjcc-root.jjcc-style-float-left .jjcc-btn,
.jjcc-root.jjcc-style-float-right .jjcc-btn {
  padding-left: 9px !important;
  padding-right: 9px !important;
  font-size: 11px !important;
}

.jjcc-root.jjcc-style-float-left .jjcc-modal-backdrop,
.jjcc-root.jjcc-style-float-right .jjcc-modal-backdrop {
  pointer-events: auto;
}

@media (max-width: 560px) {
  .jjcc-root.jjcc-style-float-left .jjcc-banner,
  .jjcc-root.jjcc-style-float-right .jjcc-banner {
    width: calc(100% - 20px);
    margin: 10px auto;
  }
}
