/* RAKU Module Shell v1 — shared module frame + explainer hero mechanics.
   Loaded before Orbit. Orbit remains the product-wide visual system. */

body.o6-dashboard-mode #guildWorkspace.o6-module-canvas {
  width: min(1540px, calc(100vw - 84px)) !important;
  max-width: 1540px !important;
  margin-inline: auto !important;
}

body.o6-dashboard-mode #guildWorkspace.o6-module-canvas > * {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-width: 0 !important;
}

body.o6-dashboard-mode #guildWorkspace.o6-module-canvas > :is(
  .flow-studio,
  .role-studio,
  .ticket-shell,
  .creator-shell,
  .voice-shell,
  .analytics-shell
) {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

.o6-module-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0 0 18px !important;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr);
  grid-template-areas:
    "copy side"
    "flow flow";
  overflow: hidden;
}

.o6-module-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -150px;
  top: -220px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(149,135,255,.18), rgba(108,220,255,.05) 48%, transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}

.o6-module-hero-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  grid-template-columns: 62px minmax(0,1fr);
  gap: 18px;
  align-items: center;
  padding: 28px 30px 24px;
}

.o6-module-hero-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(190,183,255,.20);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(149,135,255,.17), rgba(108,220,255,.055));
  color: #d7d1ff;
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 18px 42px rgba(0,0,0,.18);
}

.o6-module-hero-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.o6-module-hero-copy > div:last-child {
  min-width: 0;
}

.o6-module-hero-copy .o6-eyebrow {
  margin-bottom: 7px;
}

.o6-module-hero-copy h1 {
  max-width: 900px;
  margin: 0 !important;
  font: 800 clamp(30px, 3vw, 46px)/1.02 var(--o-display) !important;
  letter-spacing: -.045em !important;
  text-wrap: balance;
}

.o6-module-hero-copy p {
  max-width: 820px;
  margin: 10px 0 0 !important;
  color: var(--o-copy) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  text-wrap: pretty;
}

.o6-module-hero-side {
  grid-area: side;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 24px 26px;
  border-left: 1px solid rgba(222,227,255,.07);
  background: rgba(6,8,13,.16);
}

.o6-module-hero-status {
  display: grid;
  grid-template-columns: 9px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.o6-module-hero-status > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #596273;
  box-shadow: 0 0 0 5px rgba(255,255,255,.025);
}

.o6-module-hero-status.on > i {
  background: var(--o-green);
  box-shadow: 0 0 0 5px rgba(89,228,175,.07), 0 0 18px rgba(89,228,175,.18);
}

.o6-module-hero-status > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--o-copy);
  font-size: 11px;
  font-weight: 750;
}

.o6-module-hero-status > b {
  color: var(--o-muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.o6-module-hero-purpose {
  margin: 0 !important;
  color: var(--o-muted) !important;
  font-size: 11px !important;
  line-height: 1.55 !important;
}

.o6-module-hero-flow {
  grid-area: flow;
  min-width: 0;
  min-height: 55px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-top: 1px solid rgba(222,227,255,.07);
  background: rgba(7,9,14,.18);
  overflow-x: auto;
  scrollbar-width: none;
}

.o6-module-hero-flow::-webkit-scrollbar { display: none; }

.o6-module-hero-flow > strong {
  flex: none;
  margin-right: 4px;
  color: var(--o-dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.o6-module-hero-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 10px 0 7px;
  border: 1px solid rgba(222,227,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.026);
  color: var(--o-copy);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.o6-module-hero-step > i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(149,135,255,.11);
  color: #c9c1ff;
  font-style: normal;
  font-size: 8px;
  font-weight: 850;
}

/* The hero owns explanation/title. Existing module headers become compact toolbars. */
.o6-native-toolbar {
  min-height: 58px !important;
  margin-bottom: 18px !important;
  padding: 10px 13px !important;
  justify-content: flex-end !important;
}

.workspace-head.o6-native-toolbar > div:first-child,
.ticket-head.o6-native-toolbar > div:first-child,
.creator-head.o6-native-toolbar > div:first-child,
.analytics-head.o6-native-toolbar > div:first-child,
.o6-native-toolbar > .role-studio-title,
.o6-native-toolbar > .flow-studio-title,
.o6-native-toolbar > .voice-head-copy {
  display: none !important;
}

.o6-native-toolbar.o6-native-toolbar-empty {
  display: none !important;
}

.o6-native-toolbar > :last-child {
  margin-left: auto;
}

@media (max-width: 1100px) {
  .o6-module-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "side"
      "flow";
  }
  .o6-module-hero-side {
    border-left: 0;
    border-top: 1px solid rgba(222,227,255,.07);
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: 18px;
    padding: 15px 22px;
  }
}

@media (max-width: 900px) {
  body.o6-dashboard-mode #guildWorkspace.o6-module-canvas {
    width: calc(100% - 24px) !important;
    max-width: none !important;
  }
}

@media (max-width: 700px) {
  .o6-module-hero-copy {
    grid-template-columns: 48px minmax(0,1fr);
    gap: 13px;
    padding: 21px 18px 18px;
  }
  .o6-module-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }
  .o6-module-hero-icon svg {
    width: 22px;
    height: 22px;
  }
  .o6-module-hero-copy h1 {
    font-size: clamp(27px, 9vw, 36px) !important;
  }
  .o6-module-hero-side {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px 18px;
  }
  .o6-module-hero-flow {
    padding-inline: 12px;
  }
  .o6-native-toolbar {
    padding: 9px 11px !important;
  }
}
