:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe4ef;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --teal: #0f766e;
  --cyan: #0891b2;
  --gold: #b45309;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.1);
  --shadow-strong: 0 28px 88px rgba(15, 23, 42, 0.16);
  --radius: 8px;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent 300px),
    linear-gradient(135deg, #f8fafc 0%, #eef6f5 50%, #f7f3ea 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--blue-dark);
  background: rgba(37, 99, 235, 0.08);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
}

.app-header {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid rgba(191, 219, 254, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.9)),
    rgba(248, 250, 252, 0.9);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.auto-hide-header {
  --auto-header-height: 72px;
  transition:
    margin-top 0.36s ease,
    opacity 0.24s ease,
    transform 0.36s ease,
    box-shadow 0.24s ease;
  will-change: margin-top, transform, opacity;
}

.is-header-collapsed .auto-hide-header {
  margin-top: calc(-1 * var(--auto-header-height));
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  box-shadow: none;
}

.header-hover-sensor {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  left: 0;
  height: 18px;
  pointer-events: none;
}

.is-header-collapsed .header-hover-sensor {
  pointer-events: auto;
}

.workflow-comfy-shell.auto-hide-header-shell {
  transition: grid-template-rows 0.36s ease;
}

.is-header-collapsed .workflow-comfy-shell.auto-hide-header-shell {
  grid-template-rows: 0 minmax(0, 1fr);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.25);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.tool-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-button {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.22);
}

.top-actions [data-permission-button="nav.generate"] {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
}

.top-actions [data-permission-button="nav.generate"]:hover {
  border-color: transparent;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.34);
}

.secondary-button,
.ghost-button,
.tool-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.ghost-button.active,
.secondary-button:hover,
.ghost-button:hover,
.tool-button:hover {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.tool-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.catalog-layout {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 22px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

.student-layout {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 22px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

.student-sidebar,
.student-workspace,
.student-assignment-card,
.answer-question-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.student-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.student-sidebar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.student-sidebar p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.student-profile-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(37, 99, 235, 0.06);
}

.student-profile-card strong,
.student-profile-card small {
  display: block;
}

.student-profile-card small {
  color: var(--muted);
  font-weight: 800;
}

.student-workspace {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.student-assignment-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.student-assignment-card span,
.student-assignment-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.student-assignment-card h3,
.student-assignment-summary h2,
.answer-question-card h3 {
  margin: 0;
}

.student-assignment-card p,
.student-assignment-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.student-assignment-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.student-assignment-card dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.student-answer-panel {
  display: grid;
  gap: 16px;
}

.student-assignment-summary {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(37, 99, 235, 0.06);
}

.summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-pills span,
.answer-question-head span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.1);
}

#student-answer-fields,
#invite-answer-fields {
  display: grid;
  gap: 14px;
}

.answer-question-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  box-shadow: none;
}

.answer-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.answer-question-head strong {
  color: var(--teal);
}

.answer-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.answer-question-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.answer-question-card textarea,
.student-answer-panel input,
.student-answer-panel textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}

.attachment-upload-field {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(37, 99, 235, 0.32);
  border-radius: 10px;
  padding: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.05);
}

.attachment-upload-field input[type="file"] {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.attachment-upload-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.catalog-toolbar {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 24px;
  align-items: end;
  overflow: hidden;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(191, 219, 254, 0.76);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.9) 48%, rgba(240, 253, 250, 0.92)),
    #fff;
  box-shadow: var(--shadow-strong);
}

.catalog-toolbar::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 54%, rgba(37, 99, 235, 0.08) 54% 64%, transparent 64%),
    linear-gradient(145deg, transparent 0 72%, rgba(180, 83, 9, 0.08) 72% 82%, transparent 82%);
  content: "";
  pointer-events: none;
}

.catalog-toolbar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(22px, 2.5vw, 32px);
}

.toolbar-copy p:last-child,
.toolbar-lead,
.section-head p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.toolbar-lead {
  max-width: 720px;
  font-size: 16px;
}

.library-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.library-hero-stats span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.72);
}

.library-hero-stats strong {
  color: var(--blue-dark);
}

.search-panel,
.filter-panel,
.course-card,
.empty-state,
.studio-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.search-panel {
  padding: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.search-panel label,
.filter-group label,
.filter-label,
.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.search-box span {
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.search-box input,
.filter-group select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.filter-panel {
  align-self: start;
  padding: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
}

.filter-group + .filter-group,
.filter-group + .secondary-button {
  margin-top: 18px;
}

.filter-group select,
.field input,
.field select,
.field textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.field textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

.stat-stack {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stat-stack strong {
  color: var(--blue-dark);
}

.course-section {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.course-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 420px;
  color: var(--ink);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.course-card:hover {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.course-card-accent {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--gold));
}

.cover-frame {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 118, 110, 0.14)),
    #f8fafc;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-frame iframe {
  width: 200%;
  height: 200%;
  border: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: 0 0;
}

.preview-trigger {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.58);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(14px);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.preview-trigger:hover,
.preview-trigger:focus-visible,
.cover-frame.is-previewing .preview-trigger {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
}

.preview-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.preview-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
}

.cover-frame.is-previewing::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 5px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.55);
  content: "自动预览中";
  backdrop-filter: blur(12px);
}

.cover-fallback {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.cover-fallback strong {
  max-width: 18ch;
  color: var(--blue-dark);
  font-size: 24px;
  line-height: 1.18;
}

.course-body {
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto auto auto 1fr;
  padding: 18px;
}

.course-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.course-card-kicker span {
  color: var(--blue-dark);
}

.course-card-kicker small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
}

.course-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.course-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-meta span,
.tag-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-strong);
}

.course-meta span:first-child {
  color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

.course-description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 48px;
  color: var(--muted);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-open {
  align-self: end;
  justify-self: start;
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  align-self: end;
  padding-top: 4px;
}

.auth-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-user {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.08);
}

.auth-widget .primary-button {
  min-width: 88px;
}

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.edit-offline-overlay {
  position: fixed;
  z-index: 160;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 36%, rgba(37, 99, 235, 0.14), transparent 34%),
    rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(12px);
}

.edit-offline-dialog {
  display: grid;
  width: min(580px, calc(100vw - 48px));
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96)),
    #fff;
  box-shadow: 0 34px 110px rgba(15, 23, 42, 0.32);
}

.edit-offline-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.28);
}

.edit-offline-content {
  min-width: 0;
}

.edit-offline-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.08);
}

.edit-offline-content h2 {
  margin: 10px 0 8px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.16;
}

.edit-offline-content p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}

.edit-offline-detail {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
}

.edit-offline-detail div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
}

.edit-offline-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.edit-offline-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.edit-offline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.auth-modal {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.58), rgba(30, 64, 175, 0.34)),
    rgba(15, 23, 42, 0.5);
}

.app-modal {
  display: grid;
  width: min(920px, 100%);
  max-height: min(840px, calc(100vh - 36px));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.26);
}

.auth-modal .app-modal {
  width: min(860px, 100%);
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.98);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.auth-modal .modal-head {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.92)),
    #fff;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-body {
  overflow: auto;
  padding: 18px;
}

.auth-modal .modal-body {
  padding: 0;
}

.auth-form,
.course-editor-form {
  display: grid;
  gap: 14px;
}

.auth-form-card {
  grid-template-columns: minmax(238px, 0.82fr) minmax(300px, 1fr);
  gap: 0;
  min-height: 430px;
}

.auth-intro {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  color: #f8fafc;
  background:
    linear-gradient(150deg, rgba(30, 64, 175, 0.94), rgba(15, 118, 110, 0.92)),
    #1e40af;
}

.auth-kicker {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

.auth-intro h3 {
  max-width: 12ch;
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
}

.auth-intro p {
  margin: 0;
  color: rgba(248, 250, 252, 0.82);
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 8px;
}

.auth-benefits span {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #eff6ff;
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
}

.auth-fields {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(22px, 4vw, 36px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
    #fff;
}

.auth-form label,
.course-editor-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form-card label {
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}

.auth-form-card label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-form input,
.auth-form textarea,
.auth-form select,
.course-editor-form input,
.course-editor-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.auth-form-card input {
  min-height: 50px;
  border-color: rgba(37, 99, 235, 0.18);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.auth-form textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.rich-editor {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rich-editor-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.rich-editor-source {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.rich-editor-preview {
  min-height: 64px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.rich-editor-preview p {
  margin: 0 0 8px;
}

.rich-editor-preview p:last-child {
  margin-bottom: 0;
}

.rich-editor-preview code {
  border-radius: 4px;
  padding: 1px 4px;
  background: #e2e8f0;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-textarea {
  min-height: min(52vh, 520px);
  padding: 12px;
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.wide-modal .app-modal {
  width: min(1180px, 100%);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state {
  padding: 28px;
  text-align: center;
}

.hidden {
  display: none !important;
}

body[data-page="workflow-comfyui"] {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #050812;
  color: #eef4ff;
}

.comfy-adapter-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
  background:
    radial-gradient(circle at 18% 12%, rgba(45, 120, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #070b15 0%, #0a1222 46%, #061513 100%);
}

.comfy-adapter-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(122, 154, 204, 0.22);
  background: rgba(8, 12, 23, 0.9);
}

.comfy-adapter-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  color: #f8fbff;
  text-decoration: none;
}

.comfy-adapter-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #061018;
  background: linear-gradient(135deg, #66f0da, #6aa7ff);
}

.comfy-adapter-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.comfy-adapter-brand small {
  display: block;
  margin-top: 2px;
  color: #94a8c5;
  font-size: 12px;
}

.comfy-adapter-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.comfy-adapter-nav a {
  color: #c9d8ef;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.comfy-adapter-nav a:hover {
  color: #ffffff;
  background: rgba(111, 146, 209, 0.16);
}

.comfy-adapter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comfy-adapter-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.comfy-adapter-panel {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(122, 154, 204, 0.22);
  background: rgba(8, 13, 24, 0.9);
  padding: 16px;
}

.comfy-adapter-section {
  border-bottom: 1px solid rgba(122, 154, 204, 0.16);
  padding: 14px 0;
}

.comfy-adapter-section:first-child {
  padding-top: 0;
}

.comfy-adapter-section h1 {
  margin: 4px 0 8px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.muted-copy {
  margin: 0;
  color: #9fb1cc;
  line-height: 1.7;
  font-size: 13px;
}

.comfy-adapter-status {
  margin-top: 12px;
  border: 1px solid rgba(122, 154, 204, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(11, 19, 36, 0.88);
  color: #cddbf2;
  font-size: 13px;
}

.comfy-adapter-status[data-tone="success"] {
  border-color: rgba(77, 220, 170, 0.42);
  color: #91f0d2;
}

.comfy-adapter-status[data-tone="running"] {
  border-color: rgba(245, 192, 92, 0.42);
  color: #ffd98a;
}

.comfy-adapter-status[data-tone="error"] {
  border-color: rgba(255, 116, 116, 0.48);
  color: #ffb5b5;
}

.section-heading-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #edf4ff;
}

.section-heading-inline span {
  color: #8ea4c5;
  font-size: 12px;
}

.comfy-default-node-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.comfy-default-node-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas: "index title" "index meta";
  gap: 2px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(96, 132, 190, 0.24);
  border-radius: 8px;
  background: rgba(9, 17, 32, 0.88);
}

.comfy-default-node-list span {
  grid-area: index;
  color: #69d6f8;
  font-weight: 800;
}

.comfy-default-node-list strong {
  grid-area: title;
  color: #f6fbff;
  font-size: 13px;
}

.comfy-default-node-list small {
  grid-area: meta;
  color: #8fa3c3;
  font-size: 12px;
}

.comfy-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.comfy-category-grid span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(16, 30, 53, 0.86);
  border: 1px solid rgba(102, 155, 232, 0.2);
}

.comfy-category-grid strong {
  color: #edf4ff;
  font-size: 13px;
}

.comfy-category-grid small {
  color: #91a6c8;
  font-size: 12px;
}

.comfy-security-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #aebfda;
  line-height: 1.8;
  font-size: 13px;
}

.comfy-example-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 10px;
}

.comfy-graph-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}

body[data-page="workflow-launch"] {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(20, 184, 166, 0.18), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef6ff 46%, #f6fff9 100%);
}

.workflow-launch-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.workflow-launch-card {
  display: grid;
  width: min(720px, 100%);
  gap: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 34px 88px rgba(15, 23, 42, 0.14);
}

.workflow-launch-card .brand-mark {
  width: 54px;
  height: 54px;
}

.workflow-launch-card h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.workflow-launch-card p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.75;
}

.workflow-launch-status {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  font-weight: 800;
}

.workflow-launch-status[data-tone="success"] {
  border-color: rgba(22, 163, 74, 0.22);
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}

.workflow-launch-status[data-tone="warning"] {
  border-color: rgba(217, 119, 6, 0.24);
  color: #b45309;
  background: rgba(217, 119, 6, 0.09);
}

.workflow-launch-status[data-tone="error"] {
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.workflow-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.comfy-example-actions select,
.comfy-node-search input,
.comfy-node-search select {
  min-width: 0;
  border: 1px solid rgba(116, 151, 210, 0.28);
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.92);
  color: #f2f7ff;
  padding: 8px 10px;
  font: inherit;
}

.comfy-node-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-bottom: 10px;
}

.comfy-node-library {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.comfy-node-card {
  border: 1px solid rgba(96, 132, 190, 0.24);
  border-radius: 8px;
  background: rgba(9, 17, 32, 0.88);
  padding: 10px;
}

.comfy-node-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.comfy-node-card strong {
  color: #f6fbff;
  font-size: 13px;
}

.comfy-node-card em {
  color: #69d6f8;
  font-style: normal;
  font-size: 11px;
}

.comfy-node-card p {
  margin: 0 0 8px;
  color: #aebfda;
  line-height: 1.55;
  font-size: 12px;
}

.comfy-node-card dl {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px 8px;
  margin: 0;
  color: #8fa3c3;
  font-size: 11px;
}

.comfy-node-card dt {
  color: #6f86ad;
}

.comfy-node-card dd {
  margin: 0;
}

.comfy-node-card small {
  display: block;
  margin-top: 7px;
  color: #ffd98a;
  line-height: 1.45;
}

.comfy-error-guide {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(116, 151, 210, 0.22);
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.88);
  color: #aebfda;
  line-height: 1.6;
  font-size: 13px;
}

.comfy-error-guide[data-tone="error"] {
  border-color: rgba(255, 116, 116, 0.48);
  color: #ffb5b5;
}

.comfy-error-guide strong {
  display: block;
  color: #f2f7ff;
  margin-bottom: 4px;
}

.comfy-run-form {
  display: grid;
  gap: 10px;
}

.comfy-run-form label {
  display: grid;
  gap: 6px;
  color: #cbd9ee;
  font-size: 12px;
}

.comfy-run-form input,
.comfy-run-form textarea {
  width: 100%;
  border: 1px solid rgba(116, 151, 210, 0.28);
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.92);
  color: #f2f7ff;
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}

.comfy-run-form input:focus,
.comfy-run-form textarea:focus {
  outline: 2px solid rgba(87, 179, 255, 0.34);
  border-color: rgba(99, 191, 255, 0.58);
}

.comfy-run-result {
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(116, 151, 210, 0.22);
  background: rgba(8, 15, 28, 0.88);
  color: #aebfda;
  line-height: 1.65;
  font-size: 13px;
}

.comfy-run-result strong,
.comfy-run-result span {
  display: block;
}

.comfy-run-result strong {
  color: #f2f7ff;
  margin-bottom: 4px;
}

.comfy-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.comfy-adapter-frame-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px 1fr;
  background: #05070d;
}

.comfy-frame-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(122, 154, 204, 0.18);
  background: rgba(5, 8, 14, 0.88);
  color: #91a6c8;
  font-size: 12px;
}

.comfy-frame-toolbar div {
  display: flex;
  align-items: center;
  gap: 8px;
}

#comfyui-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #080b12;
}

.comfy-courseware-preview {
  position: absolute;
  top: 64px;
  right: 18px;
  bottom: 18px;
  width: min(760px, calc(100% - 36px));
  display: grid;
  grid-template-rows: 44px 1fr;
  border: 1px solid rgba(116, 151, 210, 0.32);
  border-radius: 10px;
  overflow: hidden;
  background: #08101d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  z-index: 4;
}

.comfy-courseware-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(116, 151, 210, 0.22);
  background: rgba(7, 12, 22, 0.96);
}

.comfy-courseware-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.comfy-frame-empty {
  position: absolute;
  inset: 44px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9fb1cc;
  background: #05070d;
  pointer-events: none;
}

.comfy-frame-empty strong {
  color: #edf4ff;
  font-size: 18px;
}

@media (max-width: 980px) {
  body[data-page="workflow-comfyui"] {
    overflow: auto;
  }

  .comfy-adapter-shell {
    min-height: 100vh;
    grid-template-rows: auto 1fr;
  }

  .comfy-adapter-topbar,
  .comfy-adapter-actions,
  .comfy-adapter-nav {
    flex-wrap: wrap;
  }

  .comfy-adapter-layout {
    grid-template-columns: 1fr;
  }

  .comfy-adapter-panel {
    max-height: none;
  }

  .comfy-adapter-frame-wrap {
    min-height: 680px;
  }

  .comfy-example-actions,
  .comfy-node-search {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .filter-group + .filter-group,
  .filter-group + .secondary-button {
    margin-top: 0;
  }

  .auth-form-card {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 240px;
  }

  .auth-intro h3 {
    max-width: 16ch;
  }
}

@media (max-width: 680px) {
  .app-header,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions a,
  .top-actions button,
  .auth-widget {
    flex: 1 1 0;
  }

  .catalog-layout {
    padding: 14px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar,
  .filter-panel,
  .course-card {
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
  }

  .library-hero-stats {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-modal .app-modal {
    max-height: calc(100vh - 24px);
  }

  .auth-intro,
  .auth-fields {
    padding: 22px;
  }
}

body[data-page="studio"],
body[data-page="workflow-editor"] {
  overflow: hidden;
}

.studio-shell {
  height: 100vh;
  overflow: hidden;
}

.studio-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 320px minmax(520px, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(210px, 30vh);
  gap: 14px;
  padding: 14px;
}

.studio-panel,
.graph-panel,
.preview-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.node-panel,
.settings-panel,
.workflow-picker-panel {
  padding: 18px;
}

.node-panel,
.workflow-picker-panel {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.node-panel h1,
.workflow-picker-panel h1 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.1;
}

.node-panel p:not(.eyebrow),
.workflow-picker-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.workflow-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.workflow-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.node-status-list {
  display: grid;
  overflow: auto;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.node-status-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-strong);
}

.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.node-status-item[data-status="running"] .node-dot {
  background: var(--amber);
}

.node-status-item[data-status="success"] .node-dot {
  background: var(--green);
}

.node-status-item[data-status="completed"] .node-dot {
  background: var(--green);
}

.node-status-item[data-status="failed"] .node-dot {
  background: var(--red);
}

.node-status-item small {
  color: var(--muted);
  font-weight: 800;
}

.graph-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head.compact {
  margin-bottom: 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.1);
}

.workflow-run-button {
  min-width: 118px;
  box-shadow: none;
}

.workflow-run-button[data-status="pending"] {
  color: var(--blue-dark);
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.1);
}

.workflow-run-button[data-status="success"] {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--teal));
}

.workflow-run-button[data-status="failed"] {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #b91c1c);
}

#graph-canvas {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border-radius: 8px;
  background: #111827;
}

.graph-canvas-actions {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

body[data-page="studio"] .graph-canvas-actions {
  display: none;
}

.graph-canvas-actions button {
  min-height: 36px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
}

.graph-panel.is-readonly #graph-canvas {
  cursor: grab;
  user-select: none;
}

.graph-panel.is-readonly #graph-canvas:active {
  cursor: grabbing;
}

.graph-lock-layer {
  position: absolute;
  top: 88px;
  right: 14px;
  left: 14px;
  z-index: 4;
  height: 0;
  border-radius: 8px;
  background: transparent;
  pointer-events: none;
}

.graph-panel.is-editable .graph-lock-layer,
.workflow-editor-graph .graph-lock-layer {
  display: none;
}

.graph-lock-card {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  width: min(520px, calc(100% - 28px));
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  padding: 14px 16px;
  color: #fff;
  text-align: center;
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(16px);
  opacity: 0.9;
  pointer-events: auto;
  transform: translateX(-50%);
}

.graph-lock-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.graph-lock-card span {
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.65;
}

.graph-fallback {
  position: absolute;
  inset: 76px 14px 14px;
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: #111827;
}

.graph-fallback.is-auto-placeholder {
  display: grid;
  place-items: end center;
  overflow: hidden;
  padding-bottom: 72px;
  background: transparent;
  pointer-events: none;
}

.workflow-auto-placeholder {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  pointer-events: none;
}

.workflow-auto-placeholder-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: min(620px, calc(100vw - 48px));
  min-height: 46px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  padding: 0 18px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(20, 184, 166, 0.14)),
    rgba(8, 13, 22, 0.9);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.workflow-auto-placeholder-inner i {
  color: #60a5fa;
  font-style: normal;
  font-weight: 950;
}

html:not(.auth-ready) [data-permission-button]:not([data-permission-button="nav.courseware"]),
.permission-hidden {
  display: none !important;
}

.permission-settings-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.permission-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.permission-groups-grid {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.permission-group-card {
  display: grid;
  gap: 12px;
  max-height: min(560px, 58vh);
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 10px 14px 14px;
  background: rgba(248, 250, 252, 0.82);
}

.permission-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.permission-group-selector,
.permission-field {
  display: grid;
  gap: 6px;
}

.permission-group-selector {
  cursor: pointer;
}

.permission-group-selector label,
.permission-field {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.permission-group-name,
.permission-group-alias,
.permission-group-desc,
.permission-group-picker {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.permission-group-picker,
.permission-group-name {
  font-weight: 900;
}

.permission-group-desc {
  min-height: 70px;
  resize: vertical;
}

.permission-button-matrix {
  display: grid;
  gap: 12px;
}

.permission-button-matrix section {
  display: grid;
  gap: 8px;
}

.permission-button-matrix h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.permission-check {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.permission-check span {
  font-weight: 800;
}

.permission-check small,
.permission-group-head small {
  color: var(--muted);
}

.fallback-flow {
  display: grid;
  gap: 12px;
}

.fallback-node {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 12px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
}

.settings-panel {
  overflow: auto;
}

.workflow-editor-layout {
  grid-template-columns: 320px minmax(560px, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.workflow-editor-graph {
  min-height: 0;
}

.workflow-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(37, 99, 235, 0.06);
}

.compact-summary {
  margin-top: 14px;
}

.workflow-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workflow-summary strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.workflow-help {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.workflow-help strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
}

.workflow-help p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.output-preview,
.config-preview {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(37, 99, 235, 0.06);
}

.output-preview span,
.config-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.output-preview strong,
.config-preview strong {
  overflow-wrap: anywhere;
  color: var(--blue-dark);
  font-size: 13px;
}

.export-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.export-actions button {
  width: 100%;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px;
}

.preview-panel {
  grid-column: 2 / 3;
}

#preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#quality-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

body[data-page="workflow-editor"] {
  width: 100vw;
  height: 100vh;
  color: #e5e7eb;
  background:
    radial-gradient(circle at 22% 0%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(20, 184, 166, 0.12), transparent 28%),
    #070910;
}

.workflow-comfy-shell {
  display: grid;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  grid-template-rows: 46px minmax(0, 1fr);
  overflow: hidden;
  background: #070910;
}

.workflow-top-tabs {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0 14px;
  background: #0b0f17;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.workflow-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.workflow-tabs {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 4px;
  height: 100%;
}

.workflow-tab {
  height: 34px;
  align-self: end;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 0 16px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.76);
}

.workflow-tab.is-active {
  color: #e5e7eb;
  background: #111827;
}

.workflow-page-links {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 10px;
}

.workflow-page-links a {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

body[data-page="workflow-editor"] .workflow-editor-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 66px 288px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #070910;
}

.workflow-left-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  padding: 12px 8px;
  background: #090d14;
}

.rail-item {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.72);
}

.rail-item.is-active {
  color: #e0f2fe;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(37, 99, 235, 0.22);
}

.workflow-side-panel {
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0;
  padding: 16px;
  background: #0d121b;
  box-shadow: none;
}

.workflow-side-panel .eyebrow,
.workflow-side-panel label {
  color: #60a5fa;
}

.workflow-side-panel h1 {
  color: #f8fafc;
}

.workflow-side-panel select {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.26);
  background: #111827;
}

.workflow-side-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.workflow-param-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.workflow-param-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workflow-param-head strong {
  color: #e5e7eb;
  font-size: 13px;
}

.workflow-param-head span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.workflow-param-fields {
  display: grid;
  gap: 9px;
}

.workflow-param-fields .field {
  gap: 5px;
}

.workflow-param-fields input,
.workflow-param-fields select,
.workflow-param-fields textarea {
  min-height: 34px;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.26);
  background: #0f172a;
}

.workflow-param-fields textarea {
  min-height: 66px;
  resize: vertical;
}

.workflow-check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
}

.workflow-check-field input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.safe-code-policy {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: rgba(127, 29, 29, 0.18);
}

.safe-code-policy strong {
  color: #fee2e2;
  font-size: 12px;
}

.safe-code-policy p,
.safe-code-policy span {
  margin: 0;
  color: #fecaca;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.55;
}

body[data-page="workflow-editor"] .workflow-summary {
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.82);
}

body[data-page="workflow-editor"] .workflow-summary span,
body[data-page="workflow-editor"] .node-status-item small {
  color: #94a3b8;
}

body[data-page="workflow-editor"] .workflow-summary strong {
  color: #bfdbfe;
}

body[data-page="workflow-editor"] .node-status-list {
  padding-right: 2px;
}

body[data-page="workflow-editor"] .node-status-item {
  border-color: rgba(148, 163, 184, 0.16);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.82);
}

.node-status-item[data-status="disabled"] .node-dot {
  background: #475569;
}

body[data-page="workflow-editor"] .workflow-editor-graph {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(37, 99, 235, 0.08), transparent 28%),
    #0a0f18;
  box-shadow: none;
  grid-template-rows: minmax(0, 1fr);
}

body[data-page="workflow-editor"] #graph-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  background: #0a0f18;
}

.workflow-floating-toolbar {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(11, 15, 23, 0.86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.activity-pill,
.workflow-run-stats,
.workflow-minimap-tools span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
}

.activity-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.88);
}

.activity-pill.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(120, 53, 15, 0.28);
}

.workflow-minimap-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  width: 214px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: rgba(11, 15, 23, 0.86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

#workflow-minimap {
  display: block;
  width: 100%;
  height: 116px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background: #0f172a;
}

.workflow-minimap-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.workflow-run-stats {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 8;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(11, 15, 23, 0.86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.workflow-preview-popover {
  position: absolute;
  top: 78px;
  right: 18px;
  bottom: 168px;
  z-index: 9;
  display: grid;
  width: min(440px, calc(100% - 36px));
  min-height: 360px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(11, 15, 23, 0.94);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.workflow-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 10px 12px;
}

.workflow-preview-head strong {
  color: #e5e7eb;
  font-size: 13px;
}

body[data-page="workflow-editor"] #preview-frame {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

body.workflow-fullscreen .workflow-top-tabs,
body.workflow-fullscreen .workflow-left-rail,
body.workflow-fullscreen .workflow-side-panel {
  display: none;
}

body.workflow-fullscreen .workflow-comfy-shell {
  grid-template-rows: minmax(0, 1fr);
}

body.workflow-fullscreen .workflow-editor-layout {
  grid-template-columns: minmax(0, 1fr);
}

.one-click-layout {
  grid-template-areas:
    "input workflow"
    "input preview";
  grid-template-columns: minmax(300px, 360px) minmax(520px, 1fr);
  grid-template-rows: minmax(320px, 44vh) minmax(360px, 1fr);
}

.one-click-input-panel {
  grid-area: input;
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 18px;
}

.studio-intro {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.65;
}

.input-section {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.input-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.section-mini-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-mini-head span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.section-mini-head strong {
  font-size: 15px;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.material-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.material-list li {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(219, 228, 239, 0.82);
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.material-list strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.one-click-actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.one-click-workflow-panel {
  grid-area: workflow;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.one-click-workflow-panel #graph-canvas {
  min-height: 0;
}

.workflow-node-list {
  max-height: 96px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.workflow-node-list .node-status-item {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.workflow-node-list .node-status-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.one-click-preview-panel {
  grid-area: preview;
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.workflow-fallback-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-fallback-flow .fallback-node {
  display: grid;
  gap: 6px;
}

.workflow-fallback-flow .fallback-node span {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

body.workflow-fullscreen {
  overflow: hidden;
}

body.workflow-fullscreen .app-header,
body.workflow-fullscreen .workflow-picker-panel {
  display: none;
}

body.workflow-fullscreen .studio-shell {
  height: 100vh;
}

body.workflow-fullscreen .studio-layout {
  display: grid;
  height: 100vh;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

body.workflow-fullscreen .graph-panel {
  grid-column: 1;
  grid-row: 1;
  border: 0;
  border-radius: 0;
  padding: 0;
  grid-template-rows: minmax(0, 1fr);
}

body.workflow-fullscreen .graph-panel > .panel-head,
body.workflow-fullscreen .preview-panel {
  display: none;
}

body.workflow-fullscreen #graph-canvas {
  min-height: 100vh;
  border-radius: 0;
}

@media (max-width: 1180px) {
  body[data-page="studio"],
  body[data-page="workflow-editor"] {
    overflow: auto;
  }

  .studio-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .studio-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 60vh) minmax(210px, auto) minmax(460px, 60vh);
  }

  .one-click-layout {
    grid-template-areas:
      "input"
      "workflow"
      "preview";
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 60vh) minmax(460px, 60vh);
  }

  .one-click-input-panel,
  .one-click-workflow-panel,
  .one-click-preview-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .workflow-node-list {
    grid-template-columns: 1fr;
    max-height: 180px;
  }

  .workflow-editor-layout {
    grid-template-rows: auto minmax(560px, 66vh);
  }

  .preview-panel {
    grid-column: auto;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body[data-page="studio"] {
    overflow: hidden;
  }

  body[data-page="studio"] .studio-shell {
    height: 100vh;
    overflow: hidden;
  }

  body[data-page="studio"] .one-click-layout {
    grid-template-areas:
      "input workflow"
      "input preview";
    grid-template-columns: minmax(280px, 320px) minmax(420px, 1fr);
    grid-template-rows: minmax(300px, 45vh) minmax(320px, 1fr);
  }

  body[data-page="studio"] .one-click-input-panel {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
  }

  body[data-page="studio"] .one-click-workflow-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  body[data-page="studio"] .one-click-preview-panel {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }

  body[data-page="studio"] .workflow-node-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 84px;
  }
}

@media (max-width: 680px) {
  .studio-layout {
    padding: 10px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

body[data-page="admin"] {
  overflow: hidden;
}

body[data-page="courseware-edit"],
body[data-page="bolt-adapter"] {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.edit-shell,
.bolt-adapter-shell {
  display: grid;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.12), transparent 32%),
    linear-gradient(180deg, #f8fafc, #eef2ff);
}

.edit-shell {
  grid-template-rows: minmax(0, 1fr);
}

.edit-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.edit-layout {
  position: relative;
  display: block;
  width: 100vw;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  padding: 0;
}

.edit-side-panel,
.bolt-ai-panel,
.bolt-editor-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.edit-side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.edit-side-panel h1 {
  margin: 0;
  font-size: 28px;
}

.edit-side-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.edit-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.edit-meta div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.edit-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.edit-meta dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  word-break: break-word;
}

.bolt-frame-panel {
  position: absolute;
  inset: 0;
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #020617;
  box-shadow: none;
}

.bolt-frame-panel iframe,
#bolt-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
}

.edit-redirect-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 25% 20%, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(135deg, #f7fbff 0%, #eef6ff 46%, #f6faf7 100%);
}

.edit-redirect-card {
  width: min(620px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  padding: 36px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.edit-redirect-card h1 {
  margin: 10px 0 12px;
  color: #0f172a;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.edit-redirect-card p {
  color: #475569;
}

.bolt-adapter-shell {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 0;
}

.bolt-ai-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  border-width: 0 1px 0 0;
  border-radius: 0;
  padding: 18px;
}

.bolt-ai-panel h1 {
  margin: 0;
  font-size: 28px;
}

.bolt-ai-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.bolt-chat {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.bolt-chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.bolt-chat-log p {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

#bolt-chat-form {
  display: grid;
  gap: 8px;
}

#bolt-chat-form textarea {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  font: inherit;
}

.bolt-editor-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 0;
}

.bolt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: rgba(248, 250, 252, 0.92);
}

.bolt-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(360px, 42%) minmax(0, 1fr);
}

#source-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 14px;
  resize: none;
  color: #dbeafe;
  background: #0f172a;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
}

#live-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

body[data-bolt-tab="preview"] #source-editor {
  display: none;
}

body[data-bolt-tab="preview"] .bolt-workspace {
  grid-template-columns: 1fr;
}

body[data-bolt-tab="source"] #live-preview {
  display: none;
}

body[data-bolt-tab="source"] .bolt-workspace {
  grid-template-columns: 1fr;
}

.admin-shell {
  height: 100vh;
  overflow: hidden;
}

.admin-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.admin-sidebar,
.admin-content,
.erp-card,
.admin-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 14px;
}

.admin-menu {
  display: grid;
  gap: 8px;
}

.admin-menu-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.admin-menu-item.active,
.admin-menu-item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--blue-dark);
  background: rgba(37, 99, 235, 0.08);
}

.admin-submenu {
  display: none;
  gap: 6px;
  margin: -4px 0 4px 12px;
  padding-left: 10px;
  border-left: 2px solid rgba(37, 99, 235, 0.16);
}

.admin-submenu.is-active {
  display: grid;
}

.admin-submenu-item {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.admin-submenu-item:hover,
.admin-submenu-item.is-active {
  border-color: rgba(15, 118, 110, 0.22);
  color: var(--teal);
  background: rgba(15, 118, 110, 0.08);
}

.admin-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 14px;
}

.admin-head,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-head {
  margin-bottom: 12px;
}

.admin-head h2,
.card-head h3 {
  margin: 0;
}

.admin-head-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.person-name {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}

body.admin-name-mosaic [data-person-name] {
  border-radius: 4px;
  padding: 0 3px;
  color: transparent;
  text-shadow:
    0 0 7px rgba(15, 23, 42, 0.78),
    0 0 13px rgba(37, 99, 235, 0.24);
  background:
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.22) 0 2px, rgba(255, 255, 255, 0.72) 2px 4px),
    linear-gradient(180deg, rgba(226, 232, 240, 0.96), rgba(203, 213, 225, 0.9));
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  user-select: none;
}

body.admin-name-mosaic [data-person-name]::selection {
  color: transparent;
  background: rgba(37, 99, 235, 0.18);
}

body.admin-name-mosaic #learning-profile-image-view .portrait-visual-header h2 [data-person-name] {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  padding: 0 0.18em;
  color: transparent;
  text-shadow: none;
  background:
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.94) 0 8px, rgba(37, 99, 235, 0.9) 8px 15px, rgba(226, 232, 240, 0.96) 15px 22px),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(148, 163, 184, 0.92));
  filter: blur(1.8px);
}

body.admin-name-mosaic #learning-profile-image-view .portrait-visual-header h2 [data-person-name]::after {
  content: "";
  position: absolute;
  inset: -0.12em;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 35%, rgba(248, 250, 252, 0.96) 0 8%, transparent 9%),
    radial-gradient(circle at 58% 52%, rgba(15, 23, 42, 0.95) 0 12%, transparent 13%),
    repeating-linear-gradient(105deg, rgba(15, 23, 42, 0.88) 0 5px, rgba(96, 165, 250, 0.78) 5px 11px, rgba(241, 245, 249, 0.92) 11px 17px);
  pointer-events: none;
}

#toggle-name-mosaic[aria-pressed="true"] {
  border-color: rgba(37, 99, 235, 0.36);
  color: var(--blue-dark);
  background: rgba(37, 99, 235, 0.1);
}

.admin-alert {
  margin-bottom: 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--blue-dark);
  background: rgba(37, 99, 235, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.admin-alert.success {
  border-color: rgba(22, 163, 74, 0.24);
  color: var(--green);
  background: rgba(22, 163, 74, 0.08);
}

.admin-alert.warn {
  border-color: rgba(217, 119, 6, 0.28);
  color: var(--amber);
  background: rgba(217, 119, 6, 0.08);
}

.admin-alert.error {
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.admin-panel {
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(255, 255, 255, 0.9));
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.erp-grid {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.school-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-bank-grid {
  grid-template-columns: minmax(320px, 0.85fr) minmax(480px, 1.35fr);
}

.assignments-grid {
  grid-template-columns: minmax(520px, 1fr) minmax(420px, 0.9fr);
}

.model-library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-panel[data-panel="overview"] > .two-columns,
.admin-panel[data-panel="school"] > .school-grid,
.admin-panel[data-panel="question-bank"] > .question-bank-grid,
.admin-panel[data-panel="assignments"] > .assignments-grid,
.admin-panel[data-panel="model-library"] > .model-library-grid {
  grid-template-columns: minmax(0, 1fr);
}

.model-catalog-card {
  grid-column: 1 / -1;
}

.question-draft-card {
  grid-column: 1 / -1;
}

.erp-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-auto-rows: auto;
  overflow: hidden;
  padding: 14px;
  box-shadow: none;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.table-wrap th,
.table-wrap td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.table-wrap th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-wrap td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.review-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.review-source-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.review-source-card small {
  color: var(--muted);
  line-height: 1.5;
}

.table-pagination {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.table-pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-pagination .compact-button {
  min-height: 30px;
  padding: 6px 10px;
}

.table-pagination .compact-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.student-portrait-view {
  display: grid;
  gap: 16px;
}

.student-portrait-hero,
.portrait-score-grid article,
.portrait-section,
.portrait-two-columns article {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.82)),
    #fff;
}

.student-portrait-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.student-portrait-hero h3,
.student-portrait-hero p,
.portrait-section h4,
.portrait-section p,
.portrait-two-columns h4,
.portrait-two-columns ul {
  margin: 0;
}

.student-portrait-hero h3 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.student-portrait-hero p,
.portrait-section p,
.portrait-two-columns li {
  color: var(--muted);
  line-height: 1.65;
}

.portrait-label {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.08);
}

.portrait-index {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.24);
}

.portrait-index span,
.portrait-index small {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.86;
}

.portrait-index strong {
  font-size: 42px;
  line-height: 1;
}

.portrait-score-grid,
.portrait-two-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.portrait-two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portrait-score-grid article,
.portrait-section,
.portrait-two-columns article {
  padding: 14px;
}

.portrait-score-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.portrait-score-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 26px;
}

.portrait-score-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.portrait-section,
.portrait-two-columns article {
  display: grid;
  gap: 10px;
}

.portrait-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portrait-pill-grid span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  background: rgba(22, 163, 74, 0.08);
}

.portrait-pill-grid.is-risk span {
  border-color: rgba(217, 119, 6, 0.2);
  color: var(--amber);
  background: rgba(217, 119, 6, 0.08);
}

.portrait-two-columns ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.student-portrait-canvas-card {
  gap: 14px;
}

.admin-panel[data-panel="learning-profiles"] .portrait-selector-head {
  display: none;
}

.admin-panel[data-panel="learning-profiles"][data-active-subtable="learning-image"] .learning-profiles-intro,
.admin-panel[data-panel="learning-profiles"][data-active-subtable="learning-image"] .learning-profile-summary-metrics,
.admin-panel[data-panel="learning-profiles"][data-active-subtable="learning-image"] .portrait-selector-head > div {
  display: none;
}

.admin-panel[data-panel="learning-profiles"][data-active-subtable="learning-image"] .student-portrait-canvas-card {
  max-height: calc(100vh - 168px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-panel[data-panel="learning-profiles"][data-active-subtable="learning-image"] .portrait-selector-head {
  display: flex;
  position: sticky;
  z-index: 4;
  top: 0;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.portrait-selector-head {
  align-items: end;
}

.portrait-selector-head select {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

#learning-profile-image-view {
  min-width: 0;
}

.portrait-visual-card {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 18px;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  color: #e5e7eb;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.92) 48%, rgba(15, 118, 110, 0.78)),
    #0f172a;
  box-shadow: 0 28px 88px rgba(15, 23, 42, 0.22);
}

.portrait-visual-bg {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.32));
}

.portrait-visual-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
}

.portrait-visual-header h2,
.portrait-visual-header p,
.portrait-visual-panel h4,
.portrait-visual-panel p,
.portrait-visual-bottom h4,
.portrait-visual-bottom ul {
  margin: 0;
}

.portrait-visual-header h2 {
  margin-top: 10px;
  color: #fff;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.portrait-visual-header p,
.portrait-visual-panel p,
.portrait-visual-bottom li {
  color: #cbd5e1;
  line-height: 1.68;
}

.portrait-visual-score {
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0f172a 0 56%, transparent 57%),
    conic-gradient(#22d3ee var(--score), rgba(148, 163, 184, 0.18) 0);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.12), 0 16px 38px rgba(34, 211, 238, 0.18);
}

.portrait-visual-score strong,
.portrait-visual-score span {
  grid-area: 1 / 1;
}

.portrait-visual-score strong {
  color: #fff;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-8px);
}

.portrait-visual-score span {
  align-self: end;
  margin-bottom: 34px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
}

.portrait-visual-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr;
  gap: 14px;
}

.portrait-visual-panel,
.portrait-visual-bottom article {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.portrait-visual-panel h4,
.portrait-visual-bottom h4 {
  color: #f8fafc;
  font-size: 15px;
}

.portrait-visual-bar {
  display: grid;
  gap: 7px;
}

.portrait-visual-bar div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portrait-visual-bar span,
.portrait-visual-bar small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.portrait-visual-bar strong {
  color: #e0f2fe;
  font-size: 13px;
}

.portrait-visual-bar i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.portrait-visual-bar i::before {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2dd4bf, #facc15);
  content: "";
}

.portrait-visual-radar {
  align-content: center;
}

.portrait-radar-svg {
  width: min(260px, 100%);
  min-height: 230px;
  justify-self: center;
  overflow: visible;
}

.radar-grid {
  fill: rgba(14, 165, 233, 0.04);
  stroke: rgba(147, 197, 253, 0.22);
  stroke-width: 1.2;
}

.radar-grid-mid,
.radar-grid-inner {
  fill: none;
  stroke: rgba(147, 197, 253, 0.14);
}

.radar-axis {
  stroke: rgba(147, 197, 253, 0.16);
  stroke-width: 1;
}

.radar-area {
  fill: rgba(45, 212, 191, 0.34);
  stroke: #67e8f9;
  stroke-linejoin: round;
  stroke-width: 2.4;
  filter: drop-shadow(0 8px 18px rgba(34, 211, 238, 0.2));
}

.radar-dot {
  fill: #facc15;
  stroke: #0f172a;
  stroke-width: 2;
}

.radar-label {
  fill: #bfdbfe;
  font-size: 11px;
  font-weight: 900;
}

.portrait-key-chip {
  width: fit-content;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  padding: 7px 11px;
  color: #99f6e4;
  font-size: 12px;
  font-weight: 900;
  background: rgba(20, 184, 166, 0.12);
}

.portrait-visual-bottom {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
}

.portrait-visual-bottom ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.portrait-visual-card .portrait-pill-grid span {
  border-color: rgba(45, 212, 191, 0.24);
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.1);
}

.table-wrap input,
.table-wrap select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-check input {
  width: 16px;
  min-height: 16px;
}

.dashboard-layout {
  display: grid;
  min-height: calc(100vh - 88px);
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.dashboard-sidebar,
.dashboard-content,
.student-profile-panel {
  min-width: 0;
  min-height: 0;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
}

.dashboard-sidebar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.dashboard-sidebar p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.dashboard-sidebar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-sidebar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.dashboard-content {
  display: grid;
  align-content: start;
  gap: 18px;
}

.dashboard-hero {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.08)),
    rgba(255, 255, 255, 0.95);
}

.dashboard-grid,
.student-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-metrics {
  width: min(520px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.distribution-bars,
.knowledge-list,
.strategy-list {
  display: grid;
  gap: 10px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.distribution-row div {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.distribution-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.knowledge-item {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.92);
}

.knowledge-item.is-weak {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(255, 251, 235, 0.86);
}

.knowledge-item strong {
  color: var(--ink);
}

.knowledge-item span,
.knowledge-item small,
.strategy-list li {
  color: var(--muted);
  line-height: 1.55;
}

.strategy-list {
  margin: 0;
  padding-left: 18px;
}

.table-wrap select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
}

.erp-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--blue-dark);
  background: rgba(37, 99, 235, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.erp-badge[data-status="completed"],
.erp-badge[data-status="uploaded"],
.erp-badge[data-status="managed"],
.erp-badge[data-status="ok"],
.erp-badge[data-status="enabled"],
.erp-badge[data-status="pass"] {
  color: var(--green);
  background: rgba(22, 163, 74, 0.09);
}

.erp-badge[data-status="failed"],
.erp-badge[data-status="disabled"],
.erp-badge[data-status="fail"] {
  color: var(--red);
  background: rgba(220, 38, 38, 0.09);
}

.erp-badge[data-status="running"],
.erp-badge[data-status="queued"],
.erp-badge[data-status="degraded"],
.erp-badge[data-status="unknown"],
.erp-badge[data-status="warning"] {
  color: var(--amber);
  background: rgba(217, 119, 6, 0.1);
}

.selected-row {
  background: rgba(37, 99, 235, 0.07);
}

.question-form {
  gap: 16px;
}

.question-json-grid textarea {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.question-kp-fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.question-kp-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-kp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.assignment-question-grid {
  display: grid;
  gap: 8px;
}

.assignment-question-check {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.assignment-question-check input {
  width: auto;
  min-height: auto;
}

.assignment-question-check span {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-question-check small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.question-check {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px !important;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.question-check input {
  width: auto;
  min-height: 0;
  grid-row: span 2;
}

.question-check span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.question-check small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-row {
  display: flex !important;
  min-height: 38px;
  align-items: center;
  flex-direction: row !important;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.inline-check {
  display: inline-flex !important;
  min-height: 38px;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.erp-badge[data-status="configured"] {
  color: var(--green);
  background: rgba(22, 163, 74, 0.09);
}

.erp-badge[data-status="missing"],
.erp-badge[data-status="planned"] {
  color: var(--amber);
  background: rgba(217, 119, 6, 0.1);
}

.planned-row {
  background: rgba(15, 23, 42, 0.025);
}

.integration-details {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 10px 14px;
  align-content: start;
  margin: 0;
  color: var(--ink);
}

.integration-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.integration-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.danger {
  color: var(--red);
}

@media (max-width: 1180px) {
  body[data-page="admin"],
  body[data-page="dashboard"] {
    overflow: auto;
  }

  .admin-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .admin-layout,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .student-layout {
    grid-template-columns: 1fr;
  }

  .admin-content {
    overflow: visible;
  }

  .metric-grid,
  .two-columns,
  .question-bank-grid,
  .assignments-grid,
  .dashboard-grid,
  .student-profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .metric-grid,
  .two-columns,
  .question-bank-grid,
  .assignments-grid,
  .dashboard-grid,
  .student-profile-grid,
  .form-grid.two-fields,
  .form-grid.three-fields,
  .question-kp-grid {
    grid-template-columns: 1fr;
  }

  .student-grid,
  .student-assignment-card dl {
    grid-template-columns: 1fr;
  }

  .admin-head,
  .card-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@font-face {
  font-family: "Comfy Inter";
  src: url("/image/comfyui/fonts/inter-latin-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Comfy Inter";
  src: url("/image/comfyui/fonts/inter-latin-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

body[data-page="studio"] {
  width: 100vw;
  height: 100vh;
  color: #e5e7eb;
  background:
    radial-gradient(circle at 22% 0%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(20, 184, 166, 0.12), transparent 28%),
    #070910;
  font-family: "Comfy Inter", "Microsoft YaHei", Arial, sans-serif;
  overflow-x: hidden;
  overflow: hidden;
}

body[data-page="studio"] .studio-comfy-shell {
  display: grid;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  grid-template-rows: 46px minmax(0, 1fr);
  overflow: hidden;
  background: #070910;
}

body[data-page="studio"] .studio-comfy-tabs {
  grid-template-columns: 238px minmax(0, 1fr) auto;
}

.studio-comfy-brand .studio-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 10px;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.26);
}

.studio-comfy-brand .studio-brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.studio-comfy-brand strong {
  color: #f8fafc;
  font-size: 13px;
  line-height: 1;
}

.studio-comfy-brand small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

body[data-page="studio"] .studio-comfy-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 66px 338px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #070910;
}

body[data-page="studio"] .studio-comfy-rail,
body[data-page="studio"] .studio-comfy-input,
body[data-page="studio"] .studio-comfy-canvas {
  grid-area: auto;
}

body[data-page="studio"] .studio-comfy-rail {
  grid-column: 1;
  grid-row: 1;
}

body[data-page="studio"] .studio-comfy-input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body[data-page="studio"] .studio-comfy-canvas {
  grid-column: 3;
  grid-row: 1;
}

body[data-page="studio"] .workflow-page-links {
  margin-left: auto;
}

body[data-page="studio"] .studio-comfy-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  padding: 12px 8px;
  background: #090d14;
}

body[data-page="studio"] .rail-item {
  display: grid;
  min-height: 54px;
  grid-template-rows: auto auto;
  place-items: center;
  gap: 4px;
  border-radius: 8px;
  color: #94a3b8;
  line-height: 1;
  cursor: pointer;
}

body[data-page="studio"] .rail-item i {
  color: inherit;
  font-size: 19px;
  line-height: 1;
}

body[data-page="studio"] .rail-item:hover,
body[data-page="studio"] .rail-item:focus-visible {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.36);
  background: rgba(30, 64, 175, 0.18);
}

body[data-page="studio"] .studio-comfy-input {
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0;
  padding: 16px;
  background: #0d121b;
  box-shadow: none;
}

body[data-page="studio"] .studio-comfy-input-head {
  align-items: start;
  flex-wrap: wrap;
}

body[data-page="studio"] .studio-comfy-input-head > div {
  min-width: 0;
}

body[data-page="studio"] .studio-comfy-input .eyebrow,
body[data-page="studio"] .studio-comfy-input label {
  color: #60a5fa;
}

body[data-page="studio"] .studio-comfy-input h1 {
  margin: 0;
  color: #f8fafc;
  font-size: 25px;
  line-height: 1.05;
}

body[data-page="studio"] .studio-comfy-form {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

body[data-page="studio"] .input-section {
  gap: 12px;
  border-top-color: rgba(148, 163, 184, 0.16);
  padding: 14px 0;
}

body[data-page="studio"] .section-mini-head strong {
  color: #e5e7eb;
  font-size: 14px;
}

body[data-page="studio"] .section-mini-head span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
}

body[data-page="studio"] .studio-comfy-input .field {
  min-width: 0;
}

body[data-page="studio"] .studio-comfy-input *,
body[data-page="studio"] .studio-comfy-input *::before,
body[data-page="studio"] .studio-comfy-input *::after {
  box-sizing: border-box;
}

body[data-page="studio"] .studio-comfy-input input,
body[data-page="studio"] .studio-comfy-input textarea,
body[data-page="studio"] .studio-comfy-input select {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.26);
  background: #0f172a;
}

body[data-page="studio"] .studio-comfy-input textarea {
  min-height: 74px;
}

body[data-page="studio"] .studio-comfy-upload {
  border-color: rgba(96, 165, 250, 0.28);
  color: #e5e7eb;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.42)),
    rgba(15, 23, 42, 0.72);
}

body[data-page="studio"] .studio-comfy-upload label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #dbeafe;
  letter-spacing: 0;
  text-transform: none;
}

body[data-page="studio"] .studio-comfy-upload label i {
  font-size: 20px;
}

body[data-page="studio"] .studio-comfy-upload small,
body[data-page="studio"] .material-list li {
  color: #94a3b8;
  overflow-wrap: anywhere;
}

body[data-page="studio"] .studio-comfy-upload input[type="file"] {
  width: 100%;
  color: #e5e7eb;
  font-size: 12px;
}

body[data-page="studio"] .material-list li {
  border-top-color: rgba(148, 163, 184, 0.16);
}

body[data-page="studio"] .material-list strong {
  color: #e5e7eb;
}

.studio-context-panel {
  display: grid;
  gap: 10px;
  min-height: 94px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 13, 22, 0.78);
}

body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode {
  display: flex;
  flex-direction: column;
}

body[data-page="studio"] .studio-comfy-input.is-node-input-mode {
  display: flex;
  flex-direction: column;
}

body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .studio-comfy-form,
body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .studio-comfy-summary,
body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .workflow-node-list,
body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .studio-comfy-output-actions,
body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .status-pill,
body[data-page="studio"] .studio-comfy-input.is-node-input-mode .studio-comfy-form,
body[data-page="studio"] .studio-comfy-input.is-node-input-mode .studio-comfy-summary,
body[data-page="studio"] .studio-comfy-input.is-node-input-mode .workflow-node-list,
body[data-page="studio"] .studio-comfy-input.is-node-input-mode .studio-comfy-output-actions,
body[data-page="studio"] .studio-comfy-input.is-node-input-mode .status-pill {
  display: none !important;
}

body[data-page="studio"] .studio-comfy-input.is-resource-panel-mode .studio-context-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body[data-page="studio"] .studio-comfy-input.is-node-input-mode .studio-context-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.studio-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.studio-context-head strong {
  color: #e5e7eb;
  font-size: 13px;
}

.studio-context-head span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
}

.studio-context-list {
  display: grid;
  gap: 7px;
}

.studio-context-list p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.studio-context-list p strong {
  color: #e5e7eb;
}

.studio-context-list p span {
  color: #bfdbfe;
  text-align: right;
}

.studio-context-list p.studio-model-health-row {
  align-items: flex-start;
  flex-wrap: wrap;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.studio-context-list p.studio-model-health-row small {
  flex: 1 0 100%;
  color: #94a3b8;
  font-size: 11px;
}

.studio-model-health {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  margin-right: 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.studio-model-health.is-ok {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.24);
}

.studio-model-health.is-warn {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.24);
}

.studio-model-health.is-error {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.24);
}

.studio-model-health.is-unknown {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.2);
}

.studio-node-input-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.workflow-input-overview {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(37, 99, 235, 0.12);
}

.workflow-input-overview strong {
  color: #f8fafc;
  font-size: 12px;
}

.workflow-input-overview span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.workflow-input-overview[data-status="missing"] {
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.2);
}

.workflow-input-overview[data-status="optional"] {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(120, 53, 15, 0.18);
}

.studio-node-input-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.studio-node-input-card {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--node-accent, #60a5fa) 38%, rgba(148, 163, 184, 0.18));
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--node-accent, #60a5fa) 14%, rgba(15, 23, 42, 0.92)), rgba(8, 13, 22, 0.92));
}

.studio-node-input-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.studio-node-input-card-head span,
.studio-node-input-card-head em {
  border-radius: 999px;
  padding: 2px 7px;
  color: #dbeafe;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.2);
}

.studio-node-input-card-head strong {
  color: #f8fafc;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-node-input-card > p {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
}

.studio-node-input-fields,
.studio-node-param-grid {
  display: grid;
  gap: 8px;
}

.studio-node-input-field,
.studio-node-param-field {
  display: grid;
  gap: 5px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.studio-node-input-field input,
.studio-node-input-field textarea,
.studio-node-param-field input,
.studio-node-param-field select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  padding: 8px 9px;
  color: #e5e7eb;
  background: rgba(2, 6, 23, 0.68);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.studio-node-input-field textarea {
  min-height: 76px;
  resize: vertical;
}

.workflow-policy-input span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workflow-policy-input em {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 2px 6px;
  color: #93c5fd;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.72);
}

.workflow-policy-input.is-missing input,
.workflow-policy-input.is-missing textarea {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.08);
}

.workflow-policy-input.is-missing em {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.26);
}

.studio-node-input-field small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.studio-node-param-field.is-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-node-param-field.is-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #60a5fa;
}

.studio-workflow-library {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.studio-workflow-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.studio-workflow-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(37, 99, 235, 0.14);
}

.studio-workflow-active span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
}

.studio-workflow-active strong {
  color: #e5e7eb;
  font-size: 12px;
  text-align: right;
}

.workflow-policy-fields {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.36);
}

.workflow-policy-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workflow-policy-fields-head strong {
  color: #e5e7eb;
  font-size: 12px;
}

.workflow-policy-fields-head span,
.workflow-policy-field small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.studio-workflow-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.studio-workflow-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #cbd5e1;
  text-align: left;
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
}

.studio-workflow-card:hover,
.studio-workflow-card:focus-visible,
.studio-workflow-card.is-active {
  border-color: rgba(96, 165, 250, 0.48);
  color: #eff6ff;
  background: rgba(30, 64, 175, 0.28);
}

.studio-workflow-card > i {
  grid-row: span 2;
  color: #93c5fd;
  font-size: 18px;
}

.studio-workflow-card strong {
  display: block;
  color: inherit;
  font-size: 12px;
}

.studio-workflow-card small {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
}

.studio-workflow-card > em {
  justify-self: end;
  border-radius: 999px;
  padding: 2px 7px;
  color: #bfdbfe;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.22);
}

.studio-workflow-card > small {
  grid-column: 2 / 4;
}

.studio-node-catalog {
  display: grid;
  gap: 7px;
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.studio-node-catalog li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #e5e7eb;
  font-size: 12px;
}

.studio-node-catalog small {
  color: #94a3b8;
  font-weight: 800;
}

.node-library-shell {
  display: grid;
  gap: 12px;
  max-height: min(56vh, 620px);
  overflow: auto;
  padding-right: 2px;
}

.node-library-summary {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 2px;
  background: #0d121b;
}

.node-library-group {
  display: grid;
  gap: 8px;
}

.node-library-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 6px;
}

.node-library-group-head strong {
  color: #bfdbfe;
  font-size: 12px;
}

.node-library-group-head span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.node-library-grid {
  display: grid;
  gap: 8px;
}

.node-library-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-left-color: var(--node-accent);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.46)),
    rgba(15, 23, 42, 0.78);
}

.node-library-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.node-library-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--node-accent) 48%, transparent);
  border-radius: 8px;
  color: #f8fafc;
  background: color-mix(in srgb, var(--node-color) 28%, rgba(15, 23, 42, 0.86));
}

.node-library-title {
  min-width: 0;
}

.node-library-title strong,
.node-library-title small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-library-title strong {
  color: #f8fafc;
  font-size: 12px;
}

.node-library-title small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.node-library-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.node-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.node-library-meta span {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  padding: 3px 6px;
  color: #9fb1c8;
  font-size: 10px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.7);
}

.node-library-add {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--node-accent) 48%, rgba(148, 163, 184, 0.18));
  border-radius: 6px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
  background: color-mix(in srgb, var(--node-color) 18%, rgba(15, 23, 42, 0.84));
  cursor: pointer;
}

.node-library-add:hover,
.node-library-add:focus-visible {
  color: #fff;
  border-color: var(--node-accent);
  background: color-mix(in srgb, var(--node-color) 34%, rgba(15, 23, 42, 0.92));
}

body[data-page="studio"] .node-library-shell {
  max-height: 370px;
}

body[data-page="studio"] .studio-context-panel > .node-library-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}

body[data-page="workflow-editor"] .workflow-node-library-panel {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 11px;
  background: rgba(15, 23, 42, 0.52);
}

body[data-page="workflow-editor"] .node-library-shell {
  max-height: 34vh;
}

.node-library-shell.is-compact .node-library-card {
  padding: 9px;
}

.node-library-shell.is-compact .node-library-card p {
  font-size: 11px;
}

.studio-template-grid {
  display: grid;
  gap: 8px;
}

.studio-template-card,
.workflow-template-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #cbd5e1;
  text-align: left;
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
}

.studio-template-card:hover,
.studio-template-card:focus-visible,
.workflow-template-option:hover,
.workflow-template-option:focus-visible,
.studio-template-card.is-active,
.workflow-template-option.is-active {
  color: #eff6ff;
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.24);
}

.studio-template-card > i,
.workflow-template-option > i {
  color: #93c5fd;
  font-size: 18px;
}

.studio-template-card strong,
.workflow-template-option strong {
  display: block;
  color: inherit;
  font-size: 12px;
}

.studio-template-card small,
.workflow-template-option small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
}

.studio-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.studio-app-grid a {
  display: grid;
  min-height: 58px;
  place-items: center;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.82);
}

.studio-app-grid a:hover,
.studio-app-grid a:focus-visible {
  border-color: rgba(20, 184, 166, 0.42);
  background: rgba(20, 184, 166, 0.16);
}

.studio-app-grid i {
  font-size: 19px;
}

body[data-page="studio"] .studio-comfy-summary {
  margin-top: 14px;
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.82);
}

body[data-page="studio"] .studio-comfy-summary span {
  color: #94a3b8;
}

body[data-page="studio"] .studio-comfy-summary strong {
  color: #bfdbfe;
}

body[data-page="studio"] .workflow-node-list {
  max-height: 190px;
  grid-template-columns: 1fr;
  margin-top: 12px;
  padding-right: 2px;
}

body[data-page="studio"] .workflow-node-list .node-status-item {
  min-height: 34px;
  border-color: rgba(148, 163, 184, 0.16);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.82);
}

body[data-page="studio"] .workflow-node-list .node-status-item small {
  color: #94a3b8;
}

.studio-comfy-output-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

body[data-page="studio"] .studio-comfy-canvas {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  padding: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(37, 99, 235, 0.08), transparent 28%),
    #0a0f18;
  box-shadow: none;
}

body[data-page="studio"] #graph-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  background: #0a0f18;
}

body[data-page="studio"] .studio-comfy-canvas.is-auto-workflow-empty #graph-canvas {
  opacity: 0.94;
}

body[data-page="studio"] .studio-comfy-canvas.is-auto-workflow-empty .workflow-minimap-panel {
  opacity: 0.48;
}

body[data-page="studio"] .studio-run-toolbar {
  top: 16px;
  right: 18px;
  align-items: stretch;
  gap: 8px;
}

.studio-run-split {
  display: inline-flex;
  align-items: stretch;
}

.studio-generate-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.studio-generate-button i {
  font-size: 16px;
  line-height: 1;
}

.studio-template-toggle {
  display: inline-flex;
  width: 38px;
  min-width: 38px;
  align-items: center;
  justify-content: center;
  border-left-color: rgba(255, 255, 255, 0.18);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0;
}

.workflow-template-status {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.88);
}

.workflow-input-status {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.88);
}

.workflow-input-status[data-status="ready"] {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(20, 83, 45, 0.25);
}

.workflow-input-status[data-status="optional"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(120, 53, 15, 0.24);
}

.workflow-input-status[data-status="missing"] {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.28);
}

.workflow-template-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  width: min(342px, calc(100vw - 36px));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(8, 13, 22, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
}

.workflow-template-menu.hidden {
  display: none;
}

body[data-page="studio"] .workflow-preview-popover.studio-preview-popover {
  top: 78px;
  right: 18px;
  bottom: 168px;
  width: min(460px, calc(100% - 36px));
  min-height: 360px;
}

body[data-page="studio"] #preview-frame {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #0a0f18;
}

body[data-page="studio"] .tool-button:disabled,
body[data-page="studio"] .secondary-button:disabled {
  opacity: 0.42;
}

body[data-page="studio"] .status-pill[data-status="success"] {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(22, 101, 52, 0.22);
}

body[data-page="studio"] .status-pill[data-status="running"] {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(120, 53, 15, 0.22);
}

body[data-page="studio"] .status-pill[data-status="failed"] {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(127, 29, 29, 0.22);
}

@media (max-width: 1180px) {
  body[data-page="studio"] {
    overflow: hidden;
  }

  body[data-page="studio"] .studio-comfy-layout {
    grid-template-columns: 58px 304px minmax(0, 1fr);
  }

  body[data-page="studio"] .workflow-preview-popover.studio-preview-popover {
    width: min(390px, calc(100% - 36px));
  }
}

@media (max-width: 900px) {
  body[data-page="studio"] {
    overflow: auto;
    overflow-x: hidden;
  }

  body[data-page="studio"] .studio-comfy-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: 46px auto;
    overflow: visible;
  }

  body[data-page="studio"] .studio-comfy-tabs {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 46px;
    padding: 8px;
  }

  body[data-page="studio"] .workflow-tabs,
  body[data-page="studio"] .workflow-page-links {
    display: none;
  }

  body[data-page="studio"] .studio-comfy-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 68vh);
  }

  body[data-page="studio"] .studio-comfy-rail {
    display: none;
  }

  body[data-page="studio"] .studio-comfy-input {
    grid-column: 1;
    grid-row: 1;
    width: 100vw;
    max-width: 100vw;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  body[data-page="studio"] .studio-comfy-input .status-pill {
    max-width: 100%;
    padding: 6px 10px;
    font-size: 11px;
  }

  body[data-page="studio"] .studio-comfy-canvas {
    grid-column: 1;
    grid-row: 2;
    min-height: 520px;
  }

  body[data-page="studio"] .workflow-preview-popover.studio-preview-popover {
    top: 76px;
    bottom: 112px;
    width: calc(100% - 36px);
  }

  body[data-page="studio"] .workflow-minimap-panel {
    display: none;
  }
}

/* Workflow editor polish: ComfyUI-like canvas chrome and denser node telemetry. */
body[data-page="workflow-editor"] {
  font-family: "Comfy Inter", "Microsoft YaHei", Arial, sans-serif;
}

body[data-page="workflow-editor"] .workflow-comfy-shell {
  background:
    radial-gradient(circle at 18% -10%, rgba(59, 130, 246, 0.22), transparent 34%),
    radial-gradient(circle at 84% 2%, rgba(217, 70, 239, 0.14), transparent 30%),
    #06080d;
}

body[data-page="workflow-editor"] .workflow-top-tabs {
  grid-template-columns: 224px minmax(0, 1fr) auto;
  border-bottom-color: rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(8, 12, 19, 0.96)),
    #0b0f17;
}

body[data-page="workflow-editor"] .workflow-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #a78bfa 58%, #f472b6);
  box-shadow: 0 10px 32px rgba(96, 165, 250, 0.28);
}

body[data-page="workflow-editor"] .workflow-tab {
  color: #8ea0b7;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.64);
}

body[data-page="workflow-editor"] .workflow-tab.is-active {
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(17, 24, 39, 0.98)),
    #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-page="workflow-editor"] .workflow-editor-layout {
  grid-template-columns: 74px 324px minmax(0, 1fr);
}

body[data-page="workflow-editor"] .workflow-left-rail {
  gap: 8px;
  padding: 12px 9px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(7, 10, 17, 0.95)),
    #090d14;
}

body[data-page="workflow-editor"] .rail-item {
  min-height: 58px;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body[data-page="workflow-editor"] .rail-item::before {
  content: "";
  display: block;
  width: 18px;
  height: 3px;
  margin-bottom: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

body[data-page="workflow-editor"] .rail-item.is-active {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.48);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(15, 23, 42, 0.76)),
    rgba(37, 99, 235, 0.22);
}

body[data-page="workflow-editor"] .workflow-side-panel {
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(9, 13, 20, 0.98)),
    #0d121b;
}

body[data-page="workflow-editor"] .workflow-picker-head {
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

body[data-page="workflow-editor"] .workflow-side-panel h1 {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
}

body[data-page="workflow-editor"] .workflow-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 11px;
  border-color: rgba(96, 165, 250, 0.22);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.86)),
    rgba(15, 23, 42, 0.82);
}

body[data-page="workflow-editor"] .workflow-summary span,
body[data-page="workflow-editor"] .workflow-summary strong {
  text-align: center;
}

body[data-page="workflow-editor"] .workflow-side-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-page="workflow-editor"] .workflow-side-actions .compact-button {
  min-width: 0;
  padding: 0 8px;
}

body[data-page="workflow-editor"] .workflow-param-panel {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.54)),
    rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-page="workflow-editor"] .workflow-editor-graph {
  background:
    radial-gradient(circle at 26% 16%, rgba(37, 99, 235, 0.14), transparent 26%),
    radial-gradient(circle at 70% 62%, rgba(20, 184, 166, 0.1), transparent 28%),
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    #070b12;
  background-size:
    auto,
    auto,
    96px 96px,
    96px 96px,
    24px 24px,
    24px 24px,
    auto;
}

body[data-page="workflow-editor"] #graph-canvas {
  background: transparent;
  outline: 1px solid rgba(148, 163, 184, 0.05);
}

.workflow-canvas-hud {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 8;
  display: grid;
  gap: 2px;
  min-width: 282px;
  max-width: 360px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e5e7eb;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.78)),
    rgba(11, 15, 23, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.workflow-canvas-hud span,
.workflow-canvas-hud small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.workflow-canvas-hud strong {
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.25;
}

body[data-page="workflow-editor"] .workflow-floating-toolbar,
body[data-page="workflow-editor"] .workflow-minimap-panel,
body[data-page="workflow-editor"] .workflow-run-stats {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86)),
    rgba(11, 15, 23, 0.86);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.36);
}

body[data-page="workflow-editor"] .workflow-comfy-shell .primary-button,
body[data-page="workflow-editor"] .workflow-comfy-shell .secondary-button,
body[data-page="workflow-editor"] .workflow-comfy-shell .ghost-button,
body[data-page="workflow-editor"] .workflow-comfy-shell .tool-button {
  min-height: 34px;
  border-color: rgba(148, 163, 184, 0.22);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: none;
}

body[data-page="workflow-editor"] .workflow-comfy-shell .primary-button {
  border-color: rgba(96, 165, 250, 0.54);
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.28);
}

body[data-page="workflow-editor"] .workflow-comfy-shell .ghost-button:hover,
body[data-page="workflow-editor"] .workflow-comfy-shell .tool-button:hover,
body[data-page="workflow-editor"] .workflow-comfy-shell .secondary-button:hover {
  border-color: rgba(96, 165, 250, 0.46);
  background: rgba(30, 41, 59, 0.95);
}

body[data-page="workflow-editor"] .node-status-list {
  display: grid;
  max-height: 32vh;
  gap: 7px;
  overflow: auto;
}

body[data-page="workflow-editor"] .node-status-item {
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  border-color: rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.38)),
    rgba(15, 23, 42, 0.82);
}

body[data-page="workflow-editor"] .node-status-item.is-selected {
  border-color: rgba(96, 165, 250, 0.52);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.86)),
    rgba(15, 23, 42, 0.92);
  box-shadow: inset 3px 0 0 #60a5fa;
}

.node-status-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.node-status-main strong,
.node-status-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-status-main strong {
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.1;
}

.node-status-main small,
.node-status-tag {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
}

.node-status-tag {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(2, 6, 23, 0.36);
}

@media (max-width: 1120px) {
  body[data-page="workflow-editor"] .workflow-editor-layout {
    grid-template-columns: 64px 286px minmax(0, 1fr);
  }

  .workflow-canvas-hud {
    min-width: 238px;
  }
}

@media (max-width: 900px) {
  body[data-page="workflow-editor"] {
    height: auto;
    overflow: auto;
  }

  body[data-page="workflow-editor"] .workflow-comfy-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto;
  }

  body[data-page="workflow-editor"] .workflow-top-tabs {
    grid-template-columns: minmax(0, 1fr);
    min-height: 46px;
    padding: 8px;
  }

  body[data-page="workflow-editor"] .workflow-tabs,
  body[data-page="workflow-editor"] .workflow-page-links,
  body[data-page="workflow-editor"] .workflow-left-rail {
    display: none;
  }

  body[data-page="workflow-editor"] .workflow-editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(560px, 70vh);
  }

  body[data-page="workflow-editor"] .workflow-side-panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  .workflow-canvas-hud {
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    min-width: 0;
  }

  body[data-page="workflow-editor"] .workflow-floating-toolbar {
    top: 82px;
    right: 12px;
    left: 12px;
    justify-content: flex-end;
  }

  body[data-page="workflow-editor"] .workflow-minimap-panel {
    display: none;
  }
}
