/* ==========================================================
   TCW Creative Brain Drawer
   ========================================================== */

:root{
  --tcw-brain-width:400px;
  --tcw-brain-bg:#10152a;
  --tcw-brain-panel:#171e39;
  --tcw-brain-border:rgba(255,255,255,.09);
  --tcw-brain-muted:#929dbc;
  --tcw-brain-text:#f5f7ff;
  --tcw-brain-cyan:#27d9ff;
  --tcw-brain-pink:#d93cff;
  --tcw-brain-mint:#74e7ca;
}

body.tcw-brain-ready{
  overflow-x:hidden;
}

.tcw-brain-launcher{
  position:fixed;
  top:84px;
  right:0;
  z-index:9997;
  min-width:48px;
  height:44px;
  padding:0 11px;
  border:1px solid rgba(97,225,255,.28);
  border-right:0;
  border-radius:13px 0 0 13px;
  background:linear-gradient(
    145deg,
    rgba(25,34,67,.96),
    rgba(12,17,38,.98)
  );
  color:#f7f9ff;
  display:flex;
  align-items:center;
  gap:7px;
  box-shadow:
    0 12px 34px rgba(0,0,0,.28),
    0 0 22px rgba(36,213,255,.08);
  cursor:pointer;
  transition:
    opacity .18s ease,
    transform .18s ease;
}

.tcw-brain-launcher:hover{
  transform:translateX(-3px);
}

.tcw-brain-launcher-icon{
  font-size:17px;
}

.tcw-brain-launcher-label{
  font-size:10px;
  font-weight:800;
  letter-spacing:.03em;
}

body.tcw-brain-open .tcw-brain-launcher{
  opacity:0;
  pointer-events:none;
  transform:translateX(20px);
}

.tcw-brain-overlay{
  position:fixed;
  inset:0;
  z-index:9997;
  display:none;
  background:rgba(2,5,16,.55);
  backdrop-filter:blur(3px);
}

.tcw-brain-drawer{
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  z-index:9998;
  width:min(
    var(--tcw-brain-width),
    calc(100vw - 28px)
  );
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-left:1px solid rgba(86,214,255,.19);
  background:
    radial-gradient(
      circle at 15% 0%,
      rgba(31,206,255,.09),
      transparent 28%
    ),
    radial-gradient(
      circle at 100% 14%,
      rgba(214,55,255,.1),
      transparent 30%
    ),
    var(--tcw-brain-bg);
  box-shadow:
    -18px 0 60px rgba(0,0,0,.38);
  transform:translateX(102%);
  transition:transform .24s ease;
}

body.tcw-brain-open .tcw-brain-drawer{
  transform:translateX(0);
}

.tcw-brain-header{
  flex:0 0 auto;
  padding:17px 17px 13px;
  border-bottom:1px solid var(--tcw-brain-border);
  background:rgba(10,14,31,.72);
  backdrop-filter:blur(12px);
}

.tcw-brain-header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.tcw-brain-heading{
  min-width:0;
}

.tcw-brain-eyebrow{
  color:var(--tcw-brain-mint);
  font-size:8px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.tcw-brain-title{
  margin-top:3px;
  color:var(--tcw-brain-text);
  font-size:18px;
  font-weight:850;
  line-height:1.15;
}

.tcw-brain-subtitle{
  margin-top:4px;
  color:var(--tcw-brain-muted);
  font-size:9px;
  line-height:1.4;
}

.tcw-brain-close{
  width:34px;
  height:34px;
  flex:0 0 auto;
  margin:0;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.09);
  border-radius:10px;
  background:#242b49;
  color:#dce2f6;
  font-size:16px;
  cursor:pointer;
}

.tcw-brain-close:hover{
  background:#30395e;
}

.tcw-brain-tabs{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:5px;
  margin-top:14px;
}

.tcw-brain-tab{
  min-width:0;
  min-height:36px;
  margin:0;
  padding:6px 5px;
  border:1px solid transparent;
  border-radius:9px;
  background:rgba(255,255,255,.045);
  color:#969fbe;
  font-size:9px;
  font-weight:800;
  cursor:pointer;
}

.tcw-brain-tab:hover{
  color:#e8ecfa;
  background:rgba(255,255,255,.07);
}

.tcw-brain-tab.is-active{
  border-color:rgba(67,219,255,.25);
  color:#071019;
  background:linear-gradient(
    135deg,
    var(--tcw-brain-cyan),
    var(--tcw-brain-mint)
  );
}

.tcw-brain-content{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#38415f transparent;
}

.tcw-brain-content::-webkit-scrollbar{
  width:8px;
}

.tcw-brain-content::-webkit-scrollbar-thumb{
  border:2px solid transparent;
  border-radius:999px;
  background:#38415f;
  background-clip:padding-box;
}

.tcw-brain-pane{
  display:none;
  min-height:100%;
  padding:12px 16px 28px;
}

.tcw-brain-pane.is-active{
  display:block;
}

.tcw-brain-empty{
  margin-top:18px;
  padding:22px 16px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:14px;
  color:#7f89a9;
  text-align:center;
  font-size:10px;
  line-height:1.5;
}

.tcw-brain-pane > section,
.tcw-brain-pane > .section,
.tcw-brain-pane > div[data-tcw-brain-panel]{
  width:100%;
  margin:0;
  border-top:0;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.tcw-brain-pane > section:last-child,
.tcw-brain-pane > .section:last-child,
.tcw-brain-pane > div[data-tcw-brain-panel]:last-child{
  border-bottom:0;
}

/* Prevent narrow original sidebar rules carrying into drawer */

.tcw-brain-pane .section,
.tcw-brain-pane section{
  max-width:none;
}

.tcw-brain-pane button{
  max-width:100%;
}

.tcw-brain-pane input,
.tcw-brain-pane textarea,
.tcw-brain-pane select{
  max-width:100%;
}

/* Originality checker compact summary */

.tcw-brain-pane .tcw-originality-body{
  padding-bottom:16px;
}

.tcw-brain-pane .tcw-originality-result{
  padding:12px;
}

.tcw-brain-pane .tcw-originality-score-row{
  align-items:flex-start;
}

.tcw-brain-pane .tcw-originality-score{
  width:52px;
  height:52px;
  font-size:16px;
}

.tcw-brain-pane .tcw-originality-flags{
  gap:5px;
}

.tcw-brain-pane .tcw-originality-flag{
  padding:7px 8px;
}

.tcw-brain-pane .tcw-originality-match{
  padding:8px;
}

.tcw-brain-pane .tcw-originality-copy{
  position:static;
  inset:auto;
  width:100%;
  margin-top:10px;
}

/* Ensure any inherited sticky buttons do not float over results */

.tcw-brain-pane .tcw-originality-check,
.tcw-brain-pane .tcw-next-post-refresh,
.tcw-brain-pane .tcw-originality-copy{
  position:static !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
}

/* Originality detailed matches can be folded */

.tcw-originality-details-toggle{
  width:100%;
  min-height:33px;
  margin-top:9px;
  border-radius:9px;
  background:#293052;
  color:#edf1ff;
  font-size:9px;
  font-weight:750;
}

.tcw-originality-result:not(.tcw-show-details)
.tcw-originality-matches{
  display:none;
}

.tcw-originality-result:not(.tcw-show-details)
.tcw-originality-copy{
  display:none;
}

/* Panel headings inside drawer */

.tcw-brain-pane .tcw-next-post-toggle,
.tcw-brain-pane .tcw-originality-toggle{
  padding:15px 0 12px;
}

.tcw-brain-pane .tcw-next-post-card{
  margin-bottom:4px;
}

/* Optional canvas breathing room on large screens */

@media (min-width:1250px){
  body.tcw-brain-open .tcw-brain-aware-main{
    margin-right:var(--tcw-brain-width);
    transition:margin-right .24s ease;
  }
}

@media (max-width:1249px){
  body.tcw-brain-open .tcw-brain-overlay{
    display:block;
  }
}

@media (max-width:640px){
  :root{
    --tcw-brain-width:100vw;
  }

  .tcw-brain-drawer{
    width:100vw;
    border-left:0;
  }

  .tcw-brain-pane{
    padding-left:13px;
    padding-right:13px;
  }

  .tcw-brain-header{
    padding-left:14px;
    padding-right:14px;
  }

  .tcw-brain-launcher{
    top:auto;
    right:12px;
    bottom:14px;
    border-right:1px solid rgba(97,225,255,.28);
    border-radius:13px;
  }
}
/* ==========================================================
   Compact Creative Brain launcher
   Prevent inherited Studio button styles creating a banner
   ========================================================== */

button.tcw-brain-launcher,
.tcw-brain-launcher{
  position:fixed !important;
  top:92px !important;
  right:0 !important;
  bottom:auto !important;
  left:auto !important;

  width:auto !important;
  min-width:74px !important;
  max-width:110px !important;
  height:42px !important;
  min-height:42px !important;

  margin:0 !important;
  padding:0 13px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;

  border:1px solid rgba(87,220,255,.28) !important;
  border-right:0 !important;
  border-radius:13px 0 0 13px !important;

  background:
    linear-gradient(
      145deg,
      rgba(27,36,70,.98),
      rgba(13,18,40,.99)
    ) !important;

  color:#f7f9ff !important;
  box-shadow:
    0 12px 30px rgba(0,0,0,.3),
    0 0 20px rgba(39,217,255,.09) !important;

  line-height:1 !important;
  text-align:center !important;
  white-space:nowrap !important;
  overflow:hidden !important;

  z-index:9997 !important;
}

.tcw-brain-launcher-icon{
  display:inline-block !important;
  flex:0 0 auto !important;
  font-size:15px !important;
  line-height:1 !important;
}

.tcw-brain-launcher-label{
  display:inline-block !important;
  flex:0 0 auto !important;
  font-size:10px !important;
  font-weight:800 !important;
  line-height:1 !important;
}

body.tcw-brain-open button.tcw-brain-launcher,
body.tcw-brain-open .tcw-brain-launcher{
  opacity:0 !important;
  pointer-events:none !important;
  transform:translateX(24px) !important;
}

@media (max-width:640px){
  button.tcw-brain-launcher,
  .tcw-brain-launcher{
    top:auto !important;
    right:12px !important;
    bottom:14px !important;

    min-width:82px !important;

    border-right:
      1px solid rgba(87,220,255,.28) !important;

    border-radius:13px !important;
  }
}
/* ==========================================================
   Creative Brain Overview tab
   ========================================================== */

.tcw-brain-tabs{
  gap:4px;
}

.tcw-brain-tab{
  padding-left:3px;
  padding-right:3px;
  font-size:8px;
}

[data-tcw-brain-pane="overview"]{
  padding-top:14px;
}

[data-tcw-brain-pane="overview"] .tcw-dashboard{
  margin-bottom:0;
}

@media (max-width:430px){
  .tcw-brain-tabs{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }

  .tcw-brain-tab{
    min-height:34px;
    font-size:7px;
  }
}