@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --ink: #1d2833;
  --muted: #5d6b78;
  --line: #d7e0ea;
  --accent: #1e6ad8;
  --accent-2: #f58e54;
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(175, 197, 221, 0.62);
  --glass-shadow: 0 12px 30px rgba(20, 43, 70, 0.16);
  --dept-shell-bg: var(--glass-bg);
  --dept-shell-soft: var(--glass-soft);
  --dept-shell-border: var(--glass-border);
  --dept-status-bg: rgba(234, 243, 255, 0.74);
  --dept-status-border: rgba(202, 219, 239, 1);
  --dept-status-ink: #20476f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(700px 250px at 20% -5%, #d7e7ff 0%, rgba(215, 231, 255, 0) 70%),
    radial-gradient(900px 300px at 100% -10%, #ffe4d4 0%, rgba(255, 228, 212, 0) 70%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.studio-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.8rem;
  padding: 0.8rem;
}

.shell-top {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-areas:
    "brand meta"
    "brand center";
  gap: 0.8rem;
  align-items: start;
  border: 1px solid var(--dept-shell-border);
  background: var(--dept-shell-bg);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: var(--glass-shadow);
  border-radius: 14px;
  padding: 0.75rem;
}

html.browser-chrome .shell-top {
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-areas:
    "brand meta"
    "brand center";
  gap: 0.62rem;
}

.brand-block {
  grid-area: brand;
}

html.browser-chrome .tab-btn {
  padding: 0.36rem 0.66rem;
  font-size: 0.92rem;
}

.brand-kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.top-center {
  grid-area: center;
  display: grid;
  gap: 0.38rem;
  justify-items: start;
  align-items: start;
  min-width: 0;
  width: 100%;
}

.department-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

.release-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.release-badge {
  border: 1px solid rgba(223, 143, 41, 0.55);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 247, 228, 0.95), rgba(255, 235, 205, 0.88));
  color: #8e4f16;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.24rem 0.58rem;
}

.report-bug-btn {
  font-weight: 700;
  padding: 0.28rem 0.65rem;
}

html[data-theme="nebula-glass"] .release-badge,
html[data-theme="midnight-archive"] .release-badge,
html[data-theme="forge-mode"] .release-badge {
  background: rgba(18, 28, 52, 0.85);
  border-color: rgba(125, 178, 255, 0.54);
  color: #d9eaff;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.42rem 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn.is-all-filter {
  margin-right: 0.45rem;
  border-style: dashed;
  opacity: 0.96;
}

.tab-btn.with-role-label {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.32rem;
  line-height: 1.1;
  padding: 0.38rem 0.72rem 0.42rem;
}

.tab-btn-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  opacity: 0.92;
}

.tab-emoji {
  font-size: 0.95rem;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.tab-btn-labels {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
}

.tab-single-label {
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}

.tab-btn.with-role-label .tab-primary,
.tab-btn.with-role-label .tab-secondary {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.tab-btn.with-role-label .tab-secondary {
  display: none;
  opacity: 0.92;
}

.tab-btn.with-role-label.swap-label:hover .tab-primary,
.tab-btn.with-role-label.swap-label:focus-visible .tab-primary {
  display: none;
}

.tab-btn.with-role-label.swap-label:hover .tab-secondary,
.tab-btn.with-role-label.swap-label:focus-visible .tab-secondary {
  display: inline;
}

.tab-btn.with-role-label.swap-label.swap-inverted .tab-primary {
  display: inline;
}

.tab-btn.with-role-label.swap-label.swap-inverted .tab-secondary {
  display: none;
}

.tab-btn.with-role-label.swap-label.swap-inverted:hover .tab-primary,
.tab-btn.with-role-label.swap-label.swap-inverted:focus-visible .tab-primary {
  display: none;
}

.tab-btn.with-role-label.swap-label.swap-inverted:hover .tab-secondary,
.tab-btn.with-role-label.swap-label.swap-inverted:focus-visible .tab-secondary {
  display: inline;
}

.tab-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.top-chip {
  display: inline-block;
  border: 1px solid #b8d0f2;
  border-radius: 999px;
  background: #eaf3ff;
  color: #214f8a;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.top-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  min-width: 0;
}

.top-meta-row {
  display: flex;
  gap: 0.28rem;
  flex-wrap: wrap;
  align-items: center;
  white-space: normal;
  min-width: 0;
}

.top-meta-primary {
  margin-top: 0.05rem;
}

.top-meta-secondary {
  margin-top: 0.08rem;
}

.top-imprint-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #213a56;
  padding: 0.15rem 0.2rem;
  font-weight: 700;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.01em;
  line-height: 1.05;
  cursor: pointer;
  margin: 0;
  text-align: left;
}

.top-imprint-btn:hover {
  color: #1e3e63;
}

.top-imprint-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.imprint-editor-panel {
  width: min(560px, 92vw);
  height: auto;
  grid-template-rows: auto auto auto auto;
}

.project-stepup-panel {
  width: min(520px, 92vw);
  height: auto;
  grid-template-rows: auto auto auto auto auto;
}

.import-detect-review-panel {
  width: min(980px, 94vw);
  height: min(760px, 88vh);
  min-width: min(760px, 92vw);
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow-y: auto;
  resize: none;
}

.project-stepup-error {
  color: #8f2424;
  min-height: 1.1rem;
}

@media (max-width: 1220px) {
  .top-meta-row {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.top-link {
  display: inline-block;
  border: 1px solid #b8d0f2;
  border-radius: 999px;
  background: #fff;
  color: #214f8a;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.top-link.active {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.18);
  color: var(--chip-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.top-link.active#project-scriptorium-btn {
  border-color: color-mix(in srgb, var(--accent) 72%, #ffffff 28%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent 65%) inset,
    0 0 14px color-mix(in srgb, var(--accent) 30%, transparent 70%);
  animation: scriptoriumGlow 2.2s ease-in-out infinite;
}

.top-link-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  gap: 0.08rem;
}

.top-link-title {
  font-size: 0.8rem;
  font-weight: 700;
}

.top-link-sub {
  font-size: 0.68rem;
  opacity: 0.86;
}

@keyframes scriptoriumGlow {
  0% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent 70%) inset,
      0 0 10px color-mix(in srgb, var(--accent) 20%, transparent 80%);
    transform: translateY(0);
  }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 46%, transparent 54%) inset,
      0 0 18px color-mix(in srgb, var(--accent) 40%, transparent 60%);
    transform: translateY(-1px);
  }
  100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent 70%) inset,
      0 0 10px color-mix(in srgb, var(--accent) 20%, transparent 80%);
    transform: translateY(0);
  }
}

.shell-main {
  display: grid;
  grid-template-columns: minmax(0, var(--left-rail-width, 280px)) 8px minmax(0, 1fr) 8px minmax(0, var(--right-rail-width, 330px));
  gap: 0.8rem;
  min-height: 0;
  position: relative;
  align-items: start;
}

.action-status-banner {
  border: 1px solid var(--dept-status-border);
  border-radius: 10px;
  background: var(--dept-status-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--dept-status-ink);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.action-status-banner.success {
  background: #eaf9ef;
  border-color: #bfe5cc;
  color: #1f5f3a;
}

.action-status-banner.error {
  background: #ffefef;
  border-color: #f3c2c2;
  color: #8f2424;
}

.action-status-banner.info {
  background: var(--dept-status-bg);
  border-color: var(--dept-status-border);
  color: var(--dept-status-ink);
}

.global-notice-banner {
  border: 1px solid #f2c87c;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(255, 244, 218, 0.95), rgba(255, 235, 194, 0.92));
  color: #6f4312;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.global-notice-meta {
  opacity: 0.86;
  font-size: 0.8rem;
}

.global-notice-banner.info {
  border-color: #b7d2f3;
  background: rgba(231, 242, 255, 0.95);
  color: #1e4b7a;
}

.global-notice-banner.success {
  border-color: #bfe5cc;
  background: #eaf9ef;
  color: #1f5f3a;
}

.global-notice-banner.warning {
  border-color: #f2c87c;
  background: linear-gradient(120deg, rgba(255, 244, 218, 0.95), rgba(255, 235, 194, 0.92));
  color: #6f4312;
}

.global-notice-banner.critical {
  border-color: #e4a4a4;
  background: #ffe8e8;
  color: #7f1f1f;
}

.left-rail,
.workspace,
.right-rail {
  border: 1px solid var(--dept-shell-border);
  border-radius: 14px;
  background: var(--dept-shell-soft);
  backdrop-filter: blur(11px) saturate(118%);
  -webkit-backdrop-filter: blur(11px) saturate(118%);
  box-shadow: var(--glass-shadow);
  color: var(--ink);
  min-width: 0;
}

.pane-resizer {
  width: 8px;
  border-radius: 999px;
  background: rgba(143, 166, 194, 0.42);
  cursor: col-resize;
  align-self: stretch;
}

.pane-resizer:hover {
  background: rgba(79, 124, 172, 0.68);
}

.left-rail,
.right-rail {
  padding: 0.8rem;
  overflow: auto;
}

.left-rail-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.left-rail-panel {
  display: none;
}

.left-rail-panel.active {
  display: block;
}

.left-note {
  margin: 0.25rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-drop-box {
  border: 2px dashed #c4d6ea;
  border-radius: 10px;
  background: rgba(247, 251, 255, 0.78);
  color: #2d5175;
  padding: 0.65rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-drop-box.drag-over {
  border-color: #1e6ad8;
  background: #eaf4ff;
}

.asset-library-tree details {
  margin-bottom: 0.35rem;
}

.asset-library-tree summary {
  cursor: pointer;
  font-weight: 600;
}

.asset-library-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem 0.5rem;
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
}

.asset-library-item .asset-library-label {
  flex: 1;
}

.asset-library-label .draft-role-badge {
  margin-left: 0.35rem;
}

.draft-role-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c6d6ea;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.draft-role-badge.master {
  background: #fff4d8;
  border-color: #d9b36b;
  color: #7a5208;
}

.draft-role-badge.artifact {
  background: #f5f8fc;
  border-color: #c7d8ee;
  color: #2f527c;
}

.draft-role-badge.variant {
  background: #eef4ff;
  border-color: #b5cbef;
  color: #294b76;
}

.draft-role-badge.head-variant {
  background: #ecfbef;
  border-color: #bde4c7;
  color: #1f6a36;
}

.draft-role-badge.variant-of {
  background: #f8f4ff;
  border-color: #d3c4f4;
  color: #5b4595;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
}

.draft-role-badge.in-master {
  background: #e9f8ec;
  border-color: #b8e1c1;
  color: #1f6a36;
}

.draft-role-badge.cast-full {
  background: #e9f8ec;
  border-color: #b8e1c1;
  color: #1f6a36;
}

.draft-role-badge.cast-partial {
  background: #fff7e8;
  border-color: #ecd2a0;
  color: #8b5a11;
}

.draft-role-badge.asset-id {
  background: #f4f7fb;
  border-color: #cfdaea;
  color: #3a5878;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
}

.rail-section + .rail-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.asset-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.48rem 0.58rem;
  margin-top: 0.45rem;
}

.project-template-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.project-template-row .asset-search {
  flex: 1 1 180px;
  min-width: 0;
  margin-top: 0;
}

.project-template-row .mode-btn {
  flex: 0 0 auto;
}

.project-ops-group {
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.4rem 0.45rem 0.5rem;
}

.project-ops-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.project-ops-summary::-webkit-details-marker {
  display: none;
}

.project-ops-summary::before {
  content: "â–¾";
  font-size: 0.88rem;
  line-height: 1;
}

.project-ops-group:not([open]) .project-ops-summary::before {
  content: "â–¸";
}

.asset-filter-bar {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  border: 1px solid #e4c9b7;
  background: #fff4ec;
  color: #7a4e32;
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: #d6ad87;
  background: #ffecd9;
  color: #6d4229;
  transform: translateY(-1px);
}

.filter-chip.active {
  border-color: #ba7f4f;
  background: #f4d2b8;
  color: #5b3117;
}

.workspace {
  padding: 0.8rem;
  display: grid;
  grid-template-rows: auto auto;
  min-height: auto;
  position: relative;
  align-content: start;
  overflow: visible;
}

.pane-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  border: 1px solid #da8a42;
  background: #ef7f1b;
  color: #fff;
  border-radius: 8px;
  width: 24px;
  height: 52px;
  display: grid;
  place-items: center;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(47, 67, 96, 0.28);
}

.pane-toggle.left {
  left: -13px;
}

.pane-toggle.right {
  right: -13px;
}

.studio-shell.left-collapsed .shell-main {
  grid-template-columns: 0 0 minmax(0, 1fr) 8px minmax(0, var(--right-rail-width, 330px));
}

.studio-shell.right-collapsed .shell-main {
  grid-template-columns: minmax(0, var(--left-rail-width, 280px)) 8px minmax(0, 1fr) 0 0;
}

.studio-shell.left-collapsed.right-collapsed .shell-main {
  grid-template-columns: 0 0 minmax(0, 1fr) 0 0;
}

.studio-shell.left-collapsed .left-rail,
.studio-shell.left-collapsed #left-pane-resizer,
.studio-shell.right-collapsed .right-rail,
.studio-shell.right-collapsed #right-pane-resizer {
  display: none;
}

.studio-shell.scriptorium-mode .shell-main {
  grid-template-columns: minmax(0, 1fr);
}

.studio-shell.scriptorium-mode .left-rail,
.studio-shell.scriptorium-mode .right-rail,
.studio-shell.scriptorium-mode .pane-resizer,
.studio-shell.scriptorium-mode .pane-toggle {
  display: none !important;
}

.studio-shell.scriptorium-mode .workspace {
  width: 100%;
  max-width: none;
  padding: 0.95rem 1.1rem 1.2rem;
}

.studio-shell.scriptorium-mode .workspace-head {
  display: none;
}

.studio-shell.scriptorium-mode .workspace-view.active,
.studio-shell.scriptorium-mode .manuscript-editor,
.studio-shell.scriptorium-mode .draftforge-master-strip,
.studio-shell.scriptorium-mode .draftforge-focus-shell,
.studio-shell.scriptorium-mode .draftforge-assist-prompts,
.studio-shell.scriptorium-mode .draftforge-reference,
.studio-shell.scriptorium-mode #asset-grid {
  width: 100%;
  max-width: none;
}

.studio-shell.scriptorium-mode #text-view {
  margin-top: 0;
}

.studio-shell.scriptorium-mode .manuscript-editor textarea {
  min-height: calc(100vh - 290px);
}

/* Scriptorium: keep DraftForge artifact cards in a horizontal lane instead of long vertical stack */
.studio-shell.scriptorium-mode #asset-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  padding-bottom: 0.35rem;
  margin-top: 0.55rem;
}

.studio-shell.scriptorium-mode #asset-grid .asset-card,
.studio-shell.scriptorium-mode #asset-grid .asset-card-master,
.studio-shell.scriptorium-mode #asset-grid .asset-card-variant,
.studio-shell.scriptorium-mode #asset-grid .asset-card-ai {
  flex: 0 0 340px;
  max-width: 340px;
  height: 260px;
}

@media (max-width: 900px) {
  .studio-shell.scriptorium-mode #asset-grid .asset-card,
  .studio-shell.scriptorium-mode #asset-grid .asset-card-master,
  .studio-shell.scriptorium-mode #asset-grid .asset-card-variant,
  .studio-shell.scriptorium-mode #asset-grid .asset-card-ai {
    flex-basis: min(88vw, 360px);
    max-width: min(88vw, 360px);
  }
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.workspace-modes {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.mode-btn {
  border: 1px solid var(--accent);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent);
  border-radius: 8px;
  padding: 0.45rem 0.78rem;
  cursor: pointer;
  font-weight: 600;
  min-height: 38px;
}

.mode-btn.active {
  border-color: var(--accent-2);
  background: #fff0e7;
  color: #a64f1f;
}

.mode-btn.danger-btn {
  border-color: #c33f3f;
  color: #a02828;
  background: #fff2f2;
}

.mode-btn.danger-btn:hover,
.mode-btn.danger-btn:focus-visible {
  border-color: #a72d2d;
  color: #7f1919;
  background: #ffe3e3;
}

.mode-btn.danger-btn.active {
  border-color: #9e1f1f;
  color: #ffffff;
  background: linear-gradient(135deg, #cc4545, #9e1f1f);
}

.mode-btn.danger-btn:disabled {
  border-color: #d8b4b4;
  color: #b28282;
  background: #fdf5f5;
}

.workspace-view {
  display: none;
  margin-top: 0.7rem;
  min-height: 0;
}

.workspace-view.active {
  display: block;
}

.plot-beat-board-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 251, 255, 0.75);
  padding: 0.7rem;
  margin-top: 0.6rem;
}

.plot-beat-board-head {
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  align-items: center;
}

.plot-beat-board-controls {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.plot-beat-board-canvas {
  position: relative;
  height: 420px;
  border: 1px solid #c8d7e8;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(75, 114, 153, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(75, 114, 153, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.86);
  background-size: 24px 24px;
  overflow: hidden;
}

.plot-beat-board-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.plot-beat-board-cards {
  position: absolute;
  inset: 0;
}

.beat-card {
  position: absolute;
  width: 230px;
  min-height: 110px;
  border: 1px solid #cfdae6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.55rem 0.6rem;
  box-shadow: 0 8px 16px rgba(21, 47, 74, 0.12);
  cursor: grab;
  user-select: none;
}

.beat-card:active {
  cursor: grabbing;
}

.beat-card.active {
  border-color: #6f9ed8;
  box-shadow: 0 10px 20px rgba(19, 67, 127, 0.18);
}

.beat-card.root-card {
  border-color: #6a8fbc;
  background: linear-gradient(145deg, rgba(240, 247, 255, 0.92), rgba(228, 239, 255, 0.82));
}

.beat-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.beat-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #435466;
}

.beat-card .beat-meta {
  margin-top: 0.45rem;
  color: #57738e;
  font-size: 0.72rem;
}

.plot-beat-board-empty {
  margin: 0.45rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.dashboard-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.gamification-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.82);
  padding: 0.6rem;
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
}

.gamification-overall {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  color: #35516b;
}

.gamification-dept-row + .gamification-dept-row {
  margin-top: 0.35rem;
}

.gamification-dept-head {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #35516b;
}

.gamification-track {
  margin-top: 0.18rem;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #d9e6f5;
  overflow: hidden;
}

.gamification-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.manuscript-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem;
  margin-bottom: 0.6rem;
}

.draftforge-master-strip {
  border: 1px solid #c6d6ea;
  border-radius: 10px;
  background: #f4f9ff;
  padding: 0.5rem 0.55rem;
  margin: 0.2rem 0 0.45rem;
  display: grid;
  gap: 0.4rem;
}

.draftforge-master-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #2c4c6e;
}

.draftforge-master-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.draftforge-master-actions select {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
  background: #fff;
  color: inherit;
}

.manuscript-editor input,
.manuscript-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-top: 0.45rem;
  font-family: inherit;
}

.manuscript-editor textarea {
  min-height: 280px;
}

.asset-composer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
}

.muse-spark-box {
  border: 1px solid #d6e0ed;
  border-radius: 10px;
  background: #f9fcff;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
}

.muse-spark-box input,
.muse-spark-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
  font-family: inherit;
}

.muse-spark-box textarea {
  min-height: 84px;
}

.muse-form-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.45rem;
}

.muse-spark-box select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
  font-family: inherit;
}

.muse-note {
  margin: 0.2rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.spark-cluster-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0;
}

.spark-tag-chip {
  border: 1px solid #c8d7ea;
  background: #edf5ff;
  color: #32577e;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.73rem;
}

.spark-list {
  display: grid;
  gap: 0.45rem;
}

.spark-type-sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.spark-item {
  border: 1px solid #d6e0ed;
  border-radius: 9px;
  background: #fff;
  padding: 0.5rem 0.6rem;
}

.spark-item p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.spark-edit-row {
  margin-top: 0.4rem;
  display: grid;
  gap: 0.35rem;
}

.spark-edit-row input,
.spark-edit-row textarea,
.spark-edit-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
}

.spark-edit-row textarea {
  min-height: 76px;
}

.muse-structure-tree {
  border: 1px dashed #c6d4e4;
  border-radius: 9px;
  padding: 0.45rem 0.55rem;
  background: #f9fcff;
  margin-bottom: 0.45rem;
}

.muse-tree-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding-left: 0.85rem;
}

.muse-tree-item {
  margin-bottom: 0.2rem;
  color: #2b3d4f;
  font-size: 0.86rem;
}

.printprepper-cover-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(18, 68, 114, 0.18);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.printprepper-cover-head h3 {
  margin: 0 0 0.3rem;
}

.printprepper-freeze-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.35rem 0 0.6rem;
}

.printprepper-polisher-panel {
  border: 1px solid rgba(18, 68, 114, 0.18);
  border-radius: 10px;
  background: rgba(251, 254, 255, 0.94);
  padding: 0.55rem;
  margin: 0 0 0.65rem;
}

.printprepper-polisher-panel h4 {
  margin: 0 0 0.25rem;
}

.printprepper-polisher-panel textarea {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  resize: vertical;
}

.printprepper-cover-form input,
.printprepper-cover-form textarea,
.printprepper-cover-form select {
  width: 100%;
}

.printprepper-cover-form textarea {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  resize: vertical;
}

.printprepper-library-publish {
  border: 1px solid rgba(18, 68, 114, 0.18);
  border-radius: 10px;
  background: rgba(251, 254, 255, 0.94);
  padding: 0.55rem;
  margin: 0.65rem 0 0.35rem;
}

.printprepper-artifact-export {
  border: 1px solid rgba(18, 68, 114, 0.18);
  border-radius: 10px;
  background: rgba(251, 254, 255, 0.94);
  padding: 0.55rem;
  margin: 0.65rem 0 0.35rem;
}

.printprepper-artifact-export h4 {
  margin: 0 0 0.25rem;
}

.printprepper-library-publish h4 {
  margin: 0 0 0.25rem;
}

.printprepper-library-publish textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  resize: vertical;
}

.cover-art-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.cover-art-card {
  border: 1px solid rgba(17, 77, 125, 0.2);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
}

.cover-art-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(17, 77, 125, 0.16);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #dbe6f1;
}

.cover-art-card .chat-actions {
  margin-top: 0.45rem;
}

.asset-composer input,
.asset-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
  font-family: inherit;
}

.asset-composer textarea {
  min-height: 84px;
}

.dash-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.82);
  padding: 0.5rem 0.6rem;
}

.dash-card p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

.dash-card h4 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
}

.workspace-surface {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(120deg, #f4f9ff, #fff7f1);
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
}

.surface-kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.active-surface-panel > h3 {
  margin: 0.2rem 0 0.45rem;
}

.workflow-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.workflow-chip {
  border: 1px solid #c8d7ea;
  background: #eff6ff;
  border-radius: 999px;
  padding: 0.26rem 0.52rem;
  font-size: 0.75rem;
  color: #2c4f78;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.module-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 10px;
  padding: 0;
}

.module-card-btn {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.module-card-btn:hover {
  background: #f7fbff;
}

.module-card-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.module-card-btn p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.module-page {
  max-width: 980px;
  margin: 1rem auto;
  padding: 0.8rem;
}

.beatboard-page {
  min-height: 100vh;
  padding: 0.8rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.6rem;
}

.beatboard-top,
.beatboard-toolbar,
.beatboard-shell,
.beatboard-order,
.beatboard-viewport {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--glass-soft);
  backdrop-filter: blur(11px) saturate(118%);
  -webkit-backdrop-filter: blur(11px) saturate(118%);
  box-shadow: var(--glass-shadow);
}

.beatboard-top,
.beatboard-toolbar {
  padding: 0.6rem 0.7rem;
}

.beatboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.beatboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.beatboard-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
}

.beatboard-settings label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.beatboard-settings input[type="range"] {
  width: 120px;
}

.beatboard-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0.6rem;
  padding: 0.6rem;
  min-height: 0;
}

.beatboard-order {
  padding: 0.55rem;
  overflow: auto;
}

.beatboard-order-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.35rem;
}

.beatboard-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.beatboard-viewport {
  overflow: hidden;
  position: relative;
  min-height: 680px;
  cursor: grab;
  background:
    linear-gradient(90deg, rgba(75, 114, 153, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(75, 114, 153, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 28px 28px;
}

.beatboard-viewport.panning {
  cursor: grabbing;
}

.beatboard-world {
  position: absolute;
  width: 4200px;
  height: 3200px;
  transform-origin: 0 0;
}

.beatboard-links,
.beatboard-cards {
  position: absolute;
  inset: 0;
}

.beatboard-links {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.beat-card.connect-pending {
  border-color: #9258f4;
  box-shadow: 0 0 0 2px rgba(146, 88, 244, 0.25);
}

.module-page-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0.9rem;
}

.story-map-ribbon {
  margin-top: 0.75rem;
}

.story-map-ribbon-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.story-map-status {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.story-map-status.info {
  background: #eef4fb;
  border-color: #cadbef;
  color: #20476f;
}

.story-map-status.success {
  background: #eaf9ef;
  border-color: #bfe5cc;
  color: #1f5f3a;
}

.story-map-status.error {
  background: #ffefef;
  border-color: #f3c2c2;
  color: #8f2424;
}

.story-map-asset-strip {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
}

.story-map-asset-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  padding: 0.58rem 0.62rem;
  cursor: pointer;
  display: grid;
  gap: 0.18rem;
}

.story-map-asset-card strong {
  font-size: 0.92rem;
}

.story-map-asset-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.story-map-asset-card.active {
  border-color: var(--accent);
  background: #f2f7ff;
}

.story-map-detail {
  margin-top: 0.75rem;
}

.story-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.story-map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.story-map-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.story-map-block {
  border: 1px solid #d6e2ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.62rem;
}

.story-map-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.4rem;
}

.story-map-table th,
.story-map-table td {
  border-top: 1px solid #e1eaf4;
  padding: 0.42rem 0.35rem;
  text-align: left;
  font-size: 0.86rem;
  vertical-align: top;
}

.story-map-table th {
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.story-map-input {
  width: 100%;
  border: 1px solid #cbdae9;
  border-radius: 8px;
  padding: 0.34rem 0.45rem;
  font: inherit;
  font-size: 0.84rem;
  background: #fff;
}

.story-map-input-small {
  max-width: 86px;
}

.module-page-meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.module-page-back {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: #214f8a;
  text-decoration: none;
  font-weight: 600;
}

.draftforge-reference {
  border: 1px solid #c4d3e6;
  border-radius: 10px;
  background: #f5f9ff;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
}

.draftforge-reference h4 {
  margin-bottom: 0.35rem;
}

.draftforge-focus-shell {
  border: 1px solid #c4d3e6;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.5rem 0.6rem;
  margin: 0 0 0.5rem;
}

.draftforge-focus-tabs {
  margin: 0 0 0.35rem;
}

.draftforge-primary-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.45rem;
}

.draftforge-assist-prompts {
  border: 1px solid #d8e3f1;
  border-radius: 10px;
  background: #fcfdff;
  padding: 0.5rem 0.6rem;
  margin: 0 0 0.55rem;
}

.draftforge-assist-prompts .assist-list {
  display: grid;
  gap: 0.4rem;
}

.draftforge-assist-prompts .assist-item {
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #fff;
  padding: 0.42rem 0.5rem;
}

.draftforge-assist-prompts .assist-item p {
  margin: 0.18rem 0 0.36rem;
  color: #425d78;
  font-size: 0.82rem;
}

.draftforge-flow-note {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.draftforge-entry-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.55rem;
}

.draftforge-entry-card {
  border: 1px solid #d3deec;
  border-radius: 9px;
  background: #ffffff;
  padding: 0.52rem 0.58rem;
  display: grid;
  gap: 0.28rem;
}

.draftforge-entry-card h5 {
  margin: 0;
  font-size: 0.86rem;
  color: #234361;
}

.draftforge-entry-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #4f6377;
}

.draftforge-reference-injection {
  border: 1px solid #d4e2f1;
  border-radius: 9px;
  background: #ffffff;
  padding: 0.45rem 0.55rem;
  margin: 0 0 0.5rem;
}

.draftforge-ref-line {
  margin: 0.12rem 0;
  font-size: 0.78rem;
  color: #3f5d7b;
}

.all-root-browser {
  margin-top: 0.7rem;
  border: 1px solid #c6d6ea;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.55rem;
  min-width: 0;
}

.all-root-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.all-root-dept-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.all-root-dept-filters .filter-chip.active {
  border-color: #7ea7d6;
  background: #e9f3ff;
  color: #1f4f83;
  font-weight: 700;
}

.all-root-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #35516b;
}

.all-root-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
}

.all-root-layout-controls {
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.all-root-carousel-density {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}

.all-root-carousel-density.active {
  display: inline-flex;
}

.all-root-density-label {
  font-size: 0.8rem;
  color: #35516b;
  font-weight: 600;
}

.all-root-carousel-density-nav {
  display: inline-flex;
  gap: 0.3rem;
  margin-left: 0.2rem;
}

.all-root-carousel-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-inline: 0.25rem;
  overflow: hidden;
}

.all-root-calendar-shell {
  display: none;
  border: 1px solid #d4e1f1;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.5rem;
}

.all-root-calendar-shell.active {
  display: block;
}

.all-root-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.all-root-calendar-toolbar strong {
  min-width: 170px;
  text-align: center;
  color: #284867;
}

.all-root-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.all-root-calendar-header span {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #53708f;
}

.all-root-calendar-grid {
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0.3rem;
}

.all-root-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.all-root-calendar-day {
  border: 1px solid #d4e1f1;
  border-radius: 8px;
  background: #f8fbff;
  min-height: 62px;
  padding: 0.3rem 0.32rem;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 0.15rem;
}

.all-root-calendar-day.in-month {
  background: #fff;
}

.all-root-calendar-day.out-month {
  opacity: 0.58;
}

.all-root-calendar-day.has-events {
  border-color: #9bc0ea;
}

.all-root-calendar-day.activity-low {
  background: #f8fbff;
}

.all-root-calendar-day.activity-mid {
  background: #f1f7ff;
}

.all-root-calendar-day.activity-high {
  background: #e7f1ff;
}

.all-root-calendar-day.active {
  border-color: #3f78b7;
  background: #edf5ff;
}

.calendar-day-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: #34597d;
}

.calendar-day-events {
  font-size: 0.68rem;
  color: #4b6f91;
  line-height: 1.25;
}

.calendar-day-dept-row {
  display: inline-flex;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.calendar-day-dept-row .timeline-dept-chip {
  margin: 0;
  padding: 0.02rem 0.28rem;
  font-size: 0.58rem;
  letter-spacing: 0.01em;
}

.calendar-day-note {
  font-size: 0.7rem;
  color: #5a5f99;
}

.all-root-calendar-detail {
  margin-top: 0.5rem;
  border-top: 1px dashed #d4e1f1;
  padding-top: 0.45rem;
}

.all-root-calendar-detail h6 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #2c4c6c;
}

.all-root-story-context {
  border: 1px solid #d6e4f3;
  border-radius: 8px;
  background: #fbfdff;
  padding: 0.4rem 0.5rem;
  margin: 0 0 0.4rem;
}

.all-root-story-context p {
  margin: 0.14rem 0;
  font-size: 0.78rem;
  color: #345673;
}

.all-root-calendar-event-filters {
  display: inline-flex;
  gap: 0.3rem;
  margin: 0 0 0.35rem;
}

.all-root-calendar-events {
  margin: 0 0 0.45rem;
  padding-left: 1rem;
  color: #3f5f7f;
  font-size: 0.8rem;
}

.all-root-calendar-events li {
  margin: 0.2rem 0;
}

.all-root-calendar-open {
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
}

.timeline-dept-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  margin-right: 0.28rem;
  border: 1px solid #c9d8ea;
  background: #eef4fb;
  color: #345778;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-dept-muse-engine { background: #fff1e8; border-color: #f0c5ab; color: #9a532b; }
.timeline-dept-personasmith { background: #f8ecfb; border-color: #dfbee8; color: #7d3f8f; }
.timeline-dept-realmarchitect { background: #eaf5ff; border-color: #bdd9f4; color: #2f5e94; }
.timeline-dept-plotkrafter { background: #e9f8ef; border-color: #bcdfcc; color: #2f6d4a; }
.timeline-dept-draftforge { background: #fff8e7; border-color: #ead8a8; color: #7d6324; }
.timeline-dept-printprepper { background: #f3ecff; border-color: #d5c2f1; color: #60458f; }
.timeline-dept-shared-ai { background: #edf3fb; border-color: #c8d8ed; color: #3e6086; }

.timeline-at {
  color: #6883a0;
  font-size: 0.72rem;
}

.all-root-calendar-note-label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #35516b;
}

.all-root-calendar-note {
  width: 100%;
  min-height: 84px;
  border: 1px solid #c9dbef;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  font: inherit;
  background: #f8fbff;
  color: #243b55;
}
.all-root-project-log {
  margin-top: 0.55rem;
  border: 1px solid #d4e1f1;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.45rem;
}

.all-root-calendar-details {
  margin-top: 0.5rem;
}

.all-root-calendar-details > summary {
  cursor: pointer;
  font-weight: 700;
  color: #2a4e71;
  margin-bottom: 0.35rem;
}

.all-root-project-log-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.all-root-project-log-toolbar strong {
  color: #274867;
  font-size: 0.82rem;
}

.all-root-project-log-periods {
  display: inline-flex;
  gap: 0.26rem;
  flex-wrap: wrap;
}

.all-root-project-log-window {
  margin: 0.3rem 0 0.35rem;
  color: #456683;
  font-size: 0.76rem;
}

.all-root-project-log-list {
  margin: 0;
  padding-left: 1rem;
  max-height: 260px;
  overflow: auto;
  font-size: 0.78rem;
  color: #335778;
}

.all-root-project-log-list li {
  margin: 0.22rem 0;
  display: grid;
  grid-template-columns: auto auto auto minmax(180px, 1fr) auto;
  gap: 0.28rem;
  align-items: center;
}

.all-root-project-log-date {
  font-weight: 700;
  color: #3d5f81;
}

.all-root-project-log-type {
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #6885a3;
}

.all-root-project-log-title {
  color: #2f4f70;
}

.focus-pulse {
  outline: 2px solid rgba(63, 120, 183, 0.65);
  outline-offset: 2px;
  animation: focusPulse 1.2s ease-out 1;
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 120, 183, 0.45);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(63, 120, 183, 0);
  }
}

.all-root-carousel-index {
  position: absolute;
  right: 2.3rem;
  bottom: 0.05rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #c6d6ea;
  background: rgba(255, 255, 255, 0.88);
  color: #35516b;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.all-root-grid.carousel {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 2rem 0.45rem;
  scroll-snap-type: x mandatory;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.all-root-grid.carousel.carousel-one .all-root-card {
  flex: 0 0 min(540px, 92%);
  max-width: 92%;
  scroll-snap-align: center;
  min-height: 180px;
}

.all-root-grid.carousel.carousel-three .all-root-card {
  flex: 0 0 min(320px, calc((100% - 1.3rem) / 3));
  min-width: 260px;
  scroll-snap-align: start;
  min-height: 180px;
}

.all-root-grid.carousel .all-root-card {
  min-height: 180px;
}

.all-root-card {
  border: 1px solid #cfdceb;
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.6rem;
  display: grid;
  gap: 0.28rem;
  min-height: 150px;
  max-height: 460px;
  overflow: hidden;
  cursor: pointer;
}

.all-root-card[draggable="true"] {
  cursor: grab;
}

.all-root-head {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
}

.all-root-dept {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5d7696;
  font-weight: 700;
}

.all-root-time {
  font-size: 0.72rem;
  color: #6a8098;
}

.all-root-card h5 {
  margin: 0;
  font-size: 0.93rem;
  color: #24384f;
}

.all-root-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #4f6377;
}

.all-root-preview-scroll {
  max-height: 132px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.all-root-pill-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.2rem;
}

.all-root-select-row {
  margin: 0;
}

.all-root-sublayers {
  margin: 0.2rem 0 0;
  display: grid;
  gap: 0.3rem;
  max-height: 165px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.all-root-sublayer-card {
  border: 1px solid #d7e3f0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.32rem 0.45rem;
}

.all-root-sublayer-card strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: #2e4f74;
  margin-bottom: 0.1rem;
}

.all-root-sublayer-card p {
  margin: 0;
  font-size: 0.76rem;
  color: #4a6178;
}

.draftforge-ref-item {
  border: 1px solid #d6e0ed;
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.35rem;
}

.draftforge-ref-item.master {
  border-color: #d9b36b;
  background: linear-gradient(180deg, #fff9eb 0%, #fff4db 100%);
  box-shadow: 0 0 0 1px rgba(217, 179, 107, 0.2);
}

.draftforge-ref-item.variant {
  border-color: #c7d9f0;
  background: #f7fbff;
}

.draftforge-ref-item.ai {
  border-style: dashed;
}

.draftforge-ref-item strong {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.draftforge-ref-item p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.asset-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: rgba(255, 253, 251, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  height: 240px;
  overflow: hidden;
  scrollbar-gutter: stable;
}

.asset-card:hover {
  overflow: auto;
}

.asset-card h3,
.asset-card p {
  margin-top: 0;
}

.asset-card[draggable="true"] {
  cursor: grab;
}

.asset-card.active {
  border-color: #1e6ad8;
  box-shadow: 0 0 0 1px rgba(30, 106, 216, 0.2);
}

.asset-card-master {
  height: 292px;
  border-color: #d9b36b;
  background: linear-gradient(180deg, #fff9ec 0%, #fff3dd 100%);
  box-shadow: 0 0 0 1px rgba(217, 179, 107, 0.18);
}

.asset-card-variant {
  height: 240px;
}

.asset-card-ai {
  height: 224px;
  border-style: dashed;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.asset-edit-row {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.asset-edit-row input,
.asset-edit-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
}

.asset-edit-row textarea {
  min-height: 88px;
}

.asset-readonly-note {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.asset-tag {
  margin: 0 0 0.35rem;
  color: #7a4e32;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.asset-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.asset-role-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.asset-tag-row .asset-tag {
  margin: 0;
}

.asset-metrics {
  color: var(--muted);
  font-size: 0.84rem;
}

.graph-canvas {
  width: 100%;
  height: 640px;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.graph-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.5rem;
}

.graph-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #305476;
}

.graph-controls select,
.graph-controls input[type="range"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  background: #fff;
  font: inherit;
}

.graph-controls input[type="range"] {
  width: 110px;
  padding: 0;
}

.graph-check {
  margin-left: 0.2rem;
}

.graph-meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.graph-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0.1rem 0 0.55rem;
}

.graph-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.7);
  color: #274d71;
}

.graph-role-chip .role-icon {
  font-size: 0.78rem;
  line-height: 1;
}

.graph-role-master {
  border-color: rgba(240, 130, 75, 0.45);
  color: #a95727;
}

.graph-role-variant {
  border-color: rgba(73, 129, 196, 0.4);
  color: #315f95;
}

.graph-role-default {
  border-color: rgba(100, 128, 156, 0.4);
  color: #3c5a78;
}

.graph-role-spark {
  border-color: rgba(144, 102, 214, 0.4);
  color: #65439d;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.6rem;
  min-height: 560px;
}

.chat-department-meta {
  border: 1px solid #c8d7ea;
  background: #eef6ff;
  color: #23486f;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.chat-head-idcard {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chat-head-portrait {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(55, 95, 140, 0.4);
  background: #d9e7f6;
  cursor: zoom-in;
}

.chat-head-meta {
  min-width: 0;
}

.chat-head-department,
.chat-head-name,
.chat-head-role {
  margin: 0;
  line-height: 1.25;
}

.chat-head-department {
  font-size: 0.8rem;
  color: #284f7a;
}

.chat-head-name {
  font-size: 0.78rem;
  color: #3e668f;
}

.chat-head-role {
  font-size: 0.74rem;
  color: #4d7399;
}

.chat-thread {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.6rem;
  overflow: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-msg {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: #fff;
}

.chat-msg.user {
  border-color: #d7c9be;
  background: #fff8f2;
}

.chat-msg.assistant {
  border-color: #c9d8ed;
  background: #f2f8ff;
}

.chat-msg.chat-greeting {
  border-style: dashed;
  background: #eef5ff;
}

.chat-content {
  margin: 0;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-content p {
  margin: 0.15rem 0;
}

.chat-content .chat-section {
  margin: 0.2rem 0 0.35rem;
  padding-left: 0.45rem;
  border-left: 2px solid rgba(80, 120, 180, 0.25);
}

.chat-content .chat-section h4 {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  color: #3d5f87;
}

.chat-content .chat-section p {
  margin: 0;
}

.chat-content .chat-bullet-block {
  margin: 0.25rem 0 0.35rem;
  border: 1px dashed rgba(88, 128, 186, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  padding: 0.3rem 0.45rem;
}

.chat-content .chat-bullet-block summary {
  cursor: pointer;
  font-weight: 600;
  color: #3e5f87;
}

.chat-content .chat-bullet-block ul {
  margin: 0.35rem 0 0.1rem 1.05rem;
  padding: 0;
}

.chat-content .chat-bullet-block li {
  margin: 0.2rem 0;
}

.chat-role {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #516579;
}

.chat-time {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-controls {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
}

.chat-commit-hint {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-processing-state {
  margin: -0.15rem 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-processing-state.busy {
  color: var(--accent);
  font-weight: 700;
}

.chat-controls textarea,
.chat-controls input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
  font-family: inherit;
}

.chat-controls textarea {
  min-height: 92px;
}

.chat-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.chat-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chat-msg .chat-actions {
  margin-top: 0.4rem;
}

.chat-quick-options {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.strata-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.strata-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.strata-list li.active {
  border-color: #9bc0f5;
  background: #edf5ff;
}

.strata-tree-list {
  list-style: none;
  margin: 0.2rem 0 0;
  padding-left: 0.55rem;
}

.strata-tree-node {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.4rem 0.5rem;
  text-align: left;
  cursor: pointer;
  margin-bottom: 0.28rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.strata-node-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strata-tree-node.active {
  border-color: #9bc0f5;
  background: #edf5ff;
}

.strata-tree details > summary {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  margin: 0 0 0.2rem 0.2rem;
}

.dev-link {
  display: inline-block;
  margin-top: 0.45rem;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.shell-bottom {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  border: 1px solid var(--dept-shell-border);
  border-radius: 12px;
  background: var(--dept-shell-bg);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  box-shadow: var(--glass-shadow);
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  color: #22384e;
}

.asset-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.asset-editor-modal.docked {
  position: static;
  inset: auto;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

.asset-editor-modal.hidden {
  display: none !important;
}

.asset-editor-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 24, 36, 0.45);
}

.asset-editor-panel {
  position: relative;
  overflow: hidden;
  width: min(1460px, 97vw);
  height: min(920px, 92vh);
  min-width: min(960px, 96vw);
  min-height: min(640px, 90vh);
  max-width: 99vw;
  max-height: 98vh;
  resize: both;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 0.5rem;
}

.asset-editor-modal.docked .asset-editor-panel {
  width: 100%;
  height: calc(100vh - 220px);
  height: calc(100dvh - 220px);
  min-width: 0;
  min-height: 560px;
  max-width: none;
  max-height: none;
  resize: none;
  border-radius: 10px;
}

.asset-editor-panel.max-view {
  width: min(1840px, 99vw);
  height: min(1040px, 98vh);
}

.asset-editor-modal.docked .asset-editor-panel.max-view {
  width: 100%;
  height: calc(100vh - 220px);
}

.asset-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 3;
  background: inherit;
  padding-top: 0.1rem;
}

.asset-editor-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.asset-editor-heading-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.asset-editor-heading-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.92;
}

.asset-editor-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.asset-editor-import-progress {
  display: grid;
  gap: 0.35rem;
  margin: 0.2rem 0 0.25rem;
}

.asset-editor-import-progress.hidden {
  display: none;
}

.asset-editor-import-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #9fb8db;
  background: #eef4ff;
  overflow: hidden;
}

.asset-editor-import-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2b6fd1, #4b8be3);
  transition: width 0.25s ease;
}

.asset-editor-import-progress.success .asset-editor-import-progress-fill {
  background: linear-gradient(90deg, #2f8c4b, #4eb56b);
}

.asset-editor-import-progress.error .asset-editor-import-progress-fill {
  background: linear-gradient(90deg, #a94442, #d46a62);
}

.asset-editor-import-progress-text {
  font-size: 0.8rem;
  color: #3f5573;
}


.asset-editor-mode-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.asset-editor-edit-mode-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c37a2f;
  border-radius: 999px;
  background: #fff0df;
  color: #8a4d14;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.48rem;
}

.asset-editor-panel.edit-mode-active {
  border-color: #d4b18f;
  background:
    linear-gradient(180deg, rgba(255, 244, 232, 0.72), rgba(255, 255, 255, 0.96) 28%),
    #ffffff;
}

.asset-editor-readonly-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.asset-editor-readonly-hint {
  font-size: 0.78rem;
  color: var(--muted);
}


.asset-editor-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 0.7rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.asset-editor-editor-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-height: 0;
  position: relative;
}

.asset-editor-content-wrap {
  grid-row: 2;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.asset-editor-content-stack {
  position: relative;
  min-height: 0;
  height: 100%;
}

.asset-editor-line-numbers {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, #eef4ff 12%);
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
  user-select: none;
  padding: 0.5rem 0.38rem;
}

.asset-editor-line-number {
  display: block;
  white-space: pre;
  height: var(--asset-editor-line-height, 1.5em);
  line-height: var(--asset-editor-line-height, 1.5em);
}

.asset-editor-line-number.active {
  color: #1f4f88;
  font-weight: 700;
}

.asset-editor-editor-column #asset-editor-content,
.asset-editor-editor-column #asset-editor-content-view {
  min-height: 0;
  height: 100%;
  max-height: none;
  grid-row: 1;
  grid-column: 1;
  box-sizing: border-box;
  line-height: 1.5;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0;
}


.asset-editor-side-column {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  transition: box-shadow 180ms ease, border-color 180ms ease, padding 180ms ease;
}


.asset-editor-main.scrolled .asset-editor-side-column {
  box-shadow: -10px 0 18px rgba(15, 31, 56, 0.08);
  border-left: 1px solid color-mix(in srgb, var(--line) 72%, transparent 28%);
  padding-left: 0.45rem;
}

.asset-editor-side-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  background: color-mix(in srgb, var(--panel) 90%, var(--bg) 10%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: visible;
  flex: 0 0 auto;
}

.asset-editor-side-block h4 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


.asset-editor-panel input,
.asset-editor-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
}

.asset-editor-panel textarea {
  min-height: 360px;
  resize: vertical;
}

#asset-editor-content {
  white-space: pre;
  overflow: auto;
  word-break: normal;
  overflow-wrap: normal;
}


.asset-editor-content-view {
  min-height: 360px;
  max-height: none;
  overflow: auto;
  background: #f8fbff;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.asset-editor-panel.overlay-markers .asset-editor-content-view {
  pointer-events: none;
  background: #fff;
}

/* Keep overlay typography metrics identical to textarea while editing.
   Bold marker weights in the readonly layer can shift wrap points and make
   the transparent caret look like it dropped to the next line. */
.asset-editor-panel.overlay-markers .asset-editor-content-marker {
  font-weight: inherit !important;
}

.asset-editor-panel.overlay-markers .marker-overlay-input {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border-color: transparent !important;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #203650;
  font-family: inherit;
  line-height: 1.5;
}

.asset-editor-panel.overlay-markers .marker-overlay-input::selection {
  background: rgba(84, 128, 188, 0.28);
}

.asset-editor-panel.overlay-markers .marker-overlay-input::-moz-selection {
  background: rgba(84, 128, 188, 0.28);
}

.asset-editor-content-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.asset-editor-content-line {
  display: block;
}

.asset-editor-content-marker.lvl-1 {
  color: #2b5f99;
  font-weight: 700;
}

.asset-editor-content-marker.lvl-2 {
  color: #5b47a7;
  font-weight: 700;
}

.asset-editor-content-marker.lvl-3 {
  color: #2f7a4c;
  font-weight: 700;
}

.asset-editor-content-marker.lvl-4 {
  color: #8a5a16;
  font-weight: 700;
}

.asset-editor-content-marker.lvl-5 {
  color: #8b3c63;
  font-weight: 700;
}

.asset-editor-content-marker.lvl-6 {
  color: #2a6770;
  font-weight: 700;
}

.asset-editor-marker-map {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.38rem 0.42rem;
  background: rgba(255, 255, 255, 0.48);
  align-content: flex-start;
  overflow: auto;
  min-height: 84px;
  max-height: 156px;
}

.asset-editor-marker-empty {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.asset-editor-marker-stats {
  margin-bottom: 0.22rem;
  font-weight: 600;
}

.asset-editor-marker-chip {
  border: 1px solid #c5d8ee;
  border-radius: 999px;
  padding: 0.14rem 0.46rem;
  background: #eef5ff;
  color: #355b80;
  font-size: 0.72rem;
  font-weight: 700;
}

.asset-editor-marker-chip.jumped {
  animation: markerJumpFlash 260ms ease-out;
}

.asset-editor-marker-chip.eof {
  border-style: dashed;
  background: #f8f6ff;
  color: #5b47a7;
}

@keyframes markerJumpFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.45);
  }
  45% {
    transform: scale(1.03);
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
  }
}

.asset-editor-marker-chip.lvl-1 {
  background: #edf5ff;
  border-color: #c4daf6;
  color: #2b5f99;
}

.asset-editor-marker-chip.lvl-2 {
  background: #f2efff;
  border-color: #d0c6f4;
  color: #5b47a7;
}

.asset-editor-marker-chip.lvl-3 {
  background: #ecf9f1;
  border-color: #c0e3ce;
  color: #2f7a4c;
}

.asset-editor-marker-chip.lvl-4 {
  background: #fff7ea;
  border-color: #efd9b0;
  color: #8a5a16;
}

.asset-editor-marker-chip.lvl-5 {
  background: #fdeff6;
  border-color: #eac6d9;
  color: #8b3c63;
}

.asset-editor-marker-chip.lvl-6 {
  background: #edf8f8;
  border-color: #bfe1e1;
  color: #2a6770;
}

.asset-editor-marker-chip.code-df {
  box-shadow: inset 0 0 0 2px rgba(112, 77, 196, 0.25);
}

.asset-editor-marker-chip.code-me {
  box-shadow: inset 0 0 0 2px rgba(200, 117, 56, 0.25);
}

.asset-editor-marker-chip.code-ps {
  box-shadow: inset 0 0 0 2px rgba(54, 125, 195, 0.25);
}

.asset-editor-marker-chip.code-ra {
  box-shadow: inset 0 0 0 2px rgba(55, 145, 84, 0.25);
}

.asset-editor-marker-chip.code-pk {
  box-shadow: inset 0 0 0 2px rgba(158, 78, 176, 0.24);
}

.asset-editor-marker-chip.code-pp {
  box-shadow: inset 0 0 0 2px rgba(182, 129, 38, 0.24);
}

.asset-editor-marker-chip.code-pj {
  box-shadow: inset 0 0 0 2px rgba(43, 128, 118, 0.25);
}

.asset-editor-marker-chip.code-sa {
  box-shadow: inset 0 0 0 2px rgba(64, 123, 182, 0.2);
}

.asset-editor-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-height: auto;
  overflow-y: visible;
  overflow-x: hidden;
  min-width: 0;
}

.head-portrait-panel {
  width: min(680px, 92vw);
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.6rem;
}

.head-portrait-title-wrap {
  min-width: 0;
}

.head-portrait-title-wrap h3 {
  margin: 0;
}

.head-portrait-subtitle {
  margin: 0.16rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.head-portrait-modal-image {
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f8ff;
}

.head-portrait-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #f8fbff;
}

.head-portrait-details p {
  margin: 0.18rem 0;
  color: #3c5c7f;
  font-size: 0.86rem;
}

.draft-compare-panel {
  width: min(1200px, 94vw);
  height: min(820px, 90vh);
  grid-template-rows: auto 1fr auto;
}

.draft-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  min-height: 0;
}

.draft-compare-col {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.35rem;
  min-height: 0;
}

.draft-compare-asset-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #2c4765;
  background: #fff;
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  -webkit-appearance: menulist;
  appearance: auto;
}

.draft-compare-hidden-title {
  display: none;
}

.draft-compare-col h4 {
  margin: 0;
  font-size: 0.9rem;
  color: #2c4765;
}

.draft-compare-col textarea {
  width: 100%;
  min-height: 0;
  height: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.6rem;
  font-family: inherit;
  line-height: 1.45;
}

.draft-compare-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.5rem 0.55rem;
}

.draft-compare-preview-wrap h4 {
  margin: 0 0 0.3rem;
  font-size: 0.86rem;
  color: #38597d;
}

.draft-compare-diff-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: 160px;
  overflow: auto;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.76rem;
}

.diff-line {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem;
  border-bottom: 1px dashed rgba(180, 196, 216, 0.55);
}

.diff-line:last-child {
  border-bottom: 0;
}

.diff-line.add {
  background: #eaf9ef;
}

.diff-line.remove {
  background: #ffefef;
}

.diff-line.context {
  background: #f7fbff;
}

.diff-marker {
  font-weight: 800;
  color: #5a7390;
}

.diff-line.add .diff-marker {
  color: #1e6c42;
}

.diff-line.remove .diff-marker {
  color: #9a2f2f;
}

.diff-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.draft-snapshot-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.draft-snapshot-controls label {
  font-size: 0.8rem;
  color: var(--muted);
}

.draft-snapshot-controls select {
  min-width: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
  background: #fff;
  color: inherit;
}

.draft-cast-controls {
  display: grid;
  gap: 0.3rem;
  margin: 0.45rem 0 0.35rem;
}

.draft-cast-controls label {
  font-size: 0.8rem;
  color: var(--muted);
}

.onboarding-panel {
  width: min(760px, 92vw);
  height: auto;
  grid-template-rows: auto auto auto 1fr auto;
}

.onboarding-progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--theme-field-border, #e4ecf8);
  overflow: hidden;
}

.onboarding-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6a88f4, #7f5ee8);
  transition: width 180ms ease;
}

.onboarding-body {
  border: 1px solid var(--theme-field-border, var(--line));
  border-radius: 10px;
  padding: 0.8rem;
  background: var(--theme-field-bg, #f8fbff);
  color: var(--theme-field-ink, inherit);
}

.onboarding-body h4 {
  margin: 0 0 0.4rem;
}

.onboarding-body p {
  margin: 0.25rem 0;
  color: var(--theme-field-ink, #3b5778);
}

#export-preview-content {
  overflow: auto;
  min-height: 380px;
  max-height: 62vh;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 84%, #ffffff 16%);
  padding: 0.7rem;
}

#export-preview-format,
#export-preview-size {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, #ffffff 12%);
  color: inherit;
  padding: 0.34rem 0.46rem;
}

.export-preview-pages {
  display: grid;
  gap: 0.7rem;
}

.export-preview-page {
  border: 1px solid color-mix(in srgb, var(--line) 86%, #ffffff 14%);
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
}

.export-preview-page-label {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.export-preview-page-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}

.import-detect-review-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.55rem;
  overflow: auto;
  min-height: 0;
  max-height: 52vh;
}

.import-detect-review-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.import-detect-review-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.5rem;
}

.import-detect-review-group:last-child {
  margin-bottom: 0;
}

.import-detect-review-group h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: #2c4765;
}

.import-detect-review-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  border: 1px solid #d8e2f1;
  border-radius: 8px;
  background: #fbfdff;
  padding: 0.38rem 0.45rem;
  margin-bottom: 0.35rem;
}

.import-detect-review-item:last-child {
  margin-bottom: 0;
}

.import-detect-review-item strong {
  color: #264769;
}

.import-detect-review-item-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@keyframes onboardingFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(90, 134, 255, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(90, 134, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(90, 134, 255, 0);
  }
}

.onboarding-focus-target {
  position: relative;
  z-index: 1150;
  outline: 2px solid rgba(74, 127, 255, 0.85) !important;
  outline-offset: 2px;
  border-radius: 10px;
  animation: onboardingFocusPulse 1.2s ease-out infinite;
}

.onboarding-focus-target[data-onboarding-focus]::after {
  content: attr(data-onboarding-focus);
  position: absolute;
  top: -12px;
  left: -12px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4a7fff, #6c5ce7);
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(31, 67, 153, 0.35);
  pointer-events: none;
}

.asset-editor-arc-current {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border: 1px dashed #c4d5e8;
  border-radius: 10px;
  background: #f4f8ff;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.asset-editor-arc-current.lvl-1 {
  background: #edf5ff;
  border-color: #c4daf6;
  color: #2b5f99;
}

.asset-editor-arc-current.lvl-2 {
  background: #f2efff;
  border-color: #d0c6f4;
  color: #5b47a7;
}

.asset-editor-arc-current.lvl-3 {
  background: #ecf9f1;
  border-color: #c0e3ce;
  color: #2f7a4c;
}

.asset-editor-arc-current.lvl-4 {
  background: #fff7ea;
  border-color: #efd9b0;
  color: #8a5a16;
}

.asset-editor-arc-current.lvl-5 {
  background: #fdeff6;
  border-color: #eac6d9;
  color: #8b3c63;
}

.asset-editor-arc-current.lvl-6 {
  background: #edf8f8;
  border-color: #bfe1e1;
  color: #2a6770;
}

.asset-editor-arc-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  min-width: 0;
}

.asset-editor-arc-btn {
  border-color: #9cb7d9;
  color: #2d537f;
  background: #f1f7ff;
  width: 100%;
  text-align: left;
  white-space: normal;
  line-height: 1.2;
  min-height: 30px;
  font-size: 0.78rem;
  padding: 0.2rem 0.38rem;
}

#asset-editor-insert-current-tag {
  width: 100%;
  text-align: left;
  min-height: 32px;
  font-size: 0.82rem;
  padding: 0.28rem 0.45rem;
}

#asset-editor-marker-tools-toggle {
  width: 100%;
  text-align: left;
}

.asset-editor-line-numbers.hidden {
  display: none;
}

#asset-editor-current-title {
  width: 100%;
  min-height: 32px;
  padding: 0.3rem 0.44rem;
  font-size: 0.8rem;
}

.asset-editor-arc-btn.lvl-1 {
  background: #edf5ff;
  border-color: #c4daf6;
  color: #2b5f99;
}

.asset-editor-arc-btn.lvl-2 {
  background: #f2efff;
  border-color: #d0c6f4;
  color: #5b47a7;
}

.asset-editor-arc-btn.lvl-3 {
  background: #ecf9f1;
  border-color: #c0e3ce;
  color: #2f7a4c;
}

.asset-editor-arc-btn.lvl-4 {
  background: #fff7ea;
  border-color: #efd9b0;
  color: #8a5a16;
}

.asset-editor-arc-btn.lvl-5 {
  background: #fdeff6;
  border-color: #eac6d9;
  color: #8b3c63;
}

.asset-editor-arc-btn.lvl-6 {
  background: #edf8f8;
  border-color: #bfe1e1;
  color: #2a6770;
}

.asset-editor-arc-btn.code-df,
.asset-editor-arc-current.code-df,
#asset-editor-insert-current-tag.code-df {
  box-shadow: inset 0 0 0 2px rgba(112, 77, 196, 0.24);
}

.asset-editor-arc-btn.code-me,
.asset-editor-arc-current.code-me,
#asset-editor-insert-current-tag.code-me {
  box-shadow: inset 0 0 0 2px rgba(200, 117, 56, 0.24);
}

.asset-editor-arc-btn.code-ps,
.asset-editor-arc-current.code-ps,
#asset-editor-insert-current-tag.code-ps {
  box-shadow: inset 0 0 0 2px rgba(54, 125, 195, 0.24);
}

.asset-editor-arc-btn.code-ra,
.asset-editor-arc-current.code-ra,
#asset-editor-insert-current-tag.code-ra {
  box-shadow: inset 0 0 0 2px rgba(55, 145, 84, 0.24);
}

.asset-editor-arc-btn.code-pk,
.asset-editor-arc-current.code-pk,
#asset-editor-insert-current-tag.code-pk {
  box-shadow: inset 0 0 0 2px rgba(158, 78, 176, 0.24);
}

.asset-editor-arc-btn.code-pp,
.asset-editor-arc-current.code-pp,
#asset-editor-insert-current-tag.code-pp {
  box-shadow: inset 0 0 0 2px rgba(182, 129, 38, 0.24);
}

.asset-editor-arc-btn.code-pj,
.asset-editor-arc-current.code-pj,
#asset-editor-insert-current-tag.code-pj {
  box-shadow: inset 0 0 0 2px rgba(43, 128, 118, 0.24);
}

.asset-editor-arc-btn.code-sa,
.asset-editor-arc-current.code-sa,
#asset-editor-insert-current-tag.code-sa {
  box-shadow: inset 0 0 0 2px rgba(64, 123, 182, 0.2);
}

.toast-stack {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1300;
  display: grid;
  gap: 0.45rem;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  border: 1px solid #cadbef;
  background: #eef4fb;
  color: #20476f;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  box-shadow: 0 6px 14px rgba(21, 47, 74, 0.2);
}

.toast.success {
  border-color: #bfe5cc;
  background: #eaf9ef;
  color: #1f5f3a;
}

.toast.error {
  border-color: #f3c2c2;
  background: #ffefef;
  color: #8f2424;
}

@media (max-width: 1220px) {
  .shell-main {
    grid-template-columns: 1fr !important;
  }

  .pane-resizer,
  .pane-toggle {
    display: none !important;
  }

  #left-pane-resizer,
  #right-pane-resizer {
    display: none !important;
  }

  .left-rail {
    display: block !important;
  }

  .right-rail {
    display: none !important;
  }

  .shell-top {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "meta"
      "center";
  }

  .shell-bottom {
    grid-template-columns: 1fr 1fr;
  }

  .graph-canvas {
    height: 380px;
  }

  .plot-beat-board-canvas {
    height: 330px;
  }

  .story-map-table {
    display: block;
    overflow-x: auto;
  }
}


@media (max-width: 980px) {
  .studio-shell {
    min-height: 100dvh;
    padding: 0.6rem;
    gap: 0.55rem;
  }

  .left-rail,
  .workspace,
  .right-rail {
    border-radius: 12px;
    padding: 0.65rem;
  }

  .left-rail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.12rem;
  }

  .left-rail-tabs .mode-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .asset-editor-panel {
    width: min(1120px, 97vw);
    height: min(860px, 93vh);
    height: min(860px, 93dvh);
    min-width: 0;
    min-height: 0;
    resize: none;
  }

  .asset-editor-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .asset-editor-side-column {
    position: static;
    top: auto;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
  }

  .asset-editor-main.scrolled .asset-editor-side-column {
    box-shadow: none;
    border-left: 0;
    padding-left: 0;
  }

  .asset-editor-side-block {
    max-height: none;
  }

  .asset-editor-arc-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-detect-review-panel {
    min-width: 0;
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .studio-shell {
    gap: 0.55rem;
    padding: 0.5rem;
  }

  .shell-top {
    gap: 0.55rem;
    padding: 0.55rem;
    border-radius: 12px;
  }

  .top-imprint-btn {
    font-size: 1.32rem;
  }

  .department-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }

  .department-tabs .tab-btn {
    flex: 0 0 auto;
  }

  .workspace-head {
    align-items: flex-start;
  }

  .workspace-modes {
    width: 100%;
    gap: 0.35rem;
  }

  .workspace-modes .mode-btn,
  .workspace-modes a.mode-btn {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
    text-align: center;
  }

  .shell-bottom {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.45rem 0.55rem;
  }

  .asset-editor-panel {
    width: 98vw;
    height: 94vh;
    height: 94dvh;
    min-width: 0;
    min-height: 0;
    max-width: 98vw;
    max-height: 94vh;
    max-height: 94dvh;
    resize: none;
    border-radius: 10px;
    overflow: auto;
  }

  .asset-editor-modal.docked .asset-editor-panel,
  .asset-editor-modal.docked .asset-editor-panel.max-view {
    height: calc(100vh - 142px);
    height: calc(100dvh - 142px);
    min-height: 340px;
    max-height: none;
    overflow: auto;
  }

  .asset-editor-head {
    gap: 0.35rem;
    position: static;
  }

  .asset-editor-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .asset-editor-head-actions .mode-btn {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
  }

  .asset-editor-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  .asset-editor-side-column {
    position: static;
    top: auto;
    max-height: 38vh;
    max-height: 38dvh;
    overflow-y: auto;
  }
}

@media (max-width: 560px) {
  .shell-top {
    padding: 0.5rem;
    border-radius: 10px;
  }

  .top-chip {
    font-size: 0.74rem;
    padding: 0.28rem 0.5rem;
  }

  .top-link {
    font-size: 0.74rem;
    padding: 0.28rem 0.5rem;
  }

  .workspace-modes .mode-btn,
  .workspace-modes a.mode-btn,
  .asset-editor-head-actions .mode-btn {
    flex: 1 1 100%;
  }

  .shell-bottom {
    grid-template-columns: 1fr;
  }

  .asset-editor-side-column {
    max-height: 44vh;
    max-height: 44dvh;
  }

  .asset-editor-content-wrap {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .asset-editor-line-numbers {
    font-size: 0.72rem;
    padding: 0.5rem 0.3rem;
  }

  .asset-editor-mode-row {
    align-items: flex-start;
    gap: 0.4rem;
  }

  .asset-editor-readonly-toggle {
    width: 100%;
  }

  .asset-editor-readonly-hint {
    width: 100%;
    font-size: 0.78rem;
  }

  .asset-editor-editor-column #asset-editor-content,
  .asset-editor-editor-column #asset-editor-content-view {
    min-height: 34dvh;
  }
}




.all-root-project-log-open {
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
}

@media (max-width: 1080px) {
  .shell-top {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "meta"
      "center";
  }
}

@media (max-width: 980px) {
  .all-root-project-log-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    align-items: start;
  }
}
