/*
 * CODSHIPX_AI_R107_C1_CODI_STUDIO
 * Full-page premium control center for the same Codi brain.
 */

#cx38-codi-root {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  color: #102039;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.cx107-studio {
  --cx107-navy: #071a36;
  --cx107-navy2: #0b2850;
  --cx107-lime: #9bdd24;
  --cx107-text: #102039;
  --cx107-muted: #748398;
  --cx107-border: #e1e8ef;
  --cx107-soft: #f7f9fc;

  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 26px 70px;
}

.cx107-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 188px;
  padding: 30px 32px;
  border: 1px solid rgba(117, 150, 202, .24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 86% 22%, rgba(155, 221, 36, .20), transparent 22rem),
    radial-gradient(circle at 65% 100%, rgba(89, 117, 229, .19), transparent 24rem),
    linear-gradient(135deg, #06152f, #0a2449 63%, #0b2c57);
  box-shadow: 0 24px 60px rgba(8, 29, 61, .18);
}

.cx107-hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  width: 400px;
  height: 400px;
  right: -170px;
  bottom: -275px;
  border: 1px solid rgba(165, 224, 56, .22);
  border-radius: 50%;
  box-shadow:
    0 0 0 35px rgba(95, 121, 230, .06),
    0 0 0 76px rgba(95, 121, 230, .035);
}

.cx107-hero-copy,
.cx107-hero-actions {
  position: relative;
  z-index: 1;
}

.cx107-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b7e75e;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 10px;
  font-weight: 850;
}

.cx107-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9bdd24;
  box-shadow: 0 0 0 5px rgba(155, 221, 36, .10);
}

.cx107-hero h1 {
  color: #fff;
  letter-spacing: -.04em;
  margin: 9px 0 7px;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 620;
  line-height: 1.04;
}

.cx107-hero p {
  color: #b7c6da;
  max-width: 760px;
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.cx107-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.cx107-btn {
  appearance: none;
  border: 1px solid #dce5ec;
  border-radius: 11px;
  min-height: 42px;
  padding: 0 15px;
  cursor: pointer;
  color: #32475f;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  transition:
    transform .15s,
    box-shadow .15s,
    border-color .15s,
    opacity .15s;
}

.cx107-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #cbd9e4;
  box-shadow: 0 8px 22px rgba(15, 40, 70, .10);
}

.cx107-btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.cx107-btn.primary {
  color: #173007;
  border-color: #99d822;
  background: linear-gradient(135deg, #adeb31, #8dce17);
  box-shadow: 0 9px 22px rgba(117, 176, 14, .24);
}

.cx107-btn.hero-secondary {
  color: #dce7f5;
  border-color: rgba(180, 201, 231, .25);
  background: rgba(6, 22, 47, .62);
}

.cx107-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 14px;
}

.cx107-status-card {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--cx107-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 40, 67, .06);
}

.cx107-status-card small {
  display: block;
  color: #8593a5;
  font-size: 10px;
  font-weight: 720;
}

.cx107-status-card strong {
  display: block;
  color: #132841;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.3;
}

.cx107-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.cx107-nav {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 10px;
  border: 1px solid var(--cx107-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 30px rgba(16, 40, 67, .07);
}

.cx107-nav button {
  appearance: none;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  color: #617187;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 690;
}

.cx107-nav button:hover {
  background: #f5f8fb;
}

.cx107-nav button.active {
  color: #395e08;
  background: #f0f8df;
  box-shadow: inset 3px 0 #9bd824;
}

.cx107-main {
  min-width: 0;
}

.cx107-panel {
  display: none;
  min-width: 0;
}

.cx107-panel.active {
  display: block;
}

.cx107-section {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--cx107-border);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0, rgba(155, 216, 36, .06), transparent 13rem),
    #fff;
  box-shadow: 0 11px 30px rgba(16, 40, 67, .07);
}

.cx107-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid #edf1f4;
}

.cx107-section-head h2 {
  color: #10253e;
  letter-spacing: -.025em;
  margin: 0;
  font-size: 19px;
}

.cx107-section-head p {
  color: #7c8a9d;
  max-width: 700px;
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.cx107-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cx107-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cx107-field {
  min-width: 0;
}

.cx107-field.full {
  grid-column: 1 / -1;
}

.cx107-field > span {
  display: block;
  margin-bottom: 7px;
  color: #455970;
  font-size: 11px;
  font-weight: 750;
}

.cx107-field small {
  display: block;
  margin-top: 6px;
  color: #93a0af;
  font-size: 9.5px;
  line-height: 1.5;
}

.cx107-field input,
.cx107-field select,
.cx107-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  outline: 0;
  border: 1px solid #dbe4ec;
  border-radius: 11px;
  color: #183049;
  background: #fbfcfe;
  font: inherit;
  font-size: 12px;
}

.cx107-field input,
.cx107-field select {
  height: 43px;
  padding: 0 12px;
}

.cx107-field textarea {
  resize: vertical;
  min-height: 110px;
  padding: 11px 12px;
  line-height: 1.55;
}

.cx107-field input:focus,
.cx107-field select:focus,
.cx107-field textarea:focus {
  background: #fff;
  border-color: #9ed437;
  box-shadow: 0 0 0 3px rgba(155, 216, 36, .13);
}

.cx107-checks {
  display: grid;
  gap: 8px;
}

.cx107-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #e4eaf0;
  border-radius: 12px;
  background: #fbfcfd;
}

.cx107-check input {
  accent-color: #8fce19;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
}

.cx107-check strong {
  display: block;
  color: #263c54;
  font-size: 11px;
}

.cx107-check small {
  display: block;
  color: #8996a6;
  margin-top: 3px;
  font-size: 9.5px;
  line-height: 1.45;
}

.cx107-cost-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cx107-cost-mode {
  position: relative;
}

.cx107-cost-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cx107-cost-mode span {
  display: block;
  cursor: pointer;
  min-height: 125px;
  padding: 16px;
  border: 1px solid #e0e7ed;
  border-radius: 15px;
  background: #fff;
  transition:
    border-color .15s,
    background .15s,
    box-shadow .15s,
    transform .15s;
}

.cx107-cost-mode span:hover {
  transform: translateY(-1px);
}

.cx107-cost-mode input:checked + span {
  border-color: #b6d977;
  background: #f6fbe9;
  box-shadow: 0 0 0 3px rgba(155, 216, 36, .10);
}

.cx107-cost-mode b {
  display: block;
  color: #173049;
  font-size: 13px;
}

.cx107-cost-mode small {
  display: block;
  color: #7f8c9d;
  margin-top: 7px;
  font-size: 9.5px;
  line-height: 1.55;
}

.cx107-range-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45px;
  align-items: center;
  gap: 10px;
}

.cx107-range-line input[type="range"] {
  height: auto;
  padding: 0;
  accent-color: #91cf1b;
}

.cx107-range-value {
  text-align: center;
  color: #537b13;
  background: #eff7df;
  border-radius: 9px;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 820;
}

.cx107-note {
  padding: 13px 14px;
  color: #60728a;
  background: #f7f9fb;
  border: 1px solid #e6ebf0;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.6;
}

.cx107-note.safe {
  color: #546d2b;
  background: #f6fbe9;
  border-color: #dfeac8;
}

.cx107-savebar {
  position: sticky;
  z-index: 30;
  bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(212, 224, 233, .95);
  border-radius: 15px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(11, 35, 64, .16);
}

.cx107-savebar-status {
  min-width: 0;
  color: #758499;
  font-size: 10px;
}

.cx107-savebar-status strong {
  color: #233b55;
}

.cx107-savebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cx107-loading,
.cx107-error,
.cx107-locked {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 40px;
  border: 1px solid var(--cx107-border);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.cx107-center-card {
  width: min(620px, 100%);
}

.cx107-center-orb {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 23px;
  color: #659415;
  background:
    radial-gradient(circle at 35% 28%, #dcf2a9, #eef7da 48%, #f6f8fb);
  border: 1px solid #dce7ca;
  font-size: 31px;
  box-shadow: 0 13px 32px rgba(42, 76, 113, .13);
}

.cx107-center-card h2 {
  color: #10243d;
  margin: 0;
  font-size: 24px;
}

.cx107-center-card p {
  color: #78879b;
  margin: 8px auto 20px;
  line-height: 1.65;
  font-size: 12px;
}

.cx107-toast {
  position: fixed;
  z-index: 2147483001;
  right: 24px;
  bottom: 24px;
  max-width: 390px;
  padding: 13px 15px;
  border: 1px solid #dce5ec;
  border-radius: 12px;
  color: #20374e;
  background: #fff;
  box-shadow: 0 20px 60px rgba(7, 25, 48, .22);
  font-size: 11px;
}

.cx107-toast.ok {
  border-color: #cfe3aa;
  background: #f7fce9;
}

.cx107-toast.error {
  color: #88424a;
  border-color: #eccbd0;
  background: #fff6f7;
}

@media (max-width: 1100px) {
  .cx107-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cx107-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .cx107-cost-modes,
  .cx107-grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .cx107-studio {
    padding: 15px 14px 80px;
  }

  .cx107-hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .cx107-hero-actions {
    justify-content: flex-start;
  }

  .cx107-shell {
    display: block;
  }

  .cx107-nav {
    position: static;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding: 7px;
  }

  .cx107-nav button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .cx107-grid {
    grid-template-columns: 1fr;
  }

  .cx107-field.full {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .cx107-status-strip {
    grid-template-columns: 1fr;
  }

  .cx107-section {
    padding: 17px 14px;
    border-radius: 16px;
  }

  .cx107-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .cx107-savebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cx107-savebar-actions .cx107-btn {
    width: 100%;
  }
}

/* ==========================================================
   CODSHIPX_AI_R107_C1_R3_VISUAL_POLISH

   Scope:
   - Codi Studio only
   - AI Center/Codi Studio sidebar row only
   - no shared module geometry changes
   ========================================================== */

/*
 * 1. Hero title must remain readable against the dark premium hero.
 */
.cx107-hero h1 {
  color: #ffffff !important;
  text-shadow:
    0 2px 16px rgba(0, 0, 0, .16) !important;
}

/*
 * 2. Keep Codi Studio label fully visible without widening the rail.
 *    Internal data-nav remains "AI Center" for compatibility.
 */
.rail-nav
button[data-nav="AI Center"] {
  gap: 8px !important;
}

.rail-nav
button[data-nav="AI Center"]
.nav-label {
  flex: 1 1 auto !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;

  letter-spacing: -.35px !important;
  font-size: 14.5px !important;
}

/*
 * Keep the CODI badge compact so it does not consume label space.
 */
.rail-nav
button[data-nav="AI Center"]
.nav-badge {
  flex: 0 0 auto !important;

  min-width: 0 !important;
  padding-left: 6px !important;
  padding-right: 6px !important;

  font-size: 9.5px !important;
}

/*
 * 3. Sticky action bar safe-space.
 *
 * The production CRM owns floating Live Agents / Codi controls
 * at bottom-right. Keep Studio actions clear of those controls
 * without moving or modifying the floating widgets themselves.
 */
@media (min-width: 821px) {
  .cx107-savebar {
    padding-right: 205px !important;
  }

  .cx107-studio {
    padding-bottom: 118px !important;
  }
}

/*
 * Mobile/tablet controls can move to different sides,
 * so use vertical clearance rather than desktop right padding.
 */
@media (max-width: 820px) {
  .cx107-savebar {
    bottom: 84px !important;
    padding-right: 14px !important;
  }

  .cx107-studio {
    padding-bottom: 150px !important;
  }
}

/* ==========================================================
   CODSHIPX_AI_R107_C1_R4_VISUAL_CORRECTIVE

   Exact fixes:
   - hero title visibility
   - section header rounded clipping issue
   - sidebar "Codi Studio" label clipping
   ========================================================== */

/*
 * 1) Hero title visibility.
 * Earlier contrast fix was not enough because the title still sat too dark.
 */
.cx107-hero h1 {
  color: #f8fbff !important;
  opacity: 1 !important;
  text-shadow:
    0 2px 16px rgba(0, 0, 0, .28) !important;
}

/*
 * 2) Section header inner capsule was too rounded and visually clipped text.
 * Flatten the inner head box and remove the aggressive pill feeling.
 */
.cx107-section-head {
  display: block !important;
  margin-bottom: 16px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #edf1f4 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.cx107-section-head > div {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.cx107-section-head h2 {
  margin: 0 0 6px !important;
  line-height: 1.22 !important;
}

.cx107-section-head p {
  margin: 0 !important;
  line-height: 1.55 !important;
}

/*
 * 3) Sidebar label clipping for Codi Studio.
 * Give the label a little more breathing room and trim badge impact.
 */
.rail-nav button[data-nav="AI Center"] {
  gap: 7px !important;
  padding-left: 11px !important;
  padding-right: 10px !important;
}

.rail-nav button[data-nav="AI Center"] .nav-icon {
  flex: 0 0 auto !important;
}

.rail-nav button[data-nav="AI Center"] .nav-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  letter-spacing: -.45px !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  padding-right: 1px !important;
}

.rail-nav button[data-nav="AI Center"] .nav-caret,
.rail-nav button[data-nav="AI Center"] .nav-chevron,
.rail-nav button[data-nav="AI Center"] [data-chevron] {
  flex: 0 0 auto !important;
  margin-left: 2px !important;
}

.rail-nav button[data-nav="AI Center"] .nav-badge {
  flex: 0 0 auto !important;
  margin-left: 2px !important;
  padding: 0 6px !important;
  font-size: 9px !important;
  line-height: 18px !important;
  min-height: 18px !important;
}

/*
 * 4) Slightly reduce the visual heaviness of section shells.
 */
.cx107-section {
  border-radius: 16px !important;
}

/*
 * 5) Keep left Studio section nav labels comfortable.
 */
.cx107-nav button {
  line-height: 1.28 !important;
}
