/* JWJ Image independent redesign layer.
   The existing business markup and API contracts remain intact. */
:root {
  --jwj-ink: #17181c;
  --jwj-ink-soft: #282930;
  --jwj-muted: #92939c;
  --jwj-paper: #f8f7f4;
  --jwj-white: #ffffff;
  --jwj-line: #e6e2dc;
  --jwj-coral: #f36d5f;
  --jwj-coral-dark: #d75449;
  --jwj-coral-soft: #fff0ed;
  --jwj-mint: #b7e7d6;
  --jwj-shadow: 0 20px 60px rgba(35, 30, 25, .10);
}

html, body {
  background: var(--jwj-paper);
}

body {
  color: var(--jwj-ink);
  letter-spacing: -.012em;
}

/* VOZEB-inspired product shell: one bright entry point instead of a
   utility-sidebar-first layout. Business markup and handlers stay intact. */
#generation-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 76px minmax(0, 1fr) auto !important;
  min-height: 100vh;
  background: #fbfbff !important;
}

#generation-workspace > aside {
  display: none !important;
}

#generation-workspace > div {
  display: contents !important;
}

#generation-workspace > div > header {
  grid-row: 1;
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  width: 100%;
  height: 76px !important;
  padding: 0 clamp(22px, 5vw, 76px) !important;
  border-bottom: 1px solid #ececf4 !important;
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 1px 0 rgba(32,34,62,.025) !important;
  backdrop-filter: blur(18px);
}

#generation-workspace > div > header > div:first-child {
  gap: 10px;
}

#generation-workspace > div > header .brand-logo-header {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

#generation-workspace > div > header .brand-logo-header + span {
  color: #16182a !important;
  font-size: 15px !important;
  letter-spacing: -.02em;
}

#generation-workspace > div > header .generation-top-options,
#generation-workspace > div > header .jwj-product-nav-actions #new-session-button,
#generation-workspace > div > header .jwj-product-nav-actions #mobile-settings-button {
  display: none !important;
}

#generation-workspace > div > header .jwj-product-nav-actions {
  min-width: 0;
}

.jwj-product-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.jwj-product-nav button {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: #686b7d;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.jwj-product-nav button:hover,
.jwj-product-nav button:focus-visible {
  color: #20223d;
  background: #f2f1ff;
  outline: none;
  transform: translateY(-1px);
}

.jwj-product-nav button.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #7161ed, #6650ee);
  box-shadow: 0 8px 18px rgba(104,82,236,.22);
}

.jwj-product-nav button.is-primary:hover,
.jwj-product-nav button.is-primary:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #6554e4, #5942db);
}

.jwj-product-nav-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.jwj-product-nav-theme,
.jwj-product-nav-cta {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

.jwj-product-nav-theme {
  width: 38px;
  border: 1px solid #e8e8f0;
  color: #65687b;
  background: #fff;
}

.jwj-product-nav-theme:hover,
.jwj-product-nav-theme:focus-visible {
  color: #4541a5;
  border-color: #d8d4ff;
  background: #f8f7ff;
  outline: none;
}

.jwj-product-nav-cta {
  padding: 0 17px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #6f5cea, #6549e8);
  box-shadow: 0 9px 22px rgba(104,82,236,.22);
  font-size: 11px;
  font-weight: 800;
}

.jwj-product-nav-cta:hover,
.jwj-product-nav-cta:focus-visible {
  background: linear-gradient(135deg, #624edc, #573dd2);
  outline: none;
  transform: translateY(-1px);
}

#generation-workspace #main-canvas {
  grid-row: 2;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(54px, 8vh, 100px) 24px 30px !important;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 30%, rgba(176,225,255,.22), transparent 26%),
    radial-gradient(circle at 88% 28%, rgba(232,210,255,.26), transparent 28%),
    linear-gradient(180deg, #fcfcff 0%, #f9f8ff 100%) !important;
}

#generation-workspace #main-canvas::before {
  inset: 12px clamp(14px, 3vw, 48px) 18px !important;
  border: 1px solid rgba(223,222,242,.75);
  border-radius: 30px;
}

#generation-workspace .welcome-panel {
  position: relative;
  width: min(1040px, 100%) !important;
  max-width: 1040px !important;
  align-items: center !important;
  gap: 14px !important;
  text-align: center !important;
}

#generation-workspace .welcome-panel::before,
#generation-workspace .welcome-panel::after {
  position: absolute;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 19px;
  color: rgba(106,81,226,.82);
  background: linear-gradient(145deg, rgba(242,240,255,.96), rgba(223,213,255,.65));
  box-shadow: 0 18px 42px rgba(99,83,187,.18), inset 0 1px 0 rgba(255,255,255,.85);
  font-size: 25px;
  font-weight: 700;
  transform: rotate(-12deg);
  pointer-events: none;
  content: "✦";
}

#generation-workspace .welcome-panel::before {
  top: 78px;
  left: -82px;
}

#generation-workspace .welcome-panel::after {
  right: -82px;
  bottom: 108px;
  color: rgba(75,168,148,.82);
  background: linear-gradient(145deg, rgba(241,255,250,.96), rgba(203,242,226,.68));
  font-size: 22px;
  transform: rotate(13deg);
  content: "⌁";
}

#generation-workspace .brand-logo-welcome {
  display: none;
}

#generation-workspace .welcome-panel h1 {
  max-width: 900px;
  margin: 0 auto 10px !important;
  color: #11142b !important;
  font-size: clamp(36px, 6vw, 68px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.065em;
}

#generation-workspace .welcome-panel h1 .jwj-gradient-word {
  color: #6752e8;
  background: linear-gradient(100deg, #6752e8, #a45cec);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#generation-workspace .welcome-panel > div:nth-child(2) p {
  max-width: 700px;
  margin: 0 auto;
  color: #7d8095 !important;
  font-size: 15px;
  line-height: 1.6;
}

#generation-workspace .welcome-panel > div:nth-child(3) {
  display: none !important;
}

#generation-workspace .jwj-redesign-suggestions {
  justify-content: center;
  margin-top: 8px;
}

#generation-workspace > div > footer {
  grid-row: 3;
  width: min(1120px, calc(100% - 36px));
  min-height: 0 !important;
  margin: -8px auto 28px;
  padding: 13px 18px 17px !important;
  border: 1px solid #ecebf5 !important;
  border-radius: 25px !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: 0 20px 60px rgba(78,70,140,.13), 0 2px 8px rgba(61,54,99,.04) !important;
  backdrop-filter: blur(20px);
}

#generation-workspace > div > footer > div:first-child {
  justify-content: flex-start !important;
  margin-bottom: 9px !important;
  padding: 0 5px;
}

#generation-workspace > div > footer > div:last-of-type {
  width: 100% !important;
}

#generation-workspace #prompt-input {
  min-height: 66px;
  border-color: #e4e2ee !important;
  border-radius: 17px !important;
  box-shadow: inset 0 1px 1px rgba(48,43,88,.025) !important;
}

#generation-workspace #prompt-input:focus {
  border-color: rgba(109,87,235,.52) !important;
  box-shadow: 0 0 0 4px rgba(109,87,235,.10), inset 0 1px 1px rgba(48,43,88,.025) !important;
}

#generation-workspace #generate-button {
  background: linear-gradient(135deg, #7161ed, #6449e9) !important;
  box-shadow: 0 9px 18px rgba(104,82,236,.25);
}

#generation-workspace #generate-button:hover {
  background: linear-gradient(135deg, #624edb, #573dd3) !important;
}

.jwj-hero-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid #ebeaf4;
  border-radius: 999px;
  background: #fafaff;
}

.jwj-hero-mode-switch button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  color: #77798b;
  background: transparent;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.jwj-hero-mode-switch button:hover,
.jwj-hero-mode-switch button:focus-visible,
.jwj-hero-mode-switch button.is-active {
  color: #4c3cb0;
  background: #efedff;
  outline: none;
}

.jwj-hero-mode-switch button .material-symbols-outlined {
  font-size: 15px;
}

.jwj-hero-mode-switch button[data-jwj-mode="agent"] .material-symbols-outlined { color: #8065e9; }
.jwj-hero-mode-switch button[data-jwj-mode="image"] .material-symbols-outlined { color: #35ad8b; }
.jwj-hero-mode-switch button[data-jwj-mode="video"] .material-symbols-outlined { color: #eb8062; }
.jwj-hero-mode-switch button[data-jwj-mode="audio"] .material-symbols-outlined { color: #9674e8; }

@media (max-width: 900px) {
  #generation-workspace > div > header {
    grid-template-columns: 1fr auto;
  }
  .jwj-product-nav {
    display: none;
  }
  #generation-workspace > div > header .generation-top-options {
    display: none !important;
  }
  .jwj-product-nav-actions {
    gap: 5px;
  }
  #generation-workspace > div > footer {
    width: min(100% - 20px, 760px);
    margin-bottom: 12px;
    border-radius: 20px !important;
  }
  #generation-workspace .welcome-panel::before,
  #generation-workspace .welcome-panel::after {
    display: none;
  }
  .jwj-hero-mode-switch {
    width: 100%;
    justify-content: space-between;
  }
  .jwj-hero-mode-switch button {
    flex: 1;
    justify-content: center;
    padding-inline: 7px;
  }
}

@media (max-width: 560px) {
  #generation-workspace > div > header {
    height: 64px !important;
    padding-inline: 14px !important;
  }
  #generation-workspace {
    grid-template-rows: 64px minmax(0, 1fr) auto !important;
  }
  .jwj-product-nav-cta {
    display: none;
  }
  #generation-workspace #main-canvas {
    padding-top: 36px !important;
  }
  #generation-workspace .welcome-panel h1 {
    font-size: clamp(34px, 11vw, 50px) !important;
  }
  #generation-workspace .welcome-panel > div:nth-child(2) p {
    font-size: 13px;
  }
  .jwj-hero-mode-switch button {
    font-size: 9px;
  }
  .jwj-hero-mode-switch button .material-symbols-outlined {
    display: none;
  }
}

/* World Agent follows the same VOZEB-like centered creation entry: a bright
   canvas, a clear headline and one large conversational composer. */
.world-agent-workspace.world-agent-studio {
  grid-template-rows: 76px minmax(0, 1fr) !important;
  background: #fbfbff !important;
  color: #15162a !important;
}

.world-agent-studio-topbar {
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr) !important;
  min-height: 76px !important;
  padding: 0 clamp(20px, 5vw, 76px) !important;
  border-bottom: 1px solid #ececf4 !important;
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 1px 0 rgba(32,34,62,.025) !important;
}

.world-agent-studio-brand-mark {
  border-radius: 11px !important;
  background: linear-gradient(135deg, #25233a, #4d4875) !important;
  box-shadow: 0 10px 20px rgba(55,50,102,.17) !important;
}

.world-agent-studio-project strong {
  color: #1c1d32 !important;
}

.world-agent-studio-project span:not(.material-symbols-outlined):not(.world-agent-studio-brand-mark) {
  color: #9999aa !important;
}

.world-agent-studio-steps {
  gap: 4px !important;
  padding: 4px !important;
  border: 1px solid #ebeaf4 !important;
  border-radius: 999px !important;
  background: #fafaff !important;
}

.world-agent-studio-steps button {
  min-height: 36px !important;
  padding-inline: 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #78798c !important;
  background: transparent !important;
  font-size: 10px !important;
}

.world-agent-studio-steps button:hover,
.world-agent-studio-steps button:focus-visible,
.world-agent-studio-steps button.is-active {
  color: #4c3cb0 !important;
  background: #efedff !important;
  box-shadow: none !important;
}

.world-agent-studio-steps button.is-active > span {
  border-color: #7462ea !important;
  background: #7462ea !important;
}

.world-agent-studio-actions::before {
  background: #ececf4 !important;
}

.world-agent-studio-main {
  overflow: auto !important;
  background:
    radial-gradient(circle at 13% 17%, rgba(171,224,255,.26), transparent 25%),
    radial-gradient(circle at 90% 18%, rgba(231,213,255,.30), transparent 28%),
    linear-gradient(180deg, #fcfcff 0%, #f8f8ff 100%) !important;
}

.world-agent-studio-view {
  position: relative !important;
  inset: auto !important;
  min-height: 100% !important;
  overflow: visible !important;
  background: transparent !important;
}

.world-agent-studio-page,
.world-agent-studio-page.is-wide {
  width: min(1120px, calc(100% - 36px)) !important;
  padding: clamp(52px, 8vh, 92px) 0 76px !important;
}

.world-agent-studio-heading {
  display: grid !important;
  justify-items: center;
  gap: 10px !important;
  margin: 0 auto 28px !important;
  text-align: center;
}

.world-agent-studio-heading > div:first-child > span,
.world-agent-episode-editor-header > div > span {
  color: #7a65de !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
}

.world-agent-studio-heading h1 {
  max-width: 900px;
  color: #11142b !important;
  font-size: clamp(38px, 5.5vw, 64px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.06em !important;
}

.world-agent-studio-heading p {
  max-width: 700px !important;
  margin-top: 4px !important;
  color: #818398 !important;
  font-size: 14px !important;
}

.world-agent-studio-heading-actions {
  justify-content: center;
  margin-top: 6px;
}

.world-agent-script-layout {
  display: block !important;
  max-width: 1040px;
  margin: 0 auto;
}

.world-agent-script-source,
.world-agent-script-analysis {
  border: 1px solid #ecebf5 !important;
  border-radius: 25px !important;
  background: rgba(255,255,255,.93) !important;
  box-shadow: 0 22px 60px rgba(77,68,144,.12) !important;
}

.world-agent-script-source {
  overflow: hidden;
  border-top: 0 !important;
}

.world-agent-script-source-tabs {
  gap: 6px !important;
  padding: 10px !important;
  border-bottom: 1px solid #f0eff7 !important;
  background: #fcfcff !important;
}

.world-agent-script-source-tabs button {
  min-height: 38px !important;
  border-radius: 999px !important;
  color: #7c7f92 !important;
}

.world-agent-script-source-tabs button:hover,
.world-agent-script-source-tabs button:focus-visible,
.world-agent-script-source-tabs button.is-active {
  color: #4d3eb4 !important;
  background: #f0eeff !important;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose {
  background: #fff !important;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 280px !important;
  padding: 27px 31px 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  background-image: none !important;
  color: #262844 !important;
  font-size: 15px !important;
  line-height: 1.9 !important;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose-actions {
  min-height: 66px !important;
  padding: 11px 16px !important;
  border-top: 1px solid #efeff6 !important;
  background: #fcfcff !important;
}

.world-agent-studio .world-agent-conversation-host .world-agent-compose-option {
  border-color: #e8e6f2 !important;
  border-radius: 999px !important;
  color: #6c6e84 !important;
  background: #fff !important;
}

.world-agent-studio .world-agent-conversation-host .world-agent-compose-option:hover,
.world-agent-studio .world-agent-conversation-host .world-agent-compose-option:focus-visible {
  border-color: #d8d1ff !important;
  color: #5644c0 !important;
  background: #f7f5ff !important;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button {
  min-width: 112px !important;
  height: 40px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #7462ea, #6248e4) !important;
  box-shadow: 0 9px 18px rgba(104,82,236,.23) !important;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button:hover,
.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button:focus-visible {
  background: linear-gradient(135deg, #654fdc, #5439d4) !important;
}

.world-agent-script-analysis {
  margin-top: 18px;
}

.world-agent-assets-grid,
.world-agent-episodes-grid {
  gap: 16px !important;
}

.world-agent-asset-card,
.world-agent-episode-card {
  border: 1px solid #ecebf5 !important;
  border-radius: 20px !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 14px 38px rgba(77,68,144,.07) !important;
}

.world-agent-asset-card-preview,
.world-agent-episode-card-preview {
  background: linear-gradient(135deg, #f0eeff, #edf9f8) !important;
}

.world-agent-studio-nextbar {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto 28px;
  border: 1px solid #ecebf5 !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.9) !important;
  box-shadow: 0 -8px 24px rgba(77,68,144,.05) !important;
}

@media (max-width: 920px) {
  .world-agent-studio-topbar {
    grid-template-columns: 1fr auto !important;
  }
  .world-agent-studio-steps {
    grid-row: 2;
  }
  .world-agent-studio-page,
  .world-agent-studio-page.is-wide {
    width: min(100% - 24px, 760px) !important;
    padding-top: 42px !important;
  }
}

@media (max-width: 640px) {
  .world-agent-workspace.world-agent-studio {
    grid-template-rows: 116px minmax(0, 1fr) !important;
  }
  .world-agent-studio-page,
  .world-agent-studio-page.is-wide {
    width: min(100% - 20px, 640px) !important;
  }
  .world-agent-studio-heading h1 {
    font-size: clamp(34px, 10vw, 48px) !important;
  }
  .world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field textarea {
    min-height: 230px !important;
    padding: 23px 20px 16px !important;
    font-size: 13px !important;
  }
  .world-agent-studio-nextbar {
    width: min(100% - 20px, 640px);
  }
}

.global-workspace-mode-switch {
  position: fixed !important;
  top: auto !important;
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  z-index: 500 !important;
  display: inline-flex !important;
  gap: 3px !important;
  padding: 5px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 16px !important;
  background: rgba(23,24,28,.94) !important;
  box-shadow: 0 16px 36px rgba(23,24,28,.24) !important;
  backdrop-filter: blur(18px);
  transform: none !important;
}

.global-workspace-mode-switch .workspace-mode-button {
  display: inline-flex;
  width: auto !important;
  min-width: 74px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px !important;
  border-radius: 11px;
  color: #a7a8b0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.global-workspace-mode-switch .workspace-mode-button:hover {
  color: #fff;
  background: rgba(255,255,255,.09);
}

.global-workspace-mode-switch .workspace-mode-button.is-active {
  color: var(--jwj-ink);
  background: #fff;
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
}

.global-workspace-mode-switch .workspace-mode-button[data-workspace-mode="world"].is-active {
  color: #152b27;
  background: var(--jwj-mint);
}

.global-workspace-mode-switch .material-symbols-outlined {
  font-size: 18px;
}

html:not([data-jwj-workspace-mode="canvas"]):not([data-jwj-workspace-mode="world"]):not([data-jwj-workspace-mode="sequence"]) .global-workspace-mode-switch {
  display: none !important;
}

#generation-workspace {
  background: var(--jwj-paper) !important;
  color: var(--jwj-ink);
}

#generation-workspace > aside {
  width: 248px !important;
  padding: 26px 14px 18px !important;
  border-right: 1px solid rgba(255,255,255,.12) !important;
  background: var(--jwj-ink) !important;
  color: #fff;
}

#generation-workspace > aside > div:first-child {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  margin: 0 10px 30px !important;
  padding: 0 !important;
}

#generation-workspace > aside .brand-logo-sidebar {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  margin: 0 !important;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(0,0,0,.28);
}

#generation-workspace > aside > div:first-child h2 {
  margin: 0 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

#generation-workspace > aside > div:first-child p {
  margin: 2px 0 0 !important;
  color: #8e9099 !important;
  font-size: 10px !important;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.jwj-redesign-nav {
  display: grid;
  gap: 5px;
  margin: 0 3px 20px;
}

.jwj-redesign-nav-label {
  padding: 0 9px 5px;
  color: #777a84;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.jwj-redesign-nav button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  grid-template-rows: 1fr 1fr;
  min-height: 50px;
  align-items: center;
  column-gap: 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #b8bac2;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.jwj-redesign-nav button:hover {
  color: #fff;
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.08);
  transform: translateX(2px);
}

.jwj-redesign-nav button.is-active,
.jwj-redesign-nav button[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(243,109,95,.28);
  background: linear-gradient(135deg, rgba(243,109,95,.24), rgba(255,255,255,.08));
}

.jwj-redesign-nav button .material-symbols-outlined {
  grid-row: 1 / span 2;
  color: var(--jwj-coral);
  font-size: 19px;
}

.jwj-redesign-nav button span:nth-child(2) {
  align-self: end;
  font-size: 12px;
  font-weight: 760;
}

.jwj-redesign-nav button small {
  align-self: start;
  color: #777a84;
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  letter-spacing: .02em;
}

.jwj-redesign-nav button.is-active small,
.jwj-redesign-nav button[aria-pressed="true"] small {
  color: #d6aaa4;
}

.jwj-redesign-sidebar-note {
  display: grid;
  gap: 8px;
  margin: 0 9px 18px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
}

.jwj-redesign-sidebar-note > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 780;
}

.jwj-redesign-sidebar-note > span:first-child .material-symbols-outlined {
  color: var(--jwj-coral);
  font-size: 16px;
}

.jwj-redesign-sidebar-note > span:last-child {
  color: #858792;
  font-size: 10px;
  line-height: 1.45;
}

#history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 3px !important;
}

#history-list .history-entry {
  min-height: 44px;
  padding: 0 9px !important;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #c2c3ca !important;
  background: transparent !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

#history-list .history-entry:hover,
#history-list .history-entry.is-active {
  color: #fff !important;
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.09) !important;
}

#history-list .history-entry.is-active::before {
  width: 4px;
  height: 22px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--jwj-coral);
  content: "";
}

#generation-workspace > aside > div:last-child {
  padding: 16px 3px 0 !important;
  border-top: 1px solid rgba(255,255,255,.10) !important;
}

#settings-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px !important;
  color: #c2c3ca !important;
  background: transparent !important;
}

#settings-button:hover {
  color: #fff !important;
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.08) !important;
}

#generation-workspace > div {
  background: var(--jwj-paper) !important;
}

#generation-workspace > div > header {
  height: 72px !important;
  padding: 0 30px !important;
  border-bottom: 1px solid var(--jwj-line) !important;
  background: rgba(248,247,244,.86) !important;
  backdrop-filter: blur(16px);
}

.jwj-redesign-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #ded9d1;
  border-radius: 999px;
  color: #78726c;
  background: rgba(255,255,255,.68);
  font-size: 10px;
  font-weight: 760;
}

.jwj-redesign-header-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38b77b;
  box-shadow: 0 0 0 4px rgba(56,183,123,.12);
}

#generation-workspace > div > header .brand-logo-header {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(38,30,25,.14);
}

.jwj-redesign-header-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #e5dfd6;
  border-radius: 999px;
  color: #8b847c;
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
}

.generation-header-actions,
#generation-workspace > div > header .generation-top-options {
  margin-right: 0 !important;
}

#image-model-control .option-trigger {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--jwj-line);
  border-radius: 11px;
  color: var(--jwj-ink-soft);
  background: #fff;
  box-shadow: 0 4px 14px rgba(44,35,28,.05);
}

#generation-workspace #main-canvas {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 42px 54px 32px !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(243,109,95,.08), transparent 34%),
    linear-gradient(180deg, #fbfaf8 0%, var(--jwj-paper) 100%) !important;
}

#generation-workspace #main-canvas::before {
  position: absolute;
  inset: 22px 28px;
  border: 1px solid rgba(230,226,220,.72);
  border-radius: 28px;
  pointer-events: none;
  content: "";
}

#generation-workspace .welcome-panel {
  position: relative;
  z-index: 1;
  max-width: 860px !important;
  align-items: stretch !important;
  gap: 24px !important;
  text-align: left !important;
}

#generation-workspace .brand-logo-welcome {
  width: 58px;
  height: 58px;
  margin: 0 0 2px !important;
  border: 0;
  border-radius: 17px;
  box-shadow: 0 12px 26px rgba(38,30,25,.14);
}

#generation-workspace .welcome-panel h1 {
  margin: 0 0 7px !important;
  color: var(--jwj-ink) !important;
  font-size: clamp(34px, 4vw, 56px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.055em;
}

#generation-workspace .welcome-panel > div:nth-child(3) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: none !important;
  margin-top: 10px !important;
}

#generation-workspace .welcome-panel > div:nth-child(3) > div {
  min-height: 118px;
  padding: 17px !important;
  border: 1px solid var(--jwj-line) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.82) !important;
  box-shadow: 0 8px 22px rgba(40,32,26,.04);
}

#generation-workspace .welcome-panel > div:nth-child(3) .material-symbols-outlined {
  color: var(--jwj-coral) !important;
}

#generation-workspace .welcome-panel > div:nth-child(3) span:last-child {
  color: #6c6a68 !important;
  line-height: 1.55;
}

.jwj-redesign-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.jwj-redesign-suggestions-label {
  margin-right: 3px;
  color: #9a938b;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.jwj-redesign-suggestions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #e3ddd5;
  border-radius: 999px;
  color: #6e6963;
  background: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.jwj-redesign-suggestions button:hover {
  color: var(--jwj-ink);
  border-color: rgba(243,109,95,.50);
  background: var(--jwj-coral-soft);
  transform: translateY(-1px);
}

.jwj-redesign-suggestions .material-symbols-outlined {
  color: var(--jwj-coral);
  font-size: 14px;
}

#generation-workspace .result-stream {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%) !important;
  padding: 26px 0 34px !important;
}

#generation-workspace > div > footer {
  min-height: 172px !important;
  padding: 18px 38px 22px !important;
  border-top: 1px solid var(--jwj-line) !important;
  background: rgba(255,255,255,.84) !important;
  backdrop-filter: blur(16px);
}

#generation-workspace .option-trigger {
  border-color: var(--jwj-line);
  border-radius: 999px;
  color: #626168;
  background: #fff;
}

#generation-workspace .option-control.is-open .option-trigger {
  color: var(--jwj-ink);
  border-color: rgba(243,109,95,.42);
  box-shadow: 0 0 0 3px rgba(243,109,95,.10);
}

#generation-workspace #attachment-tray {
  width: min(920px, 100%);
  margin: 0 auto 9px;
}

#generation-workspace footer > div:last-of-type {
  width: min(920px, 100%) !important;
}

#generation-workspace #prompt-input {
  min-height: 58px;
  padding: 16px 62px 16px 54px !important;
  border: 1px solid #ddd8d0 !important;
  border-radius: 18px !important;
  color: var(--jwj-ink) !important;
  background: #fff !important;
  box-shadow: 0 11px 28px rgba(40,32,26,.08);
}

#generation-workspace #prompt-input:focus {
  border-color: rgba(243,109,95,.55) !important;
  box-shadow: 0 0 0 4px rgba(243,109,95,.12), 0 11px 28px rgba(40,32,26,.08) !important;
}

#generation-workspace .composer-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

#generation-workspace #upload-button {
  left: 10px;
  color: #7c7771;
  background: #f3f0ec;
}

#generation-workspace #generate-button {
  right: 10px;
  color: #fff !important;
  background: var(--jwj-coral) !important;
  box-shadow: 0 8px 16px rgba(243,109,95,.28);
}

#generation-workspace #generate-button:hover {
  background: var(--jwj-coral-dark) !important;
  transform: translateY(-1px);
}

#infinite-canvas-shell,
#canvas-workspace,
#sequence-frame-shell {
  background: var(--jwj-paper) !important;
}

.canvas-library-topbar,
.canvas-topbar,
.sequence-topbar {
  border-bottom-color: var(--jwj-line) !important;
  background: rgba(248,247,244,.92) !important;
  box-shadow: 0 8px 30px rgba(35,30,25,.05) !important;
  backdrop-filter: blur(18px);
}

.canvas-primary-button,
.world-agent-studio-primary-button,
.sequence-primary-button {
  border: 0 !important;
  border-radius: 11px !important;
  background: var(--jwj-coral) !important;
  box-shadow: 0 8px 18px rgba(243,109,95,.22);
}

.canvas-primary-button:hover,
.world-agent-studio-primary-button:hover,
.sequence-primary-button:hover {
  background: var(--jwj-coral-dark) !important;
}

.canvas-secondary-button,
.world-agent-studio-secondary-button,
.sequence-secondary-button {
  border-color: var(--jwj-line) !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.82) !important;
}

.world-agent-workspace.world-agent-studio {
  background: #f5f3ef !important;
}

.world-agent-studio-topbar {
  border-bottom-color: var(--jwj-line) !important;
  background: rgba(255,255,255,.90) !important;
}

.world-agent-studio-steps {
  padding: 4px !important;
  border: 1px solid #e7e1d9 !important;
  border-radius: 14px !important;
  background: #f3efea !important;
}

.world-agent-studio-steps button {
  min-height: 36px !important;
  border-color: transparent !important;
  border-radius: 10px !important;
  color: #89827b !important;
  background: transparent !important;
  font-size: 11px !important;
  font-weight: 760 !important;
}

.world-agent-studio-steps button.is-active {
  color: var(--jwj-ink) !important;
  border-color: rgba(243,109,95,.22) !important;
  background: #fff !important;
  box-shadow: 0 5px 14px rgba(48,39,31,.08);
}

.world-agent-studio-steps button.is-active > span {
  color: var(--jwj-coral) !important;
  background: var(--jwj-coral-soft) !important;
}

.world-agent-studio-brand-mark {
  border-radius: 12px !important;
  background: var(--jwj-ink) !important;
}

.world-agent-studio-main {
  padding: 26px !important;
  background:
    radial-gradient(circle at 88% 0%, rgba(243,109,95,.08), transparent 28%),
    #f5f3ef !important;
}

.world-agent-studio-view {
  min-height: 0;
}

.world-agent-studio-page {
  border: 1px solid #e7e1d9 !important;
  border-radius: 22px !important;
  background: rgba(255,255,255,.78) !important;
  box-shadow: 0 16px 42px rgba(56,44,35,.06);
}

.world-agent-studio-heading {
  padding: 25px 26px 20px !important;
}

.world-agent-studio-heading h1 {
  color: var(--jwj-ink) !important;
  letter-spacing: -.04em;
}

.world-agent-script-layout,
.world-agent-assets-grid,
.world-agent-episodes-grid {
  padding: 0 26px 26px !important;
}

.world-agent-script-source,
.world-agent-script-analysis,
.world-agent-episode-assets,
.world-agent-episode-segments,
.world-agent-episode-preview {
  border-color: #e7e1d9 !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.90) !important;
  box-shadow: 0 8px 24px rgba(56,44,35,.04);
}

.world-agent-script-source-tabs button.is-active,
.world-agent-asset-tabs button.is-active {
  color: var(--jwj-ink) !important;
  border-color: rgba(243,109,95,.28) !important;
  background: var(--jwj-coral-soft) !important;
}

.world-agent-studio-nextbar {
  border-top-color: #e7e1d9 !important;
  background: rgba(255,255,255,.82) !important;
}

.world-agent-episode-editor {
  background: transparent !important;
}

.world-agent-episode-editor-header,
.world-agent-episode-timeline {
  border-color: #e7e1d9 !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.88) !important;
}

.infinite-canvas-shell {
  background:
    radial-gradient(circle at 10% 0%, rgba(243,109,95,.08), transparent 24%),
    #f5f2ed !important;
}

.canvas-library-topbar,
.canvas-topbar {
  min-height: 72px !important;
  padding-inline: 24px !important;
}

.canvas-library-brand img {
  border: 0 !important;
  border-radius: 10px !important;
}

.canvas-project-library-main {
  padding: 28px !important;
}

.canvas-library-topbar {
  grid-template-columns: minmax(180px, 1fr) auto auto !important;
  min-height: 76px !important;
  padding: 0 clamp(20px, 5vw, 76px) !important;
  border-bottom-color: #ececf4 !important;
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 1px 0 rgba(32,34,62,.025) !important;
  backdrop-filter: blur(18px);
}

.canvas-library-brand {
  gap: 10px !important;
  color: #1c1d32 !important;
  font-size: 15px !important;
}

.canvas-library-brand img {
  width: 36px !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 17px rgba(55,50,102,.14);
}

.jwj-library-product-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.jwj-library-product-nav button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #76798c;
  background: transparent;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.jwj-library-product-nav button:hover,
.jwj-library-product-nav button:focus-visible {
  color: #4d3eb4;
  background: #f0eeff;
  outline: none;
}

.canvas-library-settings {
  width: 38px !important;
  height: 38px !important;
  border-color: #e8e8f0 !important;
  border-radius: 999px !important;
  color: #676a7b !important;
}

@media (max-width: 900px) {
  .canvas-library-topbar {
    grid-template-columns: 1fr auto !important;
  }
  .jwj-library-product-nav {
    display: none;
  }
}

.canvas-project-library-heading {
  margin-bottom: 22px !important;
}

.canvas-project-grid {
  gap: 16px !important;
}

.canvas-project-card {
  border-color: #e7e1d9 !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.82) !important;
  box-shadow: 0 10px 30px rgba(56,44,35,.05);
}

.canvas-project-card:hover {
  border-color: rgba(243,109,95,.42) !important;
  box-shadow: 0 16px 38px rgba(56,44,35,.10);
  transform: translateY(-2px);
}

.canvas-toolbar {
  padding: 7px !important;
  border: 1px solid rgba(255,255,255,.8) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.78) !important;
  box-shadow: 0 12px 30px rgba(56,44,35,.10) !important;
  backdrop-filter: blur(14px);
}

.canvas-tool-button {
  border-radius: 11px !important;
}

.canvas-tool-button:hover,
.canvas-tool-button.is-active {
  color: var(--jwj-coral-dark) !important;
  background: var(--jwj-coral-soft) !important;
}

.canvas-assets-panel,
.canvas-agent-panel,
.canvas-options-panel {
  border-color: #e7e1d9 !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(32,26,22,.16) !important;
}

.sequence-frame-shell {
  background:
    radial-gradient(circle at 86% 2%, rgba(183,231,214,.32), transparent 28%),
    #f5f2ed !important;
}

.sequence-frame-sidebar,
.sequence-preview-panel,
.sequence-timeline-panel {
  border-color: #e7e1d9 !important;
  background: rgba(255,255,255,.84) !important;
  box-shadow: 0 12px 30px rgba(56,44,35,.05);
}

/* Settings is the control plane for the whole studio. */
.settings-backdrop {
  background: rgba(18, 18, 21, .58) !important;
  backdrop-filter: blur(10px);
}

.settings-dialog {
  width: min(980px, calc(100vw - 32px)) !important;
  max-height: min(820px, calc(100vh - 32px)) !important;
  border: 1px solid #ece6df !important;
  border-radius: 24px !important;
  background: #fbfaf8 !important;
  box-shadow: 0 28px 100px rgba(18,18,21,.25) !important;
}

.settings-header {
  min-height: 76px !important;
  padding-inline: 28px !important;
  border-bottom-color: var(--jwj-line) !important;
}

.settings-title {
  color: var(--jwj-ink) !important;
  font-size: 22px !important;
  letter-spacing: -.04em;
}

.settings-body {
  padding: 22px 28px !important;
  background: #fbfaf8 !important;
}

.settings-api-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--jwj-line);
  border-radius: 15px;
  background: #f1eee9;
}

.settings-api-tab {
  min-height: 43px;
  border-radius: 10px !important;
  color: #77716b !important;
  background: transparent !important;
  font-size: 12px;
  font-weight: 760;
}

.settings-api-tab:hover {
  color: var(--jwj-ink) !important;
  background: rgba(255,255,255,.65) !important;
}

.settings-api-tab.is-active {
  color: var(--jwj-ink) !important;
  background: #fff !important;
  box-shadow: 0 6px 14px rgba(48,39,31,.08);
}

.settings-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--jwj-line);
  border-radius: 18px;
  background: #fff;
}

.settings-panel-heading strong,
.settings-label,
.settings-panel-heading span {
  color: var(--jwj-ink) !important;
}

.settings-panel-heading span,
.settings-help {
  color: #8a847e !important;
}

.settings-input {
  min-height: 42px;
  border-color: #ded8d0 !important;
  border-radius: 11px !important;
  background: #fbfaf8 !important;
}

.settings-input:focus {
  border-color: rgba(243,109,95,.62) !important;
  box-shadow: 0 0 0 3px rgba(243,109,95,.12) !important;
}

.settings-footer {
  min-height: 74px !important;
  padding: 0 28px !important;
  border-top-color: var(--jwj-line) !important;
  background: #fff !important;
}

.settings-save {
  min-height: 40px;
  padding-inline: 20px !important;
  border-radius: 11px !important;
  background: var(--jwj-coral) !important;
}

.settings-clear {
  color: #8b847c !important;
}

@media (max-width: 900px) {
  html:not([data-jwj-workspace-mode="canvas"]):not([data-jwj-workspace-mode="world"]):not([data-jwj-workspace-mode="sequence"]) .global-workspace-mode-switch {
    display: inline-flex !important;
  }

  #generation-workspace > aside {
    width: 76px !important;
    padding-inline: 10px !important;
  }
  #generation-workspace > aside > div:first-child {
    display: block;
    margin-inline: auto !important;
    text-align: center;
  }
  #generation-workspace > aside > div:first-child h2,
  #generation-workspace > aside > div:first-child p,
  .jwj-redesign-nav-label,
  .jwj-redesign-nav button span:nth-child(2),
  .jwj-redesign-nav button small,
  #history-list .history-entry span:not(.material-symbols-outlined),
  #settings-button span:last-child {
    display: none;
  }
  .jwj-redesign-nav {
    margin-bottom: 12px;
  }
  .jwj-redesign-nav button {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 42px;
    justify-items: center;
    padding: 0;
  }
  .jwj-redesign-nav button .material-symbols-outlined {
    grid-row: auto;
  }
  #generation-workspace .welcome-panel > div:nth-child(3) {
    grid-template-columns: 1fr;
  }
  #generation-workspace #main-canvas {
    padding: 26px 18px 22px !important;
  }
  #generation-workspace #main-canvas::before {
    inset: 12px;
    border-radius: 20px;
  }
  #generation-workspace > div > footer {
    padding-inline: 16px !important;
  }
  .global-workspace-mode-switch {
    right: 12px !important;
    bottom: 12px !important;
  }
  .global-workspace-mode-switch .workspace-mode-button {
    min-width: 42px;
    padding-inline: 9px !important;
  }
  .global-workspace-mode-switch .workspace-mode-label {
    display: none !important;
  }
  .jwj-redesign-header-kicker {
    display: none;
  }
  .settings-body,
  .settings-header,
  .settings-footer {
    padding-inline: 16px !important;
  }
  .settings-api-tabs {
    grid-template-columns: 1fr;
  }
}

/* Stage 2: a calmer project-library landing and clearer production rhythm. */
.canvas-project-library-main {
  position: relative;
  isolation: isolate;
  max-width: 1480px;
  margin: 0 auto;
}

.canvas-project-library-main::before {
  position: absolute;
  z-index: -1;
  top: -80px;
  right: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,109,95,.13), rgba(243,109,95,0) 68%);
  pointer-events: none;
  content: "";
}

.canvas-project-library-heading {
  align-items: flex-end;
}

.jwj-project-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 0 0 24px;
  padding: 25px 28px;
  border: 1px solid #e7e1d9;
  border-radius: 22px;
  background:
    linear-gradient(125deg, rgba(255,255,255,.96), rgba(255,250,247,.90)),
    radial-gradient(circle at 100% 0, rgba(243,109,95,.10), transparent 42%);
  box-shadow: 0 18px 42px rgba(56,44,35,.06);
}

.jwj-project-library-hero-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.jwj-project-library-hero-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  color: var(--jwj-coral-dark);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.jwj-project-library-hero-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jwj-coral);
  box-shadow: 0 0 0 4px rgba(243,109,95,.12);
}

.jwj-project-library-hero h2 {
  margin: 0;
  color: var(--jwj-ink);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.jwj-project-library-hero p {
  max-width: 620px;
  margin: 0;
  color: #7d7770;
  font-size: 12px;
  line-height: 1.65;
}

.jwj-project-library-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.jwj-project-library-hero-chip {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #e6dfd7;
  border-radius: 999px;
  color: #756e67;
  background: rgba(255,255,255,.78);
  font-size: 10px;
  font-weight: 760;
}

.jwj-project-library-hero-chip .material-symbols-outlined {
  color: var(--jwj-coral);
  font-size: 15px;
}

.jwj-project-library-hero-chip strong {
  color: var(--jwj-ink);
  font-size: 12px;
}

.jwj-library-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 12px;
  color: #9a938b;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.jwj-library-section-label span:last-child {
  color: #b0a9a1;
  font-family: Inter, "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.canvas-project-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: stretch;
}

.canvas-project-card {
  min-height: 100%;
}

.canvas-project-empty {
  min-height: 310px;
  border-style: dashed !important;
  background: rgba(255,255,255,.58) !important;
}

/* World Agent: make the four-step flow feel like a studio, not a form. */
.world-agent-studio-topbar {
  position: sticky;
  top: 0;
}

.world-agent-studio-steps button {
  position: relative;
}

.world-agent-studio-steps button:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 9px;
  height: 1px;
  background: #d6dfdd;
  content: "";
}

.jwj-world-stage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: -7px 0 24px;
}

.jwj-world-stage-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 67px;
  padding: 10px 12px;
  border: 1px solid #e7e1d9;
  border-radius: 15px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 20px rgba(56,44,35,.035);
}

.jwj-world-stage-card > .material-symbols-outlined {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--jwj-coral-dark);
  background: var(--jwj-coral-soft);
  font-size: 16px;
}

.jwj-world-stage-card-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.jwj-world-stage-card-copy strong {
  overflow: hidden;
  color: var(--jwj-ink);
  font-size: 17px;
  font-weight: 820;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jwj-world-stage-card-copy span {
  overflow: hidden;
  color: #928a83;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jwj-world-stage-card.is-ready {
  border-color: #cfe4dc;
  background: linear-gradient(135deg, rgba(244,255,250,.94), rgba(255,255,255,.78));
}

.jwj-world-stage-card.is-ready > .material-symbols-outlined {
  color: #157763;
  background: #def2ea;
}

.world-agent-analysis-header,
.world-agent-asset-card,
.world-agent-episode-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.world-agent-analysis-header {
  position: relative;
  overflow: hidden;
}

.world-agent-analysis-header::after {
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(15,118,110,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(15,118,110,.04), 0 0 0 36px rgba(15,118,110,.025);
  pointer-events: none;
  content: "";
}

.world-agent-asset-card:hover,
.world-agent-episode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15,118,110,.28) !important;
  box-shadow: 0 18px 38px rgba(25,55,51,.11) !important;
}

.world-agent-studio-nextbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  box-shadow: 0 -10px 28px rgba(25,55,51,.045);
}

@media (max-width: 900px) {
  .jwj-project-library-hero {
    grid-template-columns: 1fr;
    padding: 21px;
  }

  .jwj-project-library-hero-actions {
    justify-content: flex-start;
  }

  .jwj-world-stage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .jwj-world-stage-summary {
    grid-template-columns: 1fr;
  }

  .world-agent-studio-steps button:not(:last-child)::after {
    display: none;
  }

  .jwj-library-section-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* v8 final reference-site overrides. Keep this block last so legacy rules cannot
   reintroduce the old dashboard composition. */
.global-workspace-mode-switch { display:none !important; }

#generation-workspace {
  display:block !important;
  position:relative !important;
  width:100% !important;
  min-height:100vh !important;
  overflow:hidden !important;
  background:#fafbfc !important;
}
#generation-workspace > aside { display:none !important; }
#generation-workspace > div {
  display:flex !important;
  flex-direction:column !important;
  width:100% !important;
  height:100vh !important;
  min-width:0 !important;
  background:transparent !important;
}
#generation-workspace > div > header {
  z-index:20 !important;
  display:grid !important;
  grid-template-columns:minmax(180px,1fr) auto minmax(180px,1fr) !important;
  align-items:center !important;
  width:100% !important;
  height:81px !important;
  min-height:81px !important;
  padding:0 32px !important;
  border-bottom:1px solid rgba(231,234,241,.92) !important;
  background:rgba(251,252,255,.9) !important;
  box-shadow:none !important;
  backdrop-filter:blur(18px) !important;
}
#generation-workspace > div > header > div:first-child { display:inline-flex !important; align-items:center !important; gap:10px !important; min-width:0 !important; }
#generation-workspace .brand-logo-header { width:40px !important; height:40px !important; flex:0 0 40px !important; border-radius:8px !important; object-fit:cover !important; box-shadow:0 5px 12px rgba(35,41,67,.13) !important; }
#generation-workspace .brand-logo-header + span { display:inline-block !important; color:#12182a !important; font-size:17px !important; font-weight:760 !important; line-height:1 !important; white-space:nowrap !important; }
.jwj-redesign-header-kicker { display:none !important; }
#generation-workspace .generation-top-options { display:none !important; }
#generation-workspace .generation-header-actions { display:inline-flex !important; justify-content:flex-end !important; min-width:0 !important; }
#generation-workspace .generation-header-actions > * { display:none !important; }
.jwj-product-nav { display:inline-flex !important; align-items:center !important; justify-content:center !important; gap:10px !important; white-space:nowrap !important; }
.jwj-product-nav button,
.jwj-library-product-nav button { min-height:44px !important; padding:0 18px !important; border:0 !important; border-radius:12px !important; color:#10182f !important; background:transparent !important; font:600 15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; cursor:pointer !important; }
.jwj-product-nav button:hover,.jwj-product-nav button:focus-visible,.jwj-library-product-nav button:hover,.jwj-library-product-nav button:focus-visible { color:#6048e9 !important; background:#f3f0ff !important; outline:none !important; }
.jwj-product-nav-actions { display:inline-flex !important; align-items:center !important; justify-content:flex-end !important; gap:12px !important; min-width:0 !important; }
.jwj-product-nav-theme { display:inline-grid !important; width:44px !important; height:44px !important; place-items:center !important; padding:0 !important; border:1px solid #e7eaf1 !important; border-radius:50% !important; color:#10182f !important; background:rgba(255,255,255,.72) !important; cursor:pointer !important; }
.jwj-product-nav-cta { min-height:44px !important; padding:0 22px !important; border:0 !important; border-radius:12px !important; color:#fff !important; background:linear-gradient(135deg,#7058f5,#6048e9) !important; box-shadow:0 10px 22px rgba(104,76,235,.25) !important; font:700 15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; cursor:pointer !important; }

#generation-workspace #main-canvas {
  position:relative !important;
  z-index:1 !important;
  display:flex !important;
  flex:1 1 auto !important;
  align-items:flex-start !important;
  justify-content:flex-start !important;
  min-height:0 !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  padding:78px 32px 28px !important;
  background:radial-gradient(ellipse 620px 380px at 4% 42%,rgba(216,236,255,.58),transparent 70%),radial-gradient(ellipse 640px 430px at 96% 30%,rgba(246,229,255,.68),transparent 73%),linear-gradient(180deg,#fbfcff 0%,#fafbfc 100%) !important;
}
#generation-workspace #main-canvas::before { display:none !important; content:none !important; }
#generation-workspace .welcome-panel {
  position:relative !important;
  z-index:1 !important;
  display:flex !important;
  width:min(1120px,100%) !important;
  max-width:1120px !important;
  margin:0 auto !important;
  align-items:center !important;
  gap:0 !important;
  text-align:center !important;
}
#generation-workspace .welcome-panel::before,#generation-workspace .welcome-panel::after { display:none !important; content:none !important; }
#generation-workspace .brand-logo-welcome,#generation-workspace .welcome-panel > div:nth-child(3) { display:none !important; }
#generation-workspace .welcome-panel > div:nth-child(2) { width:100% !important; }
#generation-workspace .welcome-panel h1 { max-width:none !important; margin:0 !important; color:#0b1020 !important; font-size:clamp(42px,5.2vw,60px) !important; font-weight:780 !important; line-height:1.12 !important; letter-spacing:-.045em !important; }
#generation-workspace .welcome-panel h1 .jwj-gradient-word { color:#7058f5 !important; background:linear-gradient(100deg,#5f48e9,#875cff) !important; -webkit-background-clip:text !important; background-clip:text !important; -webkit-text-fill-color:transparent !important; }
#generation-workspace .welcome-panel > div:nth-child(2) p { max-width:760px !important; margin:14px auto 0 !important; color:#7f8796 !important; font-size:17px !important; line-height:1.65 !important; }

#generation-workspace > div > footer {
  position:absolute !important;
  z-index:10 !important;
  top:248px !important;
  left:50% !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:0 !important;
  width:min(1120px,calc(100% - 64px)) !important;
  height:288px !important;
  min-height:288px !important;
  margin:0 !important;
  padding:25px 38px 26px !important;
  border:1px solid rgba(226,228,238,.88) !important;
  border-radius:26px !important;
  background:rgba(255,255,255,.94) !important;
  box-shadow:0 24px 70px rgba(67,69,110,.14),0 2px 8px rgba(25,32,65,.04) !important;
  transform:translateX(-50%) !important;
  backdrop-filter:blur(20px) !important;
}
#generation-workspace > div > footer > div:last-of-type { order:1 !important; width:100% !important; min-height:114px !important; height:114px !important; margin:0 !important; }
#generation-workspace #prompt-input { display:block !important; width:100% !important; min-height:114px !important; height:114px !important; padding:8px 0 0 !important; border:0 !important; border-radius:0 !important; color:#0b1020 !important; background:transparent !important; box-shadow:none !important; font-size:17px !important; line-height:1.65 !important; resize:none !important; }
#generation-workspace #prompt-input:focus { outline:none !important; box-shadow:none !important; }
#generation-workspace #prompt-input::placeholder { color:#7e8797 !important; opacity:1 !important; }
#generation-workspace #upload-button { left:0 !important; bottom:0 !important; z-index:2 !important; width:42px !important; height:42px !important; border:1px solid #e7eaf1 !important; border-radius:50% !important; color:#667085 !important; background:#fff !important; }
#generation-workspace #generate-button { right:0 !important; bottom:0 !important; z-index:2 !important; width:50px !important; height:50px !important; border:0 !important; border-radius:50% !important; color:#fff !important; background:linear-gradient(135deg,#755cf7,#6048e9) !important; box-shadow:0 10px 22px rgba(98,71,231,.3) !important; }
#generation-workspace > div > footer > div:first-child { order:3 !important; display:flex !important; align-items:center !important; justify-content:flex-start !important; gap:3px !important; margin:13px 0 0 !important; padding:0 !important; }
#generation-workspace > div > footer > #attachment-tray { order:4 !important; width:100% !important; margin-top:8px !important; }
#generation-workspace > div > footer > p { display:none !important; }
#generation-workspace #creation-type-control,#generation-workspace #generation-options-control,#generation-workspace #quality-control { display:none !important; }
.jwj-reference-suggestions { order:2 !important; display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:12px !important; width:100% !important; height:45px !important; margin:2px 0 0 !important; }
.jwj-reference-suggestions button { min-width:0 !important; height:45px !important; padding:0 13px !important; overflow:hidden !important; border:1px solid #e7eaf1 !important; border-radius:999px !important; color:#60697b !important; background:#fbfbfd !important; font-size:14px !important; font-weight:500 !important; text-overflow:ellipsis !important; white-space:nowrap !important; cursor:pointer !important; }
.jwj-reference-suggestions button:hover,.jwj-reference-suggestions button:focus-visible { border-color:#d1c9fd !important; color:#4f3ed0 !important; background:#f8f6ff !important; outline:none !important; }
.jwj-hero-mode-switch { order:3 !important; display:inline-flex !important; align-items:center !important; gap:3px !important; padding:0 !important; border:0 !important; background:transparent !important; }
.jwj-hero-mode-switch button { display:inline-flex !important; min-height:44px !important; align-items:center !important; gap:8px !important; padding:0 15px !important; border:1px solid transparent !important; border-radius:12px !important; color:#687286 !important; background:transparent !important; font-size:14px !important; font-weight:600 !important; cursor:pointer !important; }
.jwj-hero-mode-switch button:hover,.jwj-hero-mode-switch button:focus-visible,.jwj-hero-mode-switch button.is-active { border-color:#e2dcff !important; color:#4f3ed0 !important; background:#f7f4ff !important; outline:none !important; }
.jwj-hero-mode-switch button .material-symbols-outlined { font-size:19px !important; }

/* once results exist the composer docks to the bottom, as in the reference chat state */
#generation-workspace #main-canvas.has-results { padding-top:28px !important; padding-bottom:320px !important; }
#generation-workspace #main-canvas.has-results ~ footer { top:auto !important; bottom:20px !important; height:174px !important; min-height:174px !important; padding:18px 28px !important; }
#generation-workspace #main-canvas.has-results ~ footer > div:last-of-type { min-height:72px !important; height:72px !important; }
#generation-workspace #main-canvas.has-results ~ footer #prompt-input { min-height:72px !important; height:72px !important; }

@media (max-width:900px) {
  #generation-workspace > div > header { grid-template-columns:1fr auto !important; padding:0 20px !important; }
  .jwj-product-nav { display:none !important; }
  #generation-workspace #main-canvas { padding-inline:20px !important; }
  #generation-workspace > div > footer { width:min(100% - 32px,760px) !important; padding-inline:24px !important; }
  .jwj-reference-suggestions { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width:560px) {
  #generation-workspace > div > header { height:68px !important; min-height:68px !important; padding-inline:14px !important; }
  #generation-workspace .brand-logo-header { width:36px !important; height:36px !important; flex-basis:36px !important; }
  #generation-workspace .brand-logo-header + span { font-size:15px !important; }
  .jwj-product-nav-cta { display:none !important; }
  #generation-workspace #main-canvas { padding:58px 14px 22px !important; }
  #generation-workspace .welcome-panel h1 { font-size:clamp(38px,11vw,52px) !important; }
  #generation-workspace .welcome-panel > div:nth-child(2) p { font-size:14px !important; }
  #generation-workspace > div > footer { top:auto !important; bottom:12px !important; width:calc(100% - 20px) !important; height:auto !important; min-height:260px !important; padding:18px !important; border-radius:22px !important; }
  .jwj-reference-suggestions { gap:8px !important; }
  .jwj-reference-suggestions button { height:40px !important; padding-inline:8px !important; font-size:11px !important; }
  .jwj-hero-mode-switch { width:100% !important; justify-content:space-between !important; }
  .jwj-hero-mode-switch button { flex:1 !important; justify-content:center !important; gap:4px !important; padding-inline:5px !important; font-size:11px !important; }
  .jwj-hero-mode-switch button .material-symbols-outlined { font-size:16px !important; }
}

/* final desktop alignment with agent.jwjimage.com */
#generation-workspace #main-canvas { padding-top:64px !important; }
#generation-workspace > div > footer { top:329px !important; }
#generation-workspace #upload-button { left:auto !important; right:58px !important; bottom:0 !important; }
@media (max-width:560px) {
  #generation-workspace #main-canvas { padding-top:48px !important; }
  #generation-workspace > div > footer { top:auto !important; }
}

/* composer geometry: full card width and lower-right action buttons */
#generation-workspace > div > footer > div:last-of-type { max-width:none !important; margin:0 !important; width:100% !important; }
@media (min-width:561px) {
  #generation-workspace #upload-button { top:185px !important; bottom:auto !important; }
  #generation-workspace #generate-button { top:181px !important; bottom:auto !important; }
}
@media (max-width:560px) {
  #generation-workspace #upload-button { top:auto !important; bottom:0 !important; }
  #generation-workspace #generate-button { top:auto !important; bottom:0 !important; }
}
@media (min-width:561px) {
  #generation-workspace > div > footer > div:first-child { margin-top:25px !important; }
  #generation-workspace #upload-button { top:207px !important; }
  #generation-workspace #generate-button { top:211px !important; }
}
/* Beat the legacy mobile rule that re-enables the floating workspace switch. */
body > #workspace-mode-switch { display:none !important; }

/* Keep the reference hero visible even when a previous session has results. */
#generation-workspace #main-canvas.has-results .welcome-panel { display:flex !important; }
#generation-workspace #main-canvas.has-results { padding-top:64px !important; }
#generation-workspace #main-canvas.has-results #result-stream { margin-top:350px !important; }

/* Subtle floating mode markers present on the reference hero. */
.jwj-hero-decorations { position:absolute !important; inset:0 !important; z-index:0 !important; pointer-events:none !important; }
.jwj-hero-float { position:absolute !important; display:grid !important; width:58px !important; height:58px !important; place-items:center !important; border:1px solid rgba(255,255,255,.95) !important; border-radius:19px !important; box-shadow:0 18px 42px rgba(99,83,187,.16),inset 0 1px 0 rgba(255,255,255,.9) !important; transform:rotate(-12deg) !important; }
.jwj-hero-float .material-symbols-outlined { font-size:24px !important; }
.jwj-hero-float--idea { top:170px !important; left:calc(50% - 560px) !important; color:#7866e9 !important; background:linear-gradient(145deg,rgba(242,240,255,.96),rgba(223,213,255,.72)) !important; }
.jwj-hero-float--image { top:405px !important; left:calc(50% - 610px) !important; color:#46b894 !important; background:linear-gradient(145deg,rgba(241,255,250,.96),rgba(203,242,226,.78)) !important; transform:rotate(13deg) !important; }
.jwj-hero-float--audio { top:405px !important; right:calc(50% - 610px) !important; color:#8d70e8 !important; background:linear-gradient(145deg,rgba(244,240,255,.96),rgba(222,212,255,.78)) !important; transform:rotate(-13deg) !important; }
@media (max-width:900px) { .jwj-hero-float--idea { left:16px !important; } .jwj-hero-float--image { left:12px !important; } .jwj-hero-float--audio { right:12px !important; } }
@media (max-width:560px) { .jwj-hero-decorations { display:none !important; } }

/* Canvas controls: keep the top controls floating without a full-width overlay. */
.canvas-workspace > .canvas-topbar {
  min-height: 42px !important;
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Canvas-only site: all other workspace entry points stay unavailable. */
body > #workspace-mode-switch,
#generation-workspace,
.world-agent-workspace,
#sequence-frame-shell,
.jwj-library-product-nav {
  display: none !important;
}
