:root {
  --bg: #eef3f8;
  --bg-radial: rgba(255, 255, 255, 0.84);
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --panel-soft: rgba(246, 249, 253, 0.92);
  --line: rgba(197, 209, 223, 0.72);
  --line-strong: rgba(159, 179, 201, 0.9);
  --text: #162033;
  --muted: #617086;
  --accent: #2f6fed;
  --accent-strong: #1f57c6;
  --accent-soft: rgba(47, 111, 237, 0.1);
  --success-soft: rgba(50, 143, 93, 0.1);
  --page: #4f6fbe;
  --page-soft: rgba(79, 111, 190, 0.12);
  --block: #7186a7;
  --block-soft: rgba(113, 134, 167, 0.14);
  --missing: #ad9158;
  --shadow: 0 18px 48px rgba(31, 52, 84, 0.08);
  --shadow-soft: 0 10px 26px rgba(31, 52, 84, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, var(--bg-radial), transparent 22%),
    linear-gradient(180deg, #f5f8fc 0%, var(--bg) 38%, #edf2f8 100%);
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.top-shell {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-brand h1 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.top-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.top-tabs {
  padding: 14px 22px 0;
  display: flex;
  gap: 10px;
}

.top-tabs-inline {
  width: 100%;
  padding: 0;
  flex-wrap: wrap;
}

.top-tab {
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
  background: #ecefe5;
  color: var(--muted);
  cursor: pointer;
}

.top-tab.active {
  background: var(--panel);
  color: var(--text);
  border-bottom-color: var(--panel);
}

.tab-page {
  display: none;
  padding: 0;
}

.tab-page.active {
  display: block;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.workspace-shell {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.app-global-sidebar {
  grid-area: auto;
  min-height: calc(100vh - 44px);
  position: sticky;
  top: 22px;
  align-self: start;
}

.workspace-shell > .app-global-sidebar,
.workspace-shell > .app-global-sidebar .side-top-shell {
  height: calc(100vh - 44px);
}

.app-main-content {
  min-width: 0;
  overflow-x: hidden;
}

.graph-shell {
  min-height: auto;
}

.sidebar,
.workspace,
.panel,
.canvas-panel {
  min-width: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(251, 251, 245, 0.92);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-card,
.toolbar-card,
.panel,
.canvas-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2b68dc, #5d8eff);
  box-shadow: 0 16px 30px rgba(49, 103, 213, 0.22);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-card h1,
.canvas-toolbar h2 {
  margin: 4px 0 0;
  font-size: 23px;
}

.toolbar-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

.single-column {
  grid-template-columns: 1fr;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn,
.ghost-btn {
  border-radius: 14px;
  padding: 11px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.primary-btn {
  color: #fff;
  border-color: rgba(38, 92, 203, 0.76);
  background: linear-gradient(135deg, var(--accent), #5f90f2);
  box-shadow: 0 14px 28px rgba(47, 111, 237, 0.2);
}

.ghost-btn {
  color: var(--text);
  border-color: rgba(194, 206, 221, 0.84);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.ghost-btn.active {
  border-color: rgba(130, 165, 232, 0.88);
  background: rgba(233, 240, 255, 0.96);
  color: var(--accent-strong);
}

.primary-btn:hover,
.ghost-btn:hover,
.page-item:hover,
.link-item:hover {
  transform: translateY(-1px);
}

.primary-btn:hover {
  box-shadow: 0 18px 32px rgba(47, 111, 237, 0.24);
}

.primary-btn.danger {
  border-color: rgba(192, 68, 68, 0.84);
  background: linear-gradient(135deg, #cf4d4d, #e27a7a);
  box-shadow: 0 14px 28px rgba(207, 77, 77, 0.18);
}

.primary-btn.danger:hover {
  box-shadow: 0 18px 32px rgba(207, 77, 77, 0.22);
}

.ghost-btn:hover {
  border-color: rgba(166, 184, 206, 0.96);
  background: rgba(255, 255, 255, 0.94);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.preview-subtitle {
  line-height: 1.65;
}

.panel-meta {
  font-size: 12px;
  color: var(--muted);
}

.stats-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border-radius: 14px;
  padding: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.search-input {
  width: 100%;
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.subject-manager-btn {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.subject-folder-remove {
  border: 0;
  background: transparent;
  padding: 0;
  color: #76806c;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.preferred-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preferred-folder-row.is-discovered {
  opacity: 0.82;
}

.preferred-folder-actions {
  display: inline-flex;
  align-items: center;
  color: #76806c;
}

.page-list {
  margin-top: 12px;
  max-height: calc(100vh - 390px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-item,
.link-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 13px 14px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

#documentList.page-list {
  max-height: none;
  margin-top: 10px;
}

#documentList {
  padding-right: 4px;
}

.doc-group + .doc-group {
  margin-top: 12px;
}

.doc-group-title {
  margin: 2px 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #607454;
}

.doc-tree-group + .doc-tree-group {
  margin-top: 6px;
}

.doc-folder-row,
.doc-file-row {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.doc-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  color: #394135;
}

.doc-folder-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.doc-folder-label {
  font-size: 15px;
  font-weight: 700;
}

.doc-folder-icon,
.doc-file-icon {
  font-size: 15px;
  line-height: 1;
}

.doc-folder-caret {
  font-size: 12px;
  color: #6f7668;
}

.doc-folder-children.hidden {
  display: none;
}

.doc-folder-children {
  margin-left: 18px;
}

.doc-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #31382d;
}

.doc-file-row:hover {
  background: #f3f5ef;
}

.doc-file-row.active {
  background: #dfe4ff;
  box-shadow: inset 3px 0 0 #5a63e8;
}

.doc-file-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.doc-file-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: #6d7566;
}

.page-item.active,
.link-item.active {
  border-color: rgba(121, 156, 222, 0.95);
  background: rgba(238, 244, 255, 0.96);
  box-shadow: 0 12px 24px rgba(79, 111, 190, 0.12);
}

.page-item-title,
.link-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.page-item-meta,
.link-item-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.workspace {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.files-layout,
.ai-layout,
.ai-chat-layout {
  display: grid;
  gap: 18px;
}

.files-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.files-main {
  min-width: 0;
}

.files-layout-classic {
  --files-shell-min: 1320px;
  grid-template-columns: 290px minmax(720px, 1fr) 350px;
  grid-template-areas: "tree browser summary";
  align-items: start;
  gap: 14px;
  min-width: var(--files-shell-min);
  min-height: calc(100vh - 36px);
  padding: 14px;
  border: 1px solid rgba(205, 217, 231, 0.78);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(246, 250, 255, 0.72)),
    linear-gradient(135deg, rgba(237, 243, 252, 0.85), rgba(250, 252, 255, 0.88));
  box-shadow: var(--shadow);
  overflow: visible;
}

.files-sidebar {
  grid-area: sidebar;
  min-width: 0;
  padding: 0;
  border-right: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 190px);
}

.files-sidebar-brand {
  justify-content: flex-start;
}

.workspace-shell > .app-global-sidebar {
  grid-area: auto;
  min-width: 0;
  padding: 0;
  border-right: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 44px);
  position: sticky;
  top: 22px;
  align-self: start;
}

.files-tree-panel {
  grid-area: tree;
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  padding: 20px 18px 18px 20px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(248, 251, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.files-browser-panel {
  grid-area: browser;
  min-height: calc(100vh - 190px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 28px;
  padding: 22px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(44, 69, 109, 0.08);
  overflow: hidden;
}

.files-tree-head,
.files-browser-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(220, 228, 239, 0.94);
}

.files-browser-head {
  align-items: flex-start;
  flex: 0 0 auto;
}

.files-browser-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.files-tree-list {
  flex: 1 1 auto;
  max-height: calc(100vh - 270px);
  margin-top: 0;
  padding-right: 6px;
}

.files-tree-panel .panel-title,
.files-browser-panel .panel-title,
.files-summary-panel .panel-title {
  font-size: 16px;
  font-weight: 800;
  color: #1a3158;
}

.files-browser-search {
  margin-top: 0;
  min-width: 260px;
  width: 100%;
  flex: 1 1 320px;
}

.files-browser-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 1 1 auto;
}

.files-search-hero-panel {
  margin-bottom: 16px;
  padding: 24px 28px;
  background:
    linear-gradient(135deg, rgba(243, 248, 255, 0.98), rgba(255, 255, 255, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.97));
  border: 1px solid rgba(203, 217, 237, 0.9);
  box-shadow: var(--shadow-soft);
}

.files-search-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.files-search-shell-hero {
  gap: 0;
}

.files-search-input-shell-hero {
  gap: 20px;
  padding: 24px 28px;
  border-radius: 34px;
  min-height: 108px;
  border-color: rgba(182, 199, 225, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(245, 249, 255, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(79, 118, 184, 0.08);
}

.files-search-mode-select-hero {
  min-width: 180px;
  min-height: 60px;
  padding: 16px 42px 16px 18px;
  border-radius: 18px;
  font-size: 16px;
}

.files-browser-search-hero {
  font-size: 24px;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: 18px;
}

.files-browser-search-hero::placeholder {
  color: #7a889f;
}

.files-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.files-search-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.files-search-input-shell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(190, 203, 221, 0.96);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.files-search-mode-select {
  flex: 0 0 auto;
  min-width: 112px;
  border: 1px solid rgba(196, 206, 224, 0.96);
  background: rgba(245, 248, 253, 0.98);
  color: #2e4c79;
  border-radius: 12px;
  padding: 9px 34px 9px 12px;
  font-size: 12px;
  font-weight: 700;
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f84aa 50%),
    linear-gradient(135deg, #6f84aa 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.files-search-mode-select:focus {
  outline: none;
  border-color: #87aaf0;
  box-shadow: 0 0 0 3px rgba(135, 170, 240, 0.14);
}

.files-search-meta {
  font-size: 12px;
  color: #71819b;
}

.files-search-upload-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.files-search-upload-btn,
.files-search-clear-btn {
  min-height: 60px;
  padding: 16px 20px;
  font-size: 16px;
  white-space: nowrap;
}

.files-search-upload-btn {
  border-color: rgba(194, 206, 221, 0.92);
  background: rgba(247, 250, 255, 0.98);
  color: #35527f;
  border-radius: 18px;
}

.files-search-clear-btn {
  flex: 0 0 auto;
  border-radius: 18px;
}

.files-search-input-shell .files-browser-search {
  flex: 1 1 auto;
  margin-top: 0;
}

@media (max-width: 900px) {
  .files-search-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .files-search-input-shell {
    flex-wrap: wrap;
  }

  .files-search-upload-shell {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .files-search-clear-btn {
    margin-left: auto;
  }

  .files-search-input-shell-hero {
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    min-height: auto;
  }

  .files-search-mode-select-hero,
  .files-browser-search-hero {
    min-height: 50px;
    font-size: 17px;
  }

  .files-search-upload-btn,
  .files-search-clear-btn {
    min-height: 50px;
    padding: 12px 16px;
    font-size: 14px;
  }
}

.files-search-input-shell .files-browser-search {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 4px;
  min-width: 0;
}

.files-search-input-shell .files-browser-search:focus {
  outline: none;
}

.files-toolbar-row-secondary .subject-manager-btn {
  background: rgba(248, 250, 254, 0.98);
}

.files-toolbar-row-secondary {
  opacity: 0.94;
}

.files-browser-inline {
  padding: 2px 0 4px;
}

.files-process-panel {
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  background:
    linear-gradient(135deg, rgba(245, 249, 255, 0.98), rgba(255, 255, 255, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.97));
  border: 1px solid rgba(208, 220, 235, 0.84);
  box-shadow: var(--shadow-soft);
}

.files-process-panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(224, 231, 242, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.files-process-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.files-process-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(227, 238, 255, 0.98);
  color: #2a67c7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1px rgba(157, 187, 240, 0.42);
}

.files-process-panel-actions {
  flex: 0 0 auto;
}

.files-process-monitor {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.28fr);
  gap: 12px;
  padding: 14px 0 0;
  align-items: stretch;
}

.processing-graph-panel {
  margin-top: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  border: 1px solid rgba(208, 220, 235, 0.84);
  box-shadow: var(--shadow-soft);
}

.processing-graph-panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(224, 231, 242, 0.92);
}

.processing-graph-frame {
  display: block;
  width: 100%;
  min-height: 980px;
  height: 980px;
  max-height: 980px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.92), rgba(249, 251, 255, 0.9));
  margin-top: 14px;
}

.governance-graph-panel {
  margin-top: 14px;
}

.governance-graph-frame {
  min-height: calc(100vh - 250px);
  height: calc(100vh - 250px);
  max-height: calc(100vh - 250px);
}

.governance-graph-layout {
  align-items: stretch;
}

.governance-tree-panel {
  max-width: 280px;
}

.governance-main-column {
  min-width: 0;
}

.governance-content-split {
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(300px, 0.38fr);
  gap: 12px;
  align-items: stretch;
}

.governance-graph-slot {
  min-width: 0;
  width: 100%;
}

.governance-detail-panel {
  margin-top: 14px;
  border: 1px solid rgba(208, 220, 235, 0.84);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  box-shadow: var(--shadow-soft);
  min-width: 0;
  height: 100%;
  min-height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
  max-width: 360px;
}

.governance-detail-panel .files-summary-body {
  min-height: calc(100vh - 360px);
  height: calc(100% - 108px);
  flex: 1 1 auto;
}

.governance-detail-panel .panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(224, 231, 242, 0.92);
}

.governance-detail-panel #graphManagerStatus.upload-status {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .processing-graph-frame {
    min-height: 720px;
    height: 720px;
    max-height: 720px;
  }

  .governance-graph-frame {
    min-height: 520px;
    height: 520px;
    max-height: 520px;
  }

  .governance-content-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .governance-detail-panel .files-summary-body {
    min-height: 420px;
  }
}

@media (max-width: 1400px) {
  .governance-content-split {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.6fr);
  }
}

.files-process-card {
  min-width: 0;
  padding: 12px;
  border-radius: 20px;
  min-height: 168px;
  height: 252px;
  max-height: 252px;
  border: 1px solid rgba(210, 220, 233, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.96));
  box-shadow: 0 12px 24px rgba(114, 137, 175, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
}

.files-process-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(224, 231, 242, 0.92);
}

.files-process-card-body {
  margin-top: 8px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: #53657f;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.files-process-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 1px 3px;
}

.files-process-hero-main {
  min-width: 0;
  flex: 1;
}

.files-process-hero-title {
  font-size: 11px;
  font-weight: 800;
  color: #23446f;
  line-height: 1.3;
}

.files-process-hero-meta {
  margin-top: 1px;
  font-size: 9px;
  color: #6f83a1;
}

.files-process-hero-rate {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: #2b66c8;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(231, 239, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(171, 194, 241, 0.68);
}

.files-process-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(245, 248, 252, 0.9);
  color: #7d8ba0;
}

.files-process-progress-shell {
  padding: 5px 7px 6px;
  border-radius: 10px;
  border: 1px solid rgba(216, 224, 236, 0.92);
  background: rgba(251, 252, 249, 0.94);
}

.files-process-progress-shell.compact-hero {
  padding: 5px 7px 6px;
}

.files-process-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.files-process-progress-text,
.files-process-progress-meta {
  font-size: 10px;
  font-weight: 700;
  color: #66755e;
}

.files-process-progress-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-process-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(226, 231, 240, 0.95);
  color: #6e7f97;
}

.files-process-badge.pending {
  background: rgba(230, 234, 241, 0.95);
  color: #6f7d91;
}

.files-process-badge.running {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
  box-shadow: 0 0 0 4px rgba(45, 110, 216, 0.08);
}

.files-process-badge.success {
  background: rgba(222, 244, 230, 0.96);
  color: #2f7b4b;
}

.files-process-badge.error {
  background: rgba(255, 232, 232, 0.96);
  color: #c84c4c;
}

.files-process-progress-track {
  margin-top: 4px;
  height: 5px;
  border-radius: 999px;
  background: rgba(217, 222, 212, 0.72);
  overflow: hidden;
}

.files-process-progress-track.compact {
  margin-top: 6px;
}

.files-process-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9dfd2, #cfd8c6);
}

.files-process-progress-bar-accent {
  background: linear-gradient(90deg, #8bb6ff, #4d87ec 45%, #b2cbff 100%);
  background-size: 180px 100%;
  animation: files-process-running-shimmer 2s linear infinite;
}

.files-process-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.files-process-section.compact {
  gap: 3px;
}

.files-process-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #5f7394;
  text-transform: uppercase;
}

.files-process-stage-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.files-process-stage {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 5px;
  border-radius: 7px;
  border: 1px solid rgba(226, 233, 244, 0.9);
  background: rgba(247, 250, 255, 0.9);
}

.files-process-stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #b7c3d8;
  flex: 0 0 auto;
}

.files-process-stage-label {
  min-width: 0;
  font-size: 9px;
  font-weight: 700;
  color: #63748d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-process-stage.done .files-process-stage-dot {
  background: #5eb77b;
  box-shadow: 0 0 0 3px rgba(94, 183, 123, 0.12);
}

.files-process-stage.done .files-process-stage-label {
  color: #2f7b4b;
}

.files-process-stage.active {
  background: rgba(231, 240, 255, 0.98);
  border-color: rgba(175, 197, 238, 0.92);
}

.files-process-stage.active .files-process-stage-dot {
  background: #3478f6;
  box-shadow: 0 0 0 4px rgba(52, 120, 246, 0.14);
}

.files-process-stage.active .files-process-stage-label {
  color: #1f58ba;
}

.files-process-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
}

.files-process-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(223, 231, 243, 0.9);
  background: rgba(246, 249, 254, 0.92);
}

.files-process-row.active {
  background: rgba(230, 239, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(164, 188, 236, 0.34);
}

.files-process-row.success {
  background: rgba(234, 248, 239, 0.96);
}

.files-process-row[data-process-open-slug] {
  cursor: pointer;
}

.files-process-row[data-process-open-slug]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(112, 129, 159, 0.08);
}

.files-process-name {
  min-width: 0;
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  color: #243f67;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-process-meta {
  flex: 0 0 auto;
  font-size: 9px;
  color: #7c8ca5;
}

.files-process-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(226, 231, 240, 0.95);
  color: #6e7f97;
  font-size: 10px;
  font-weight: 800;
}

.files-process-state.pending {
  background: rgba(230, 234, 241, 0.95);
  color: #6f7d91;
}

.files-process-state.running {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
}

.files-process-state.success {
  background: rgba(222, 244, 230, 0.96);
  color: #2f7b4b;
}

.files-process-state.error {
  background: rgba(255, 232, 232, 0.96);
  color: #c84c4c;
}

.files-process-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.files-process-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.files-process-inline-meta {
  font-size: 11px;
  color: #74849b;
}

.files-process-detail-item {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(243, 247, 253, 0.9);
}

.files-process-detail-item.metric {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(216, 225, 239, 0.96);
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98), rgba(239, 244, 252, 0.95));
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  color: #1e385f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.files-process-detail-grid .files-process-detail-item.metric:nth-child(1) {
  color: #6b7280;
  background: linear-gradient(180deg, rgba(249, 250, 252, 0.98), rgba(241, 244, 248, 0.96));
}

.files-process-detail-grid .files-process-detail-item.metric:nth-child(2) {
  color: #1f5eb8;
  background: linear-gradient(180deg, rgba(238, 245, 255, 0.99), rgba(229, 239, 255, 0.95));
}

.files-process-detail-grid .files-process-detail-item.metric:nth-child(3) {
  color: #25704a;
  background: linear-gradient(180deg, rgba(239, 248, 242, 0.99), rgba(230, 244, 235, 0.95));
}

.files-process-detail-item span {
  display: block;
  font-size: 11px;
  color: #7a8aa3;
}

.files-process-detail-item strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #1e385f;
  word-break: break-word;
}

.files-process-summary {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(246, 249, 255, 0.94);
  line-height: 1.65;
  color: #495d78;
}

.files-process-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.files-process-token {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(232, 238, 247, 0.95);
  color: #52657f;
  font-size: 11px;
}

.files-process-token.muted {
  color: #8493a8;
}

.files-process-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 328px;
  overflow: auto;
  padding: 2px 2px 2px 4px;
}

.files-process-log-list.live-stream {
  scroll-behavior: smooth;
}

.files-process-log-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(247, 249, 253, 0.96);
  border-left: 3px solid rgba(180, 193, 216, 0.82);
  position: relative;
}

.files-process-log-item.success {
  background: rgba(233, 247, 238, 0.94);
  border-left-color: rgba(62, 153, 99, 0.9);
}

.files-process-log-item.error {
  background: rgba(252, 236, 236, 0.96);
  border-left-color: rgba(205, 87, 87, 0.92);
}

.files-process-log-time {
  flex: 0 0 auto;
  min-width: 54px;
  font-size: 10px;
  font-weight: 700;
  color: #8a97aa;
}

.files-process-log-step {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(225, 235, 249, 0.98);
  color: #3a5f97;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96);
  position: relative;
  z-index: 1;
}

.files-process-log-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
  min-width: 56px;
}

.files-process-log-rail::after {
  content: "";
  position: absolute;
  top: 60px;
  bottom: -18px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(196, 208, 227, 0.9), rgba(224, 231, 242, 0.18));
}

.files-process-log-item:last-child .files-process-log-rail::after {
  display: none;
}

.files-process-log-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  background: rgba(232, 238, 247, 0.98);
  color: #61748f;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96);
}

.files-process-log-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 1px;
}

.files-process-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.files-process-log-stage {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(232, 238, 247, 0.98);
  color: #5e708a;
  font-size: 10px;
  font-weight: 800;
}

.files-process-log-file {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: #234878;
  word-break: break-word;
}

.files-process-log-text {
  min-width: 0;
  line-height: 1.45;
  color: #4b607d;
  font-size: 11px;
}

.files-process-log-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.files-process-log-meta-row.backend {
  margin-top: 6px;
}

.files-process-log-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(240, 244, 250, 0.96);
  color: #6d7f98;
  font-size: 10px;
  font-weight: 700;
}

.files-process-log-meta-chip.backend {
  background: rgba(230, 238, 252, 0.96);
  color: #48658f;
}

.files-process-log-item.success .files-process-log-dot,
.files-process-log-item.success .files-process-log-stage {
  background: rgba(216, 245, 226, 0.98);
  color: #17753d;
}

.files-process-log-item.error .files-process-log-dot,
.files-process-log-item.error .files-process-log-stage {
  background: rgba(255, 226, 226, 0.98);
  color: #c53232;
}

.files-process-log-item.live .files-process-log-dot {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
  animation: files-process-log-pulse 1.6s ease-in-out infinite;
}

.files-process-log-item.live .files-process-log-step {
  background: rgba(217, 232, 255, 0.98);
  color: #215fc2;
  animation: files-process-log-pulse 1.6s ease-in-out infinite;
}

.files-process-log-item.live .files-process-log-stage {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
}

.files-process-log-item.spotlight {
  background: linear-gradient(180deg, rgba(233, 241, 255, 0.98), rgba(245, 249, 255, 0.98));
  border-left-color: rgba(76, 131, 232, 0.95);
  box-shadow: 0 0 0 2px rgba(99, 149, 237, 0.2), 0 10px 22px rgba(99, 126, 170, 0.1);
}

.files-process-log-item[data-process-log-file],
.files-process-log-item[data-process-log-slug] {
  cursor: pointer;
}

.files-process-log-item[data-process-log-file]:hover,
.files-process-log-item[data-process-log-slug]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(112, 129, 159, 0.08);
}

.files-process-log-item.success .files-process-log-rail::after {
  background: linear-gradient(180deg, rgba(62, 153, 99, 0.55), rgba(196, 231, 208, 0.12));
}

.files-process-log-item.error .files-process-log-rail::after {
  background: linear-gradient(180deg, rgba(205, 87, 87, 0.45), rgba(248, 214, 214, 0.12));
}

@keyframes files-process-log-pulse {
  0% {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96), 0 0 0 0 rgba(45, 110, 216, 0.16);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96), 0 0 0 10px rgba(45, 110, 216, 0);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.96), 0 0 0 0 rgba(45, 110, 216, 0);
  }
}

.upload-status-highlight {
  color: #1f5f33;
  background: rgba(234, 247, 238, 0.94);
  border-color: rgba(137, 193, 154, 0.92);
  box-shadow: 0 0 0 3px rgba(137, 193, 154, 0.12);
}

.files-process-current-card {
  padding: 12px 13px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(236, 243, 255, 0.96), rgba(245, 249, 255, 0.94));
  border: 1px solid rgba(198, 214, 240, 0.92);
}

.files-process-current-card.running {
  background: linear-gradient(180deg, rgba(229, 239, 255, 0.98), rgba(242, 247, 255, 0.96));
  box-shadow: 0 10px 26px rgba(93, 126, 182, 0.12);
}

.files-process-current-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.files-process-current-title {
  font-size: 13px;
  font-weight: 800;
  color: #214b85;
  line-height: 1.5;
  word-break: break-word;
}

.files-process-current-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: #6b7f9b;
}

.files-process-current-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.files-process-current-stat {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(208, 219, 238, 0.9);
}

.files-process-current-stat span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #7890b0;
  letter-spacing: 0.03em;
}

.files-process-current-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: #214b85;
  word-break: break-word;
}

.files-process-live-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(32, 104, 220, 0.1);
  color: #1f62cf;
  font-size: 11px;
  font-weight: 800;
}

.files-process-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2d6ed8;
  box-shadow: 0 0 0 0 rgba(45, 110, 216, 0.35);
  animation: files-process-live-dot 1.6s ease-in-out infinite;
}

.files-process-running-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(194, 210, 239, 0.9);
}

.files-process-running-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.files-process-running-copy strong {
  font-size: 12px;
  color: #214b85;
}

.files-process-running-copy span {
  font-size: 11px;
  line-height: 1.5;
  color: #6a7f9a;
}

.files-process-running-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(205, 218, 240, 0.7);
}

.files-process-running-fill {
  height: 100%;
  min-width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #78a7f8, #4a83e8);
  background-size: 160px 100%;
  animation: files-process-running-shimmer 1.8s linear infinite;
}

.files-process-running-fill.pdf {
  background: linear-gradient(90deg, #8bb6ff, #4d87ec 45%, #9fc1ff 100%);
}

.files-process-running-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.files-process-running-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(233, 240, 252, 0.96);
  color: #456a9f;
  font-size: 10px;
  font-weight: 700;
}

@keyframes files-process-live-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 110, 216, 0.35);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(45, 110, 216, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 110, 216, 0);
  }
}

@keyframes files-process-running-shimmer {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 160px 0;
  }
}

.files-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(200, 214, 236, 0.92);
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.96), rgba(234, 242, 255, 0.92));
}

.files-batch-meta {
  font-size: 12px;
  font-weight: 700;
  color: #305b9a;
}

.files-batch-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.files-batch-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(214, 223, 238, 0.92);
  background: rgba(248, 251, 255, 0.94);
}

.files-batch-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.files-batch-result-title {
  font-size: 13px;
  font-weight: 800;
  color: #234677;
}

.files-batch-result-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.files-process-console {
  margin-top: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  background: #18212f;
  border: 1px solid rgba(76, 95, 126, 0.4);
  font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
}

.files-process-console-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.files-process-console-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.files-process-console-copy {
  padding: 7px 10px;
  min-height: 32px;
}

.files-process-console-line {
  display: grid;
  grid-template-columns: 152px 56px 140px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(115, 134, 168, 0.16);
  color: #d7e1f3;
  font-size: 11px;
  line-height: 1.55;
}

.files-process-console-line:last-child {
  border-bottom: 0;
}

.files-process-console-time {
  color: #8ea5ca;
}

.files-process-console-level {
  font-weight: 800;
  color: #8fc4ff;
}

.files-process-console-logger {
  color: #9cb0cf;
  word-break: break-word;
}

.files-process-console-text {
  color: #eef4ff;
  word-break: break-word;
  white-space: pre-wrap;
}

.files-process-console-line.tone-warning .files-process-console-level {
  color: #ffd27a;
}

.files-process-console-line.tone-error .files-process-console-level,
.files-process-console-line.tone-critical .files-process-console-level {
  color: #ff9a9a;
}

.files-batch-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(241, 246, 253, 0.96);
}

.files-batch-result-item.success {
  background: rgba(233, 247, 238, 0.94);
}

.files-batch-result-item.error {
  background: rgba(252, 236, 236, 0.96);
}

.files-batch-result-item.info {
  background: rgba(234, 242, 255, 0.96);
}

.files-batch-result-label {
  min-width: 0;
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #28496f;
  word-break: break-word;
}

.files-batch-result-note {
  flex: 0 0 auto;
  font-size: 11px;
  color: #6f829d;
}

.files-batch-result-empty {
  font-size: 12px;
  color: #78879d;
}

.files-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 128px));
  gap: 14px;
  align-content: start;
  min-height: 420px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 8px 0;
  justify-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 175, 205, 0.9) rgba(236, 241, 248, 0.9);
}

.files-card-grid::-webkit-scrollbar {
  width: 10px;
}

.files-card-grid::-webkit-scrollbar-track {
  background: rgba(236, 241, 248, 0.9);
  border-radius: 999px;
}

.files-card-grid::-webkit-scrollbar-thumb {
  background: rgba(156, 175, 205, 0.92);
  border-radius: 999px;
  border: 2px solid rgba(236, 241, 248, 0.9);
}

.files-card-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(131, 154, 190, 0.96);
}

.selection-box {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  border: 1px solid rgba(61, 126, 240, 0.78);
  background: rgba(61, 126, 240, 0.16);
  border-radius: 10px;
}

.file-card {
  position: relative;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 8px 8px;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease;
  min-height: 118px;
}

.file-card-select {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 166, 198, 0.92);
  background: rgba(255, 255, 255, 0.96);
  color: transparent;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(80, 96, 124, 0.1);
  z-index: 2;
}

.file-card-select.selected {
  border-color: #3d7ef0;
  background: #3d7ef0;
  color: #fff;
}

.file-card:hover {
  transform: none;
  border-color: rgba(194, 208, 233, 0.96);
  background: rgba(242, 247, 255, 0.96);
}

.file-card.active {
  border-color: #9dbbf0;
  box-shadow: inset 0 0 0 1px rgba(157, 187, 240, 0.24);
  background: rgba(235, 243, 255, 0.98);
}

.file-card.processing {
  border-color: rgba(90, 140, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(90, 140, 255, 0.22), 0 0 0 3px rgba(90, 140, 255, 0.1);
  background: linear-gradient(180deg, rgba(236, 243, 255, 0.98), rgba(247, 250, 255, 0.96));
}

.file-card.completed {
  background: linear-gradient(180deg, rgba(243, 251, 245, 0.98), rgba(252, 254, 252, 0.96));
}

.file-card.pending {
  background: linear-gradient(180deg, rgba(248, 249, 252, 0.96), rgba(252, 253, 255, 0.96));
}

.file-card.dragging {
  opacity: 0.52;
  border-color: rgba(115, 153, 225, 0.92);
  background: rgba(232, 241, 255, 0.96);
}

.file-card {
  min-height: 144px;
}

.file-card.file-card-tone-slate {
  border-top: 3px solid rgba(92, 112, 140, 0.55);
}

.file-card.file-card-tone-blue {
  border-top: 3px solid rgba(59, 130, 246, 0.52);
}

.file-card.file-card-tone-amber {
  border-top: 3px solid rgba(242, 174, 46, 0.58);
}

.file-card.file-card-tone-green {
  border-top: 3px solid rgba(33, 163, 102, 0.56);
}

.file-card.file-card-tone-violet {
  border-top: 3px solid rgba(139, 92, 246, 0.56);
}

.file-card.file-card-tone-rose {
  border-top: 3px solid rgba(239, 93, 122, 0.54);
}

.file-card.file-card-tone-teal {
  border-top: 3px solid rgba(20, 184, 166, 0.56);
}

.file-card.file-card-tone-slate .file-card-title {
  color: #33465d;
}

.file-card.file-card-tone-blue .file-card-title {
  color: #1f4f95;
}

.file-card.file-card-tone-amber .file-card-title {
  color: #8f5b00;
}

.file-card.file-card-tone-green .file-card-title {
  color: #176244;
}

.file-card.file-card-tone-violet .file-card-title {
  color: #5b3ca8;
}

.file-card.file-card-tone-rose .file-card-title {
  color: #9b3350;
}

.file-card.file-card-tone-teal .file-card-title {
  color: #136a63;
}

.file-card-icon {
  position: relative;
  width: 64px;
  height: 78px;
  border-radius: 16px;
  margin: 0 auto 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
  border: 1px solid rgba(171, 184, 202, 0.72);
  box-shadow: 0 10px 22px rgba(82, 101, 124, 0.08);
  overflow: hidden;
}

.file-card-icon.pdf {
  background: linear-gradient(180deg, #fff8f8, #fff0f1);
  border-color: rgba(244, 135, 145, 0.64);
}

.file-card-icon.video {
  background: linear-gradient(180deg, #f7fbff, #eef7ff);
  border-color: rgba(112, 177, 216, 0.62);
}

.file-card-icon.excel {
  background: linear-gradient(180deg, #f5fff9, #edf9f1);
  border-color: rgba(91, 184, 130, 0.6);
}

.file-card-icon.ppt {
  background: linear-gradient(180deg, #fff9f4, #fff1e8);
  border-color: rgba(235, 154, 88, 0.62);
}

.file-card-icon.image {
  background: linear-gradient(180deg, #f5fcff, #eaf8fb);
  border-color: rgba(92, 179, 198, 0.6);
}

.file-card-icon.html {
  background: linear-gradient(180deg, #fffbf5, #fff3df);
  border-color: rgba(223, 168, 73, 0.62);
}

.file-card-icon.text {
  background: linear-gradient(180deg, #fbfcfe, #f3f6fa);
  border-color: rgba(154, 166, 184, 0.58);
}

.file-card-icon.generic {
  background: linear-gradient(180deg, #ffffff, #f5f7fa);
  border-color: rgba(160, 170, 185, 0.58);
}

.file-card-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 19px;
  height: 19px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(225, 234, 244, 0.72));
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  border-left: 1px solid rgba(156, 170, 188, 0.42);
  border-bottom: 1px solid rgba(156, 170, 188, 0.42);
}

.file-card-badge {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 8px;
  top: auto;
  min-width: 0;
  height: 20px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  box-shadow: none;
  z-index: 3;
}

.file-card-icon.word .file-card-badge {
  background: #4f83e6;
}

.file-card-icon.video .file-card-badge {
  background: #4fa3d9;
}

.file-card-icon.ppt .file-card-badge {
  background: #e98b4a;
}

.file-card-icon.excel .file-card-badge {
  background: #4fb879;
}

.file-card-icon.pdf .file-card-badge {
  background: #e95f6b;
  color: #ffffff;
}

.file-card-icon.markdown .file-card-badge {
  left: 9px;
  right: 9px;
  bottom: 8px;
  min-width: 0;
  height: 20px;
  padding: 0 6px;
  border-radius: 8px;
  background: #6f91c9;
  font-size: 10px;
}

.file-card-icon.zip .file-card-badge {
  background: #9284d8;
}

.file-card-icon.image .file-card-badge,
.file-card-icon.html .file-card-badge,
.file-card-icon.text .file-card-badge,
.file-card-icon.generic .file-card-badge {
  bottom: 8px;
}

.file-card-icon.image .file-card-badge {
  background: #4eb3c4;
}

.file-card-icon.html .file-card-badge {
  background: #d99b42;
}

.file-card-icon.text .file-card-badge,
.file-card-icon.generic .file-card-badge {
  background: #8998ab;
}

.file-card-paper-mark,
.file-card-paper-lines {
  position: absolute;
  pointer-events: none;
}

.file-card-paper-mark {
  right: 11px;
  bottom: 32px;
  width: 30px;
  height: 26px;
  border-radius: 9px;
  background: rgba(220, 231, 246, 0.68);
}

.file-card-paper-lines {
  left: 12px;
  right: 12px;
  top: 16px;
  bottom: 32px;
  background:
    linear-gradient(rgba(165, 181, 204, 0.64), rgba(165, 181, 204, 0.64)) 0 6px / 34px 2px no-repeat,
    linear-gradient(rgba(165, 181, 204, 0.42), rgba(165, 181, 204, 0.42)) 0 17px / 28px 2px no-repeat,
    linear-gradient(rgba(165, 181, 204, 0.34), rgba(165, 181, 204, 0.34)) 0 28px / 36px 2px no-repeat;
  z-index: 1;
}

.file-card-icon.word .file-card-paper-mark {
  left: 15px;
  right: auto;
  bottom: 31px;
  width: 34px;
  height: 27px;
  background:
    linear-gradient(rgba(79, 131, 230, 0.28), rgba(79, 131, 230, 0.28)) 0 3px / 100% 6px no-repeat,
    linear-gradient(rgba(79, 131, 230, 0.2), rgba(79, 131, 230, 0.2)) 0 15px / 82% 6px no-repeat,
    rgba(79, 131, 230, 0.08);
}

.file-card-icon.video .file-card-paper-mark {
  left: 13px;
  right: auto;
  bottom: 32px;
  width: 38px;
  height: 27px;
  border-radius: 10px;
  background: rgba(79, 163, 217, 0.18);
  border: 1px solid rgba(79, 163, 217, 0.36);
}

.file-card-icon.video .file-card-paper-mark::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 6px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #4fa3d9;
}

.file-card-icon.ppt .file-card-paper-mark {
  left: 13px;
  right: auto;
  bottom: 31px;
  width: 40px;
  height: 30px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 69% 42%, rgba(233, 139, 74, 0.38) 0 8px, transparent 9px),
    linear-gradient(90deg, rgba(233, 139, 74, 0.22) 0 35%, rgba(233, 139, 74, 0.1) 35% 100%);
}

.file-card-icon.excel .file-card-paper-mark {
  left: 13px;
  right: auto;
  bottom: 31px;
  width: 39px;
  height: 31px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(79, 184, 121, 0.34), rgba(79, 184, 121, 0.34)) 0 10px / 100% 1px no-repeat,
    linear-gradient(rgba(79, 184, 121, 0.28), rgba(79, 184, 121, 0.28)) 0 20px / 100% 1px no-repeat,
    linear-gradient(rgba(79, 184, 121, 0.28), rgba(79, 184, 121, 0.28)) 13px 0 / 1px 100% no-repeat,
    linear-gradient(rgba(79, 184, 121, 0.28), rgba(79, 184, 121, 0.28)) 26px 0 / 1px 100% no-repeat,
    rgba(79, 184, 121, 0.1);
}

.file-card-icon.pdf .file-card-paper-mark {
  display: none;
}

.file-card-icon.markdown .file-card-paper-mark {
  left: 17px;
  right: auto;
  top: 18px;
  bottom: auto;
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: #6f91c9;
  clip-path: polygon(50% 100%, 0 44%, 28% 44%, 28% 0, 72% 0, 72% 44%, 100% 44%);
  box-shadow: none;
  z-index: 2;
}

.file-card-icon.markdown .file-card-paper-lines {
  background:
    linear-gradient(rgba(211, 220, 233, 0.9), rgba(211, 220, 233, 0.9)) 44px 18px / 10px 2px no-repeat,
    linear-gradient(rgba(211, 220, 233, 0.84), rgba(211, 220, 233, 0.84)) 44px 27px / 10px 2px no-repeat,
    linear-gradient(rgba(211, 220, 233, 0.8), rgba(211, 220, 233, 0.8)) 44px 36px / 10px 2px no-repeat;
}

.file-card-icon.image .file-card-paper-mark {
  left: 11px;
  right: auto;
  top: 16px;
  bottom: auto;
  width: 42px;
  height: 32px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 72% 24%, #ffe998 0 4px, transparent 5px),
    linear-gradient(135deg, transparent 0 44%, rgba(67, 172, 139, 0.78) 45% 66%, transparent 67%),
    linear-gradient(45deg, transparent 0 50%, rgba(54, 146, 123, 0.72) 51% 70%, transparent 71%),
    linear-gradient(180deg, #cfefff, #e7fbff);
  border: 1px solid rgba(78, 179, 196, 0.28);
}

.file-card-icon.html .file-card-paper-mark {
  left: 14px;
  right: auto;
  top: 18px;
  bottom: auto;
  width: 36px;
  height: 32px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(217, 155, 66, 0.82) 36% 42%, transparent 43% 100%),
    linear-gradient(225deg, transparent 0 35%, rgba(217, 155, 66, 0.82) 36% 42%, transparent 43% 100%);
}

.file-card-icon.text .file-card-paper-mark,
.file-card-icon.generic .file-card-paper-mark {
  display: none;
}

.file-card-icon.image .file-card-paper-lines,
.file-card-icon.html .file-card-paper-lines,
.file-card-icon.video .file-card-paper-lines {
  display: none;
}

.file-card-icon.pdf .file-card-paper-lines {
  background:
    linear-gradient(rgba(233, 95, 107, 0.34), rgba(233, 95, 107, 0.34)) 0 6px / 34px 2px no-repeat,
    linear-gradient(rgba(233, 95, 107, 0.24), rgba(233, 95, 107, 0.24)) 0 17px / 30px 2px no-repeat,
    linear-gradient(rgba(233, 95, 107, 0.18), rgba(233, 95, 107, 0.18)) 0 28px / 36px 2px no-repeat;
}

.file-card-icon.text .file-card-paper-lines,
.file-card-icon.generic .file-card-paper-lines {
  background:
    linear-gradient(rgba(112, 124, 142, 0.78), rgba(112, 124, 142, 0.78)) 8px 8px / calc(100% - 16px) 2px no-repeat,
    linear-gradient(rgba(112, 124, 142, 0.58), rgba(112, 124, 142, 0.58)) 8px 19px / calc(100% - 22px) 2px no-repeat,
    linear-gradient(rgba(112, 124, 142, 0.5), rgba(112, 124, 142, 0.5)) 8px 30px / calc(100% - 18px) 2px no-repeat,
    linear-gradient(rgba(112, 124, 142, 0.42), rgba(112, 124, 142, 0.42)) 8px 41px / calc(100% - 28px) 2px no-repeat;
}

.file-card-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #19355d;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0;
}

.file-card-subtitle {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.35;
  color: #6f8096;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 27px;
}

.file-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 10px rgba(80, 96, 124, 0.14);
}

.files-browser-panel {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.files-browser-panel.browser-tone-slate {
  border-color: rgba(191, 202, 217, 0.9);
  box-shadow: inset 0 1px 0 rgba(92, 112, 140, 0.06);
}

.files-browser-panel.browser-tone-blue {
  border-color: rgba(182, 207, 243, 0.94);
  box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.08);
}

.files-browser-panel.browser-tone-amber {
  border-color: rgba(243, 221, 173, 0.94);
  box-shadow: inset 0 1px 0 rgba(242, 174, 46, 0.08);
}

.files-browser-panel.browser-tone-green {
  border-color: rgba(188, 225, 207, 0.94);
  box-shadow: inset 0 1px 0 rgba(33, 163, 102, 0.08);
}

.files-browser-panel.browser-tone-violet {
  border-color: rgba(212, 199, 245, 0.94);
  box-shadow: inset 0 1px 0 rgba(139, 92, 246, 0.08);
}

.files-browser-panel.browser-tone-rose {
  border-color: rgba(245, 202, 212, 0.94);
  box-shadow: inset 0 1px 0 rgba(239, 93, 122, 0.08);
}

.files-browser-panel.browser-tone-teal {
  border-color: rgba(183, 231, 224, 0.94);
  box-shadow: inset 0 1px 0 rgba(20, 184, 166, 0.08);
}

.file-card-status.done {
  background: #22b35c;
}

.file-card-status.draft {
  background: #ff8a1e;
}

.file-card-status.idle {
  background: #97a5bc;
}

.doc-tree-group {
  padding: 4px 0 8px;
}

.doc-folder-row {
  border-radius: 14px;
  padding: 10px 12px;
  color: #30435e;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.doc-folder-row:hover {
  background: rgba(232, 239, 252, 0.8);
}

.doc-folder-row.drag-target {
  background: rgba(221, 235, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(120, 162, 236, 0.44);
}

.doc-folder-main {
  gap: 8px;
}

.doc-folder-label {
  font-size: 14px;
  font-weight: 800;
}

.doc-folder-children {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(208, 218, 235, 0.9);
}

.doc-file-row {
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 14px;
}

.doc-file-row:hover {
  background: rgba(239, 244, 253, 0.86);
}

.doc-file-row.active {
  background: linear-gradient(180deg, rgba(227, 237, 255, 0.96), rgba(217, 230, 255, 0.94));
  box-shadow: inset 3px 0 0 #5a8ef0;
}

.doc-file-name {
  font-size: 13px;
  line-height: 1.5;
}

.doc-file-subtitle {
  color: #7a88a1;
}

.side-top-shell {
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 20px;
  min-height: calc(100vh - 190px);
  border-radius: 30px;
  border: 1px solid rgba(205, 217, 231, 0.76);
  background:
    radial-gradient(circle at top right, rgba(219, 232, 252, 0.96), transparent 34%),
    radial-gradient(circle at bottom left, rgba(241, 247, 255, 0.92), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.96));
  box-shadow: 0 26px 54px rgba(56, 78, 117, 0.1);
}

.side-top-shell .top-tab {
  border-radius: 14px;
  padding: 14px 16px;
}

.side-top-shell .top-brand {
  align-items: flex-start;
  gap: 12px;
}

.side-top-shell .top-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-top-shell .brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(135deg, #2f6fed, #76a1ff);
  box-shadow: 0 16px 30px rgba(47, 111, 237, 0.28);
}

.side-top-shell .top-brand h1 {
  font-size: 22px;
  line-height: 1.2;
  margin-top: 2px;
  color: #183053;
  letter-spacing: -0.03em;
}

.side-top-shell .top-badges {
  justify-content: flex-start;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.side-top-shell .eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #6f7f99;
}

.side-top-shell .preview-subtitle {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #64748a;
}

.side-top-shell .status-badge {
  border: 1px solid rgba(196, 214, 240, 0.82);
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.72);
  color: #2c5fae;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.side-top-shell .status-badge:not(:first-child) {
  background: rgba(244, 247, 253, 0.92);
  color: #60708a;
  font-weight: 600;
}

.ai-process-panel {
  border: 1px solid rgba(214, 223, 238, 0.92);
  border-radius: 18px;
  background: rgba(251, 253, 255, 0.92);
  padding: 14px 12px 12px;
}

.ai-process-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(224, 231, 242, 0.92);
}

.ai-process-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.ai-process-action-btn {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #587097;
  border-color: rgba(203, 214, 232, 0.92);
  background: rgba(255, 255, 255, 0.88);
}

.ai-process-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ai-process-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: #53657f;
}

.ai-process-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-process-hero,
.ai-process-folder-hero {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(236, 244, 255, 0.98), rgba(229, 239, 255, 0.9));
  border: 1px solid rgba(188, 209, 242, 0.88);
}

.ai-process-hero-top,
.ai-process-folder-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ai-process-hero-title,
.ai-process-folder-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  color: #1f4c95;
  word-break: break-word;
}

.ai-process-hero-subtitle,
.ai-process-folder-caption,
.ai-process-hero-foot {
  font-size: 11px;
  color: #647a99;
}

.ai-process-hero-rate,
.ai-process-folder-rate {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  color: #215fc5;
}

.ai-process-progress-track {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(196, 212, 239, 0.72);
  overflow: hidden;
}

.ai-process-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4d8cff, #6aa4ff);
}

.ai-process-hero-foot {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-process-folder-caption {
  margin-top: 8px;
}

.ai-process-folder-live {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ai-process-folder-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.ai-process-folder-live.pending {
  background: rgba(231, 235, 242, 0.96);
  color: #6f7d91;
}

.ai-process-folder-live.running {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
}

.ai-process-folder-live.running::before {
  box-shadow: 0 0 0 4px rgba(45, 110, 216, 0.14);
  animation: ai-process-pulse 1.2s ease-in-out infinite;
}

.ai-process-folder-live.success {
  background: rgba(222, 244, 230, 0.96);
  color: #2f7b4b;
}

.ai-process-folder-live.error {
  background: rgba(255, 232, 232, 0.96);
  color: #c84c4c;
}

.ai-process-section-title,
.ai-process-mini-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #6c7c95;
}

.ai-process-file-list,
.ai-process-related-list,
.ai-process-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-process-file-list.compact {
  gap: 5px;
}

.ai-process-stage-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.ai-process-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(244, 247, 252, 0.84);
}

.ai-process-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b7c3d8;
  flex: 0 0 auto;
}

.ai-process-stage-label {
  font-size: 11px;
  font-weight: 700;
  color: #63748d;
}

.ai-process-stage.done .ai-process-stage-dot {
  background: #5eb77b;
}

.ai-process-stage.done .ai-process-stage-label {
  color: #2f7b4b;
}

.ai-process-stage.active {
  background: rgba(229, 239, 255, 0.96);
}

.ai-process-stage.active .ai-process-stage-dot {
  background: #3478f6;
  box-shadow: 0 0 0 4px rgba(52, 120, 246, 0.14);
}

.ai-process-stage.active .ai-process-stage-label {
  color: #1f58ba;
}

.ai-process-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(242, 246, 253, 0.88);
}

.ai-process-file-button {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.ai-process-file-row.compact {
  padding: 6px 7px;
}

.ai-process-file-row.active {
  background: rgba(226, 237, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(164, 188, 236, 0.34);
}

.ai-process-file-row.focus-flash {
  animation: ai-process-focus-flash 0.9s ease;
}

.ai-process-file-row.success {
  background: rgba(233, 247, 238, 0.94);
}

.ai-process-file-name {
  min-width: 0;
  flex: 1;
  font-weight: 700;
  color: #243f67;
  word-break: break-word;
}

.ai-process-file-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(226, 231, 240, 0.95);
  color: #6e7f97;
  font-size: 10px;
  font-weight: 800;
}

.ai-process-file-state.pending {
  background: rgba(230, 234, 241, 0.95);
  color: #6f7d91;
}

.ai-process-file-state.running {
  background: rgba(225, 238, 255, 0.98);
  color: #2d6ed8;
  position: relative;
}

.ai-process-file-state.running::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: currentColor;
  animation: ai-process-pulse 1.2s ease-in-out infinite;
}

.ai-process-file-state.success {
  background: rgba(222, 244, 230, 0.96);
  color: #2f7b4b;
}

.ai-process-file-state.error {
  background: rgba(255, 232, 232, 0.96);
  color: #c84c4c;
}

.ai-process-file-row.success .ai-process-file-name {
  color: #245b3a;
}

.ai-process-file-meta {
  flex: 0 0 auto;
  font-size: 11px;
  color: #7c8ca5;
}

.ai-process-detail-grid,
.ai-process-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-process-detail-item,
.ai-process-stat {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(243, 247, 253, 0.9);
}

.ai-process-detail-item span,
.ai-process-stat span {
  display: block;
  font-size: 11px;
  color: #7a8aa3;
}

.ai-process-detail-item strong,
.ai-process-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #1e385f;
  word-break: break-word;
}

.ai-process-summary {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(246, 249, 255, 0.94);
  line-height: 1.65;
  color: #495d78;
}

.ai-process-current-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-process-current-shell.focus-flash {
  animation: ai-process-detail-flash 0.9s ease;
}

.ai-process-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-process-token,
.ai-process-related-item {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(232, 238, 247, 0.95);
  color: #52657f;
  font-size: 11px;
}

.ai-process-token.muted {
  color: #8493a8;
}

.ai-process-classification-block {
  gap: 10px;
}

.ai-process-classification-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-process-classification-item {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(247, 249, 253, 0.96);
  border: 1px solid rgba(214, 223, 237, 0.92);
}

.ai-process-classification-item span,
.ai-process-classification-line span {
  display: block;
  font-size: 11px;
  color: #7a8aa3;
}

.ai-process-classification-item strong,
.ai-process-classification-line strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: #1f3656;
  word-break: break-word;
}

.ai-process-classification-reason {
  padding: 10px 11px;
  border-left: 3px solid rgba(70, 118, 195, 0.78);
  background: rgba(242, 246, 252, 0.94);
  color: #495d78;
  line-height: 1.7;
}

.ai-process-classification-line {
  padding-top: 8px;
  border-top: 1px solid rgba(219, 226, 237, 0.86);
}

.ai-process-classification-candidates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(219, 226, 237, 0.86);
}

.ai-process-classification-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: #5f7290;
}

.ai-process-classification-candidate {
  display: grid;
  grid-template-columns: minmax(0, 90px) 48px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  background: rgba(250, 252, 255, 0.96);
  border: 1px solid rgba(224, 230, 240, 0.9);
}

.ai-process-classification-candidate strong,
.ai-process-classification-candidate span,
.ai-process-classification-candidate em {
  font-size: 11px;
  line-height: 1.6;
}

.ai-process-classification-candidate strong {
  color: #1f3656;
  font-style: normal;
}

.ai-process-classification-candidate span {
  color: #426489;
  font-weight: 700;
}

.ai-process-classification-candidate em {
  color: #708099;
  font-style: normal;
}

.ai-process-log-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(247, 249, 253, 0.96);
  border-left: 3px solid rgba(180, 193, 216, 0.82);
}

.ai-process-log-item.active {
  background: rgba(230, 239, 255, 0.98);
  border-left-color: rgba(63, 121, 230, 0.9);
}

.ai-process-log-item.success {
  background: rgba(233, 247, 238, 0.94);
  border-left-color: rgba(62, 153, 99, 0.9);
}

.ai-process-log-item.error {
  background: rgba(252, 236, 236, 0.96);
  border-left-color: rgba(205, 87, 87, 0.92);
}

.ai-process-log-time {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: #8a97aa;
  min-width: 52px;
}

@media (max-width: 720px) {
  .ai-process-classification-grid,
  .ai-process-detail-grid,
  .ai-process-stats {
    grid-template-columns: 1fr;
  }

  .ai-process-classification-candidate {
    grid-template-columns: 1fr;
  }
}

.ai-process-log-text {
  min-width: 0;
  flex: 1;
  line-height: 1.45;
  color: #4b607d;
  font-size: 11px;
}

.ai-process-log-item.error .ai-process-log-text {
  color: #a14545;
}

@keyframes ai-process-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ai-process-focus-flash {
  0% {
    box-shadow: inset 0 0 0 1px rgba(164, 188, 236, 0.34), 0 0 0 0 rgba(77, 140, 255, 0);
    transform: translateY(0);
  }
  35% {
    box-shadow: inset 0 0 0 1px rgba(105, 154, 239, 0.72), 0 0 0 6px rgba(77, 140, 255, 0.14);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(164, 188, 236, 0.34), 0 0 0 0 rgba(77, 140, 255, 0);
    transform: translateY(0);
  }
}

@keyframes ai-process-detail-flash {
  0% {
    transform: translateY(0);
    opacity: 0.92;
  }
  35% {
    transform: translateY(-2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-process-empty {
  padding: 8px 0;
  color: #8b98ac;
  line-height: 1.6;
}

.top-tabs-inline {
  display: grid;
  gap: 12px;
}

.side-top-shell .top-tab {
  width: 100%;
  border: 1px solid rgba(213, 222, 234, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  color: #40536f;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.side-top-shell .top-tab::before {
  display: inline-block;
  width: 20px;
  margin-right: 10px;
  color: #7d8faa;
  text-align: center;
  font-size: 14px;
}

.side-top-shell .top-tab[data-tab="files"]::before {
  content: "[]";
}

.side-top-shell .top-tab[data-tab="processing"]::before {
  content: "::";
}

.side-top-shell .top-tab[data-tab="graph"]::before {
  content: "<>";
}

.side-top-shell .top-tab[data-tab="governance"]::before {
  content: "O";
}

.side-top-shell .top-tab[data-tab="ai"]::before {
  content: "*";
}

.side-top-shell .top-tab[data-tab="avatar"]::before {
  content: "@";
}

.side-top-shell .top-tab[data-tab="block-writer"]::before {
  content: "+";
}

.side-top-shell .top-tab:hover {
  border-color: rgba(180, 198, 224, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 20px rgba(88, 115, 161, 0.08);
}

.side-top-shell .top-tab.active {
  border-color: rgba(127, 165, 237, 0.9);
  background: linear-gradient(180deg, rgba(235, 242, 255, 0.98), rgba(221, 233, 255, 0.94));
  color: #245fbe;
  box-shadow: 0 14px 28px rgba(78, 116, 191, 0.12), inset 0 0 0 1px rgba(177, 196, 230, 0.35);
}

.side-top-shell .top-tab.active::before {
  color: #2461c8;
}

.files-process-panel .panel-title,
.ai-chat-main-panel .panel-title,
.ai-sidebar-panel .panel-title,
.graph-shell .canvas-toolbar h2 {
  letter-spacing: -0.02em;
}

.files-process-panel-head .panel-title,
.ai-chat-main-panel .panel-title {
  font-size: 18px;
}

.files-process-panel-head .panel-meta,
.files-process-panel-head .preview-subtitle {
  max-width: 70ch;
}

.files-tree-mode-switch {
  padding: 5px;
  border-color: rgba(194, 206, 221, 0.9);
  background: rgba(245, 248, 253, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.files-tree-mode-btn {
  min-height: 34px;
  padding: 8px 14px;
}

.files-tree-mode-btn.active {
  box-shadow: 0 8px 18px rgba(79, 104, 151, 0.14);
}

.files-search-meta,
#graphFootnote,
#graphViewHint,
#aiResultStatus {
  font-size: 12px;
  line-height: 1.6;
}

.node-badge {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.files-editor-actions,
.graph-node-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-tool-top,
.files-process-panel-head,
.graph-shell .canvas-toolbar,
.ai-chat-main-panel .panel-head {
  align-items: flex-start;
}

.graph-stage-foot {
  padding: 4px 2px 0;
}

.graph-stage-foot .panel-meta {
  max-width: 52ch;
}

.ai-tool-card .panel-meta,
.ai-tool-card .preview-subtitle,
.ai-tool-card {
  line-height: 1.6;
}

.files-summary-panel {
  grid-area: summary;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 190px);
  padding: 20px 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(248, 251, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  align-self: stretch;
  position: sticky;
  top: 22px;
}

.files-summary-top-slot {
  display: none;
  width: min(260px, 34vw);
  min-width: 180px;
  align-self: stretch;
}

.files-summary-top-slot.active {
  display: block;
}

.files-summary-top-graph-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(205, 216, 232, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  box-shadow: 0 10px 22px rgba(182, 197, 223, 0.12);
}

.files-summary-top-graph-meta {
  font-size: 11px;
  line-height: 1.45;
  color: #71809a;
}

.files-summary-top-graph-frame {
  position: relative;
  min-height: 132px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 233, 0.96);
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98), rgba(240, 245, 252, 0.96));
  cursor: pointer;
}

.files-summary-top-graph-frame::after {
  content: "知识图谱";
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(193, 205, 224, 0.94);
  background: rgba(255, 255, 255, 0.92);
  color: #5f7394;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 1;
}

.files-summary-top-graph-frame .single-file-graph-svg {
  display: block;
  width: 100%;
  height: 132px;
}

.files-summary-top-graph-frame-embedded {
  overflow: hidden;
}

.files-summary-top-graph-iframe {
  display: block;
  width: 100%;
  height: 132px;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.files-summary-top-graph-loading {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #6f7d96;
  text-align: center;
}

.files-summary-body {
  flex: 0 1 auto;
  min-height: 300px;
  max-height: calc(100vh - 170px);
  padding: 8px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #47546a;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.files-summary-plain {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.files-summary-card {
  gap: 10px;
}

.files-summary-card-head {
  align-items: flex-start;
}

.files-summary-card-kicker {
  font-size: 12px;
  color: #7788a1;
  letter-spacing: 0.08em;
}

.files-summary-card-title {
  font-size: 17px;
  line-height: 1.45;
  color: #1b355d;
}

.files-summary-source-chip {
  border-color: rgba(178, 196, 160, 0.82);
  background: linear-gradient(180deg, rgba(243, 248, 235, 0.98), rgba(236, 244, 229, 0.96));
}

.files-summary-meta-row {
  gap: 10px;
}

.files-summary-meta-chip {
  background: rgba(255, 255, 255, 0.9);
}

.files-summary-section {
  gap: 10px;
}

.files-summary-section-title {
  position: relative;
  padding-left: 12px;
  color: #244067;
}

.files-summary-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #79a6ff, #5d7ff0);
}

.ai-chat-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  align-items: start;
  gap: 16px;
}

.ai-chat-main-panel {
  padding: 16px;
  min-width: 0;
}

#tab-block-writer .ai-chat-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 44px);
  height: calc(100vh - 44px);
  align-items: stretch;
  gap: 0;
  background: #f7f7f8;
}

#tab-block-writer .ai-chat-main-panel {
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: calc(100vh - 44px);
  height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: 1fr;
  row-gap: 8px;
  overflow: hidden;
  align-self: stretch;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}

#tab-block-writer .file-dialog-side-panel {
  min-height: calc(100vh - 44px);
  height: calc(100vh - 44px);
  padding: 0;
  overflow: hidden;
  align-self: stretch;
  border: 0;
  border-right: 1px solid rgba(220, 224, 230, 0.9);
  border-radius: 0;
  box-shadow: none;
  background: #f7f7f8;
}

#tab-block-writer #fileDialogShell {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 175, 205, 0.9) rgba(236, 241, 248, 0.9);
}

#tab-block-writer #fileDialogShell::-webkit-scrollbar {
  width: 8px;
}

#tab-block-writer #fileDialogShell::-webkit-scrollbar-track {
  background: rgba(236, 241, 248, 0.9);
  border-radius: 999px;
}

#tab-block-writer #fileDialogShell::-webkit-scrollbar-thumb {
  background: rgba(156, 175, 205, 0.92);
  border-radius: 999px;
}


.files-summary-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.files-summary-graph-card {
  margin-top: 18px;
}

.files-summary-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(208, 219, 236, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  box-shadow: 0 8px 22px rgba(183, 198, 226, 0.10);
}

.files-summary-hero-main,
.files-summary-hero-side,
.files-summary-section-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.files-summary-hero-side {
  align-items: stretch;
}

.files-summary-hero .files-summary-card-title {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.35;
  color: #223a61;
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.files-summary-hero .files-summary-source-chip {
  align-self: flex-start;
}

.single-file-graph-caption {
  font-size: 13px;
  line-height: 1.6;
  color: #687360;
  max-width: 38ch;
}

.single-file-graph-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.single-file-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-file-graph-toolbar.refined {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.single-file-graph-toolbar-copy {
  min-width: 0;
}

.single-file-graph-toolbar-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #2f3b31;
  word-break: break-word;
}

.single-file-graph-toolbar-meta {
  margin-top: 3px;
  font-size: 12px;
  color: #77826f;
}

.single-file-graph-expand-btn {
  white-space: nowrap;
}

.single-file-graph-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(194, 202, 186, 0.78);
  background:
    radial-gradient(circle at top, rgba(218, 226, 210, 0.3), transparent 42%),
    linear-gradient(180deg, rgba(253, 254, 251, 0.98), rgba(246, 249, 242, 0.94));
  min-height: 400px;
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 18px 34px rgba(82, 95, 71, 0.08);
}

.single-file-graph-frame.large {
  min-height: 620px;
  padding: 18px;
}

.single-file-graph-frame.interactive {
  cursor: grab;
}

.single-file-graph-frame.interactive.dragging {
  cursor: grabbing;
}

.single-file-graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #f6f6f4;
  border-radius: 18px;
}

.single-file-graph-loading {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6f7c67;
  font-size: 13px;
}

.single-file-graph-svg {
  width: 100%;
  height: auto;
  display: block;
  background: transparent !important;
}

.single-file-graph-bg {
  fill: rgba(255, 255, 255, 0.54);
}

.single-file-graph-edge {
  stroke: rgba(154, 166, 179, 0.48);
}

.single-file-graph-edge.active {
  stroke: rgba(130, 143, 158, 0.72);
}

.single-file-graph-node-group {
  cursor: pointer;
}

.single-file-graph-node-dot {
  fill: rgba(89, 96, 101, 0.9);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.4;
}

.single-file-graph-node-dot.focus {
  fill: #415244;
  stroke: rgba(216, 228, 206, 0.96);
  stroke-width: 2;
  filter: drop-shadow(0 0 12px rgba(114, 145, 109, 0.28));
}

.single-file-graph-node-label {
  font-size: 11px;
  fill: rgba(74, 80, 85, 0.78);
  user-select: none;
}

.single-file-graph-node-label.focus {
  font-size: 12px;
  font-weight: 700;
  fill: #2f3b31;
}

.single-file-graph-node-tag-bg {
  vector-effect: non-scaling-stroke;
}

.single-file-graph-node-tag-text {
  font-size: 10px;
  font-weight: 600;
  user-select: none;
}

.single-file-graph-node-group:hover .single-file-graph-node-dot,
.single-file-graph-node-group:focus .single-file-graph-node-dot {
  fill: #2f3b31;
}

.single-file-graph-modal-card {
  position: relative;
  width: min(1200px, calc(100vw - 28px));
  margin: 24px auto;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 1;
}

.single-file-graph-modal-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(180, 188, 171, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 252, 0.98), rgba(248, 249, 243, 0.92));
  box-shadow: 0 22px 48px rgba(73, 83, 61, 0.08);
  padding: 18px 18px 16px;
}

.single-file-graph-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 6px;
}

.single-file-graph-modal-head-copy {
  min-width: 0;
}

.single-file-graph-modal-title {
  font-size: 22px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #243020;
}

.single-file-graph-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #74806e;
  word-break: break-word;
  max-width: 84ch;
}

.single-file-graph-modal-body {
  height: min(78vh, 860px);
  min-height: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.single-file-graph-modal-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.single-file-graph-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.single-file-graph-modal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-file-graph-modal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(191, 199, 184, 0.82);
  background: rgba(252, 253, 249, 0.9);
  color: #697563;
  font-size: 12px;
  font-weight: 600;
}

.single-file-graph-frame.canvas-mode {
  padding: 10px;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.single-file-graph-frame.large.canvas-mode {
  min-height: 0;
}

.files-summary-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.files-summary-card-kicker,
.files-summary-empty-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b7862;
}

.files-summary-card-title,
.files-summary-empty-title {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #2f362b;
}

.files-summary-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid rgba(183, 193, 173, 0.9);
  background: linear-gradient(180deg, rgba(241, 246, 236, 0.95), rgba(236, 242, 231, 0.92));
  color: #54644c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.files-summary-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.files-summary-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(201, 208, 194, 0.88);
  color: #5c6555;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
}

.files-summary-meta-chip.muted {
  color: #7a8372;
}

.files-summary-stats-inline {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.files-summary-inline-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #5f6858;
}

.files-summary-inline-label {
  font-size: 12px;
  color: #798272;
}

.files-summary-inline-value {
  font-size: 13px;
  font-weight: 800;
  color: #33402d;
}

.files-summary-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(193, 201, 185, 0.8), rgba(193, 201, 185, 0.16));
}

.files-summary-content {
  font-size: 12px;
  line-height: 1.56;
  color: #465043;
  white-space: pre-wrap;
  word-break: break-word;
}

.files-summary-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 9px;
}

.files-summary-section + .files-summary-section {
  border-top: 1px solid rgba(193, 201, 185, 0.22);
}

.files-summary-section-title {
  font-size: 13px;
  font-weight: 800;
  color: #244067;
}

.files-summary-section-title::before {
  top: 3px;
  height: 12px;
}

.files-summary-heading {
  font-size: 18px;
  font-weight: 800;
  color: #263223;
}

.files-summary-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.files-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.files-summary-stat-card,
.files-summary-stat {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(247, 249, 243, 0.96);
  border: 1px solid rgba(198, 206, 191, 0.66);
}

.files-summary-stat-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(243, 248, 255, 0.95));
  border-color: rgba(194, 208, 229, 0.84);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.files-summary-stat-card span,
.files-summary-stat span {
  display: block;
  font-size: 12px;
  color: #7a8372;
}

.files-summary-stat-card strong,
.files-summary-stat strong {
  display: block;
  margin-top: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #33402d;
  word-break: break-word;
  text-align: right;
}

.files-summary-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.files-summary-token {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(245, 248, 240, 0.92);
  border: 1px solid rgba(164, 176, 153, 0.68);
  color: #55624c;
  font-size: 10px;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.files-summary-empty-inline {
  color: #75806d;
  font-size: 12px;
}

@media (max-width: 960px) {
  .single-file-graph-frame,
  .single-file-graph-loading {
    min-height: 280px;
  }

  .single-file-graph-frame.large {
    min-height: 420px;
  }

  .single-file-graph-toolbar.refined {
    align-items: flex-start;
  }

  .single-file-graph-modal-body {
    height: min(72vh, 620px);
    min-height: 420px;
  }

  .single-file-graph-modal-card {
    width: calc(100vw - 16px);
    margin: 8px auto;
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .single-file-graph-modal-title {
    font-size: 20px;
  }

  .files-summary-stats-grid,
  .files-summary-actions-row {
    grid-template-columns: 1fr;
  }
}

.files-summary-points {
  margin: 0;
  padding-left: 16px;
  color: #465043;
}

.files-summary-points li {
  line-height: 1.5;
}

.files-summary-points.compact li + li {
  margin-top: 4px;
}

.files-summary-points li + li {
  margin-top: 6px;
}

.files-summary-paragraph {
  margin: 0;
}

.files-summary-paragraph + .files-summary-paragraph {
  margin-top: 6px;
}

.files-summary-paragraph.lead {
  font-size: 13px;
  line-height: 1.5;
  color: #374133;
}

.files-summary-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.files-summary-actions-row.single {
  grid-template-columns: minmax(0, 1fr);
}

.files-summary-action-btn {
  min-height: 32px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.files-summary-more-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(236, 241, 247, 0.96);
  border: 1px dashed rgba(170, 182, 201, 0.76);
  color: #6a7c95;
  font-size: 11px;
  font-weight: 700;
}

.files-summary-more-note {
  font-size: 11px;
  color: #7a889a;
}

.files-summary-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 10px 8px;
}

.files-summary-empty-text {
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.9;
  color: #687060;
}

.files-actions-strip {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.files-actions-panel-inline {
  padding: 20px 20px 18px;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.upload-list-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
}

.entry-card-upload-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 18px;
}

.upload-strip-copy {
  min-width: 0;
}

.upload-strip-action {
  display: flex;
  justify-content: flex-end;
}

.upload-strip-action .upload-label {
  width: 100%;
  min-height: 56px;
}

.files-actions-panel-inline .entry-card-upload-strip {
  grid-template-columns: 1fr;
  gap: 16px;
}

.files-actions-panel-inline .upload-strip-action {
  justify-content: stretch;
}

.files-actions-panel-inline .upload-strip-copy {
  display: grid;
  gap: 6px;
}

.files-actions-panel-inline .entry-card-title {
  font-size: 34px;
  line-height: 1.08;
  color: #16345d;
}

.files-actions-panel-inline .entry-card-text,
.files-actions-panel-inline .upload-status,
.files-actions-panel-inline .upload-progress-text,
.files-actions-panel-inline .upload-progress-meta {
  font-size: 12px;
  color: #6f8096;
}

.doc-skeleton-list {
  display: grid;
  gap: 12px;
  padding: 8px 0;
}

.doc-skeleton-row {
  border: 1px solid rgba(184, 191, 176, 0.46);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 8px;
}

.doc-skeleton-bar {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(224, 229, 219, 0.9), rgba(242, 244, 239, 0.96), rgba(224, 229, 219, 0.9));
  background-size: 220% 100%;
  animation: doc-skeleton-wave 1.3s ease-in-out infinite;
}

.doc-skeleton-bar.primary {
  width: 62%;
}

.doc-skeleton-bar.secondary {
  width: 40%;
}

@keyframes doc-skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.files-actions-panel,
.files-list-panel,
.files-preview-panel {
  border-radius: 24px;
  border-color: rgba(180, 188, 171, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 252, 0.98), rgba(248, 249, 243, 0.92));
  box-shadow: 0 22px 48px rgba(73, 83, 61, 0.08);
}

.files-actions-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.files-list-panel {
  flex: 1 1 auto;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.files-list-panel-full {
  min-height: 0;
  flex: 1 1 auto;
}

.files-list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.files-list-toolbar .search-input {
  margin-top: 10px;
}

.files-upload-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-progress-panel-inline {
  margin-top: 0;
}

.start-hub {
  border: 1px solid rgba(173, 183, 163, 0.72);
  border-radius: 20px;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(126, 151, 118, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(249, 250, 245, 0.98), rgba(255, 255, 252, 0.98));
}

.start-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.start-hub-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.start-hub-card {
  border: 1px solid rgba(180, 188, 171, 0.72);
  border-radius: 18px;
  padding: 14px 14px 14px 16px;
  background: rgba(255, 253, 250, 0.9);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  display: grid;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.start-hub-card:hover {
  transform: translateY(-1px);
  border-color: rgba(106, 134, 97, 0.72);
}

.start-hub-card-upload {
  background: linear-gradient(160deg, rgba(231, 241, 228, 0.96), rgba(255, 255, 252, 0.98));
}

.start-hub-card-write {
  background: linear-gradient(160deg, rgba(233, 239, 247, 0.96), rgba(255, 255, 252, 0.98));
}

.start-hub-card-ask {
  background: linear-gradient(160deg, rgba(246, 239, 223, 0.98), rgba(255, 255, 252, 0.98));
}

.start-hub-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e7665;
  font-weight: 700;
}

.start-hub-title {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.start-hub-text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.quick-ask-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.entry-card {
  border-radius: 20px;
  border: 1px solid rgba(180, 188, 171, 0.72);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 249, 243, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.entry-card-upload {
  border-color: rgba(122, 152, 111, 0.32);
  background: linear-gradient(160deg, rgba(236, 244, 232, 0.98), rgba(255, 255, 252, 0.98));
}

.entry-card-write {
  border-color: rgba(112, 135, 163, 0.3);
  background: linear-gradient(160deg, rgba(235, 241, 247, 0.98), rgba(255, 255, 252, 0.98));
}

.entry-card-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e7665;
  font-weight: 700;
}

.entry-card-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.entry-card-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.entry-card-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.files-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.files-actions-panel .upload-label,
.files-actions-panel .primary-btn,
.files-actions-panel .ghost-btn,
.files-editor-actions .ghost-btn,
.files-editor-actions .primary-btn {
  border-radius: 14px;
}

.files-actions-panel .primary-btn,
.files-actions-panel .ghost-btn {
  width: 100%;
  min-height: 46px;
}

.files-actions-panel .ghost-btn {
  background: rgba(255, 253, 250, 0.92);
}

.hidden-action {
  display: none !important;
}

.upload-status {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  padding: 4px 6px 0;
  white-space: pre-line;
}

.upload-progress-panel {
  margin-top: 6px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(188, 196, 181, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.upload-progress-text,
.upload-progress-meta {
  font-size: 12px;
  color: #54604e;
}

.upload-progress-meta {
  font-weight: 700;
  white-space: nowrap;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(214, 221, 206, 0.72);
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8d63, #9cc48f);
  transition: width 0.22s ease;
}

.files-editor-toolbar {
  margin: 18px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(180, 188, 171, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(252, 252, 248, 0.96), rgba(246, 248, 241, 0.92));
}

.files-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  background: linear-gradient(180deg, #eef5e8, #e8f0e0);
  color: #4d6043;
  border: 1px solid rgba(144, 166, 134, 0.7);
  font-weight: 700;
}

.doc-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.related-panel {
  margin-top: 20px;
  border-top: 1px solid rgba(180, 188, 171, 0.56);
  padding-top: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.related-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.related-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.block-card-grid {
  min-height: 560px;
  max-height: 72vh;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.block-card {
  border: 1px solid rgba(180, 188, 171, 0.52);
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(204, 218, 192, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 244, 0.95));
  box-shadow: 0 14px 30px rgba(73, 83, 61, 0.08);
}

.block-detail-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(180, 188, 171, 0.52);
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(204, 218, 192, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 244, 0.96));
  box-shadow: 0 18px 34px rgba(73, 83, 61, 0.09);
}

.block-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.block-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.block-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.block-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.block-card-index {
  font-size: 11px;
  font-weight: 700;
  color: #6b7a60;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.block-card-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  color: #2d3528;
}

.block-card-meta,
.block-card-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block-chip,
.link-chip {
  border: 1px solid rgba(164, 176, 153, 0.68);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(245, 248, 240, 0.92);
  font-size: 12px;
  line-height: 1.2;
  color: #55624c;
}

.block-chip.subtle {
  background: rgba(255, 255, 255, 0.72);
  color: #6f7668;
}

.link-chip {
  cursor: pointer;
}

.block-card-body {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.72;
  color: #4a5344;
  white-space: pre-wrap;
  word-break: break-word;
}

.block-detail-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(188, 196, 181, 0.5);
}

.block-detail-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #5a6b50;
  text-transform: uppercase;
}

.block-card-empty {
  padding: 22px;
  border: 1px dashed rgba(173, 183, 163, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.72);
}

.mini-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fffdfa;
  cursor: pointer;
  font-size: 12px;
}

.mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.doc-editor-textarea {
  min-height: 420px;
  margin-top: 0;
}

.block-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.block-editor-grid > :first-child,
.block-editor-grid > :nth-child(2) {
  grid-column: 1 / -1;
}

.block-editor-textarea {
  min-height: 160px;
  margin-top: 0;
}

.block-editor-textarea.compact {
  min-height: 120px;
}

.editor-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.graph-node-actions {
  margin-top: 12px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.context-menu {
  position: fixed;
  z-index: 120;
  min-width: 280px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 10px 12px;
  border: 1px solid rgba(210, 219, 233, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 44px rgba(83, 101, 138, 0.18);
  backdrop-filter: blur(14px);
}

.context-menu-head {
  padding: 4px 8px 12px;
}

.context-menu-kicker {
  font-size: 12px;
  font-weight: 700;
  color: #2a3d61;
  letter-spacing: 0.02em;
}

.context-menu-object {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: #102744;
  word-break: break-word;
}

.context-menu-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #6d7d95;
  line-height: 1.5;
}

.context-menu-divider {
  height: 1px;
  margin: 10px 2px;
  background: linear-gradient(90deg, rgba(220, 227, 239, 0), rgba(220, 227, 239, 0.95), rgba(220, 227, 239, 0));
}

.context-menu-title {
  padding: 2px 8px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #7d8ca3;
}

.context-menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-menu-item {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: #183153;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.context-menu-item:hover {
  background: rgba(236, 242, 251, 0.96);
}

.context-menu-item:active {
  transform: scale(0.995);
}

.context-menu-item.muted {
  color: #74839b;
}

.context-menu-item.compact {
  padding-top: 9px;
  padding-bottom: 9px;
}

.context-menu-icon {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  font-size: 14px;
  color: #5673a6;
}

.context-menu-text {
  flex: 1;
  min-width: 0;
}

.context-menu-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.context-menu-item-detailed {
  align-items: flex-start;
}

.context-menu-item-detailed .context-menu-icon {
  margin-top: 2px;
}

.context-menu-note {
  font-size: 11px;
  line-height: 1.45;
  color: #7a8aa2;
}

.context-menu-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: #8a98ae;
}

.tree-inline-notice {
  position: fixed;
  z-index: 70;
  min-width: 180px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(191, 201, 218, 0.96);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(74, 88, 110, 0.14);
  color: #516173;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tree-inline-notice.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 48, 35, 0.26);
}

.modal-card {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  margin: 56px auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.doc-preview-modal-card {
  width: min(1400px, calc(100vw - 36px));
  margin: 24px auto;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.doc-preview-head-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}

.modal-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.merge-preview-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.76);
  padding: 14px;
  min-height: 180px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-wrap;
}

.merge-target-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  min-height: 96px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-target-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfa;
  padding: 10px 12px;
  cursor: pointer;
}

.merge-target-item.active {
  border-color: #90a686;
  background: #f5f8f1;
}

.merge-target-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.merge-target-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.save-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}

.suggestion-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.suggestion-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fffdfa;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
}

.suggestion-chip:hover {
  background: #f5f8f1;
  border-color: #90a686;
}

.files-list-panel {
  min-height: 124px;
}

.files-list-panel .panel-head {
  align-items: center;
}

.files-main-classic {
  padding: 20px 0 0 16px;
}

.files-preview-panel {
  min-height: 618px;
}

.preview-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.ai-layout {
  grid-template-columns: 1.1fr 0.7fr 1.2fr;
}

.ai-workbench {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.ai-sidebar-panel {
  min-width: 0;
}

.ai-main-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.ai-tool-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-tool-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdfa;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
}

.ai-tool-card.active {
  border-color: #cdd5ff;
  background: #f9faff;
}

.ai-tool-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-tool-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}

.ai-tool-icon.grade {
  background: #e7ebff;
}

.ai-tool-icon.lesson {
  background: #def8e9;
}

.ai-tool-icon.qa {
  background: #e5efff;
}

.ai-tool-icon.synthesis {
  background: #eaf6e5;
}

.ai-tool-icon.comparison {
  background: #fff0df;
}

.ai-tool-icon.resolve {
  background: #f4e9ff;
}

.ai-tool-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.ai-tool-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #57624f;
}

.ai-tool-source {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.ai-step-badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: #6b7263;
  background: #f4f5ef;
}

.ai-form-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.source-picker-grid {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.source-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(184, 191, 176, 0.72);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.source-picker-item input {
  margin-top: 3px;
}

.source-picker-copy {
  display: grid;
  gap: 4px;
}

.source-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.source-picker-meta {
  font-size: 12px;
  color: var(--muted);
}

.ai-form-row {
  display: grid;
  gap: 8px;
}

.ai-form-row-wide {
  grid-column: 1 / -1;
}

.ai-form-label {
  font-size: 13px;
  font-weight: 700;
  color: #3b4336;
}

.ai-form-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.lesson-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}


.ai-input,
.ai-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
}

.grader-workflow {
  gap: 16px;
}

.grader-step-card {
  border: 1px solid rgba(180, 188, 171, 0.72);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 243, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.grader-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.grader-step-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d7566;
  margin-bottom: 4px;
}

.grader-step-meta {
  font-size: 12px;
  color: var(--muted);
}

.grader-file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grader-file-item {
  border: 1px solid rgba(184, 191, 176, 0.72);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.grader-file-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.grader-file-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.grader-answer-textarea {
  min-height: 280px;
}

.grader-notes-textarea {
  min-height: 120px;
}

.canvas-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.segmented-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 76px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.segmented-btn.active {
  background: #eff3eb;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(120, 136, 110, 0.22);
}

.graph-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  height: clamp(560px, 70vh, 820px);
  border-radius: 26px;
  border: 1px solid rgba(233, 228, 219, 0.94);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 78% 28%, rgba(246, 242, 235, 0.88), rgba(246, 242, 235, 0) 28%),
    linear-gradient(180deg, #fcfbf8 0%, #f5f1ea 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 16px 38px rgba(128, 116, 94, 0.08);
}

.graph-stage-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.hover-card {
  position: absolute;
  z-index: 10;
  max-width: 360px;
  pointer-events: none;
  border: 1px solid rgba(230, 220, 203, 0.94);
  border-radius: 18px;
  padding: 13px 15px;
  background: rgba(255, 251, 245, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 34px rgba(128, 116, 94, 0.12);
}

.hover-card.hidden {
  display: none;
}

.hover-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #3f3324;
}

.hover-card-meta,
.hover-card-body {
  margin-top: 6px;
  font-size: 11px;
  color: #8c7a63;
  line-height: 1.6;
}

.graph-shell .sidebar,
.graph-shell .workspace {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 24%),
    linear-gradient(180deg, #fbfaf7 0%, #f4f1ea 100%);
}

.graph-shell-solo {
  padding: 22px 26px 28px;
}

.graph-layout-solo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  gap: 18px;
  align-items: start;
}

.graph-canvas-panel-solo {
  width: 100%;
  max-width: none;
  padding: 20px 20px 16px;
  border-radius: 28px;
  border: 1px solid rgba(231, 226, 215, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 247, 241, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 18px 42px rgba(130, 116, 87, 0.08);
}

.graph-stage-solo {
  min-height: 0;
  min-width: 0;
}

.graph-sidepanel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  padding-left: 18px;
  border-left: 1px solid rgba(227, 220, 206, 0.92);
}

.graph-side-card {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  height: 205px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(225, 229, 235, 0.96);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.graph-nav-card {
  padding: 8px 0 12px;
  height: 205px;
  overflow: hidden;
}

.graph-nav-card .panel-head {
  margin-bottom: 8px;
}

.graph-nav-card .panel-title {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.graph-nav-card #pageList.page-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: 2px;
}

.graph-nav-card .page-item {
  padding: 7px 0;
  border-bottom: 1px solid rgba(232, 235, 240, 0.76);
  min-height: 44px;
}

.graph-nav-card .page-item-title {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-nav-card .page-item-meta {
  display: none;
}

.graph-nav-card .page-item.active {
  padding-top: 7px;
  padding-bottom: 7px;
}

.graph-nav-card .page-item.active .page-item-title {
  font-size: 12.5px;
}

.graph-sidepanel .link-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  margin-top: 8px;
}

.graph-sidepanel .selected-summary {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  max-height: 72px;
  overflow: auto;
}

.graph-sidepanel #previewPanel {
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
}

.graph-shell .sidebar {
  border-right: 1px solid rgba(230, 232, 236, 0.96);
}

.graph-shell .panel,
.graph-shell .canvas-panel {
  border-color: rgba(227, 231, 237, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 252, 253, 0.92));
  box-shadow: 0 12px 28px rgba(112, 120, 132, 0.06);
}

.graph-shell .panel {
  border-radius: 16px;
}

.graph-shell .sidebar .panel {
  opacity: 0.9;
}

.graph-shell .graph-sidepanel .graph-side-card {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(228, 221, 208, 0.96);
  background: transparent;
  box-shadow: none;
}

.graph-shell .graph-sidepanel .graph-side-card:last-child {
  border-bottom: 0;
}

.graph-shell .panel-title,
.graph-shell .page-item-title,
.graph-shell .link-item-title,
.graph-shell .meta-item strong,
.graph-shell .selected-summary,
.graph-shell #previewPanel {
  color: #3e3528;
}

.graph-shell .graph-side-card .panel-title {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.graph-shell .preview-subtitle,
.graph-shell .panel-meta,
.graph-shell .selected-summary,
.graph-shell .meta-item,
.graph-shell .empty,
.graph-shell .page-item-meta,
.graph-shell .link-item-meta,
.graph-shell #graphFootnote,
.graph-shell #graphViewHint {
  color: #8b7c67;
}

.graph-shell .search-input,
.graph-shell .segmented-control,
.graph-shell .ghost-btn,
.graph-shell .primary-btn,
.graph-shell .status-badge {
  border-color: rgba(227, 218, 204, 0.94);
  background: rgba(255, 250, 243, 0.9);
  color: #6c5943;
}

.graph-shell .canvas-toolbar {
  align-items: center;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(231, 224, 212, 0.92);
}

.graph-shell .canvas-toolbar h2 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #2f261b;
}

.graph-shell .eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #b28d5f;
}

.graph-shell .toolbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.graph-shell .primary-btn {
  background: linear-gradient(180deg, #f3e7d3, #ecd9bc);
  color: #5f4a2f;
  border-color: rgba(218, 194, 157, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.graph-shell .segmented-btn {
  color: #8d7b63;
}

.graph-shell .segmented-btn.active {
  background: linear-gradient(180deg, #f7efe2, #efdfc8);
  color: #5a4630;
  box-shadow: inset 0 0 0 1px rgba(214, 191, 155, 0.9);
}

.graph-shell .search-input::placeholder {
  color: #aaa;
}

.graph-shell .ghost-btn,
.graph-shell .primary-btn,
.graph-shell .segmented-btn {
  min-height: 38px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.graph-shell .ghost-btn {
  background: rgba(255, 250, 243, 0.88);
}

.graph-shell .ghost-btn:hover,
.graph-shell .primary-btn:hover {
  transform: translateY(-1px);
}

.graph-shell .stat-card,
.graph-shell .page-item,
.graph-shell .link-item,
.graph-shell .selected-panel {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.graph-shell .page-list,
.graph-shell .link-list {
  gap: 0;
}

.graph-shell .page-item,
.graph-shell .link-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(228, 232, 238, 0.84);
  min-height: 0;
}

.graph-shell .toolbar-card {
  padding: 12px;
}

.graph-shell .page-item.active,
.graph-shell .link-item.active {
  border-color: rgba(189, 197, 208, 0.96);
  background: transparent;
  box-shadow: none;
}

.graph-shell .page-item:hover,
.graph-shell .link-item:hover {
  transform: none;
  border-color: rgba(214, 201, 182, 0.96);
  background: rgba(255, 249, 241, 0.72);
}

.graph-shell .page-item-title,
.graph-shell .link-item-title {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.graph-shell .page-item-meta,
.graph-shell .link-item-meta {
  display: block;
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.78;
  white-space: normal;
  word-break: break-word;
}

.graph-shell .page-item.active,
.graph-shell .link-item.active {
  padding-top: 6px;
  padding-bottom: 6px;
}

.graph-shell .page-item.active .page-item-title,
.graph-shell .link-item.active .link-item-title {
  font-size: 12.5px;
}

.graph-shell #pageList.page-list {
  max-height: 320px;
  overflow: auto;
}

.graph-shell .stat-label {
  color: #929292;
}

.graph-shell .stat-value {
  color: #5b5b5b;
}

.graph-shell .stats-grid {
  gap: 0;
  border-top: 1px solid rgba(228, 232, 238, 0.84);
  border-left: 1px solid rgba(228, 232, 238, 0.84);
}

.graph-shell .stat-card {
  border-right: 1px solid rgba(228, 232, 238, 0.84);
  border-bottom: 1px solid rgba(228, 232, 238, 0.84);
  border-radius: 0;
  padding: 10px 8px;
  min-height: 0;
}

.graph-shell .node-badge {
  border: 1px solid rgba(225, 212, 191, 0.96);
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.98), rgba(248, 238, 223, 0.96));
  color: #766148;
}

.graph-shell #previewPanel {
  border: 1px solid rgba(229, 220, 204, 0.92);
  background: rgba(255, 251, 245, 0.95);
  border-radius: 18px;
  padding: 10px 12px;
}

.graph-sidepanel #selectedMeta.meta-list {
  margin-top: 8px;
  max-height: 44px;
  overflow: auto;
}

.graph-sidepanel .graph-node-actions {
  margin-top: 8px;
}

/* Keep the graph navigation card compact while letting the rest of the
   right-side graph panels stay readable and visually balanced. */
.graph-shell .graph-nav-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.graph-shell .graph-nav-card .panel-head {
  margin-bottom: 0 !important;
}

.graph-shell .graph-nav-card .panel-title {
  font-size: 18px !important;
  line-height: 1.2 !important;
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  min-height: 0;
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .panel-title {
  font-size: 18px;
  line-height: 1.2;
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .link-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.graph-shell .graph-sidepanel #selectedMeta.meta-list {
  margin-top: 0;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.graph-shell .selected-summary,
.graph-shell #previewPanel {
  margin: 0;
}

.graph-shell .selected-summary {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(224, 232, 241, 0.96);
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(245, 249, 253, 0.96));
  font-size: 13px;
  line-height: 1.65;
  color: rgba(84, 99, 120, 0.96);
}

.graph-shell #previewPanel {
  min-height: 64px;
  max-height: 92px;
  overflow: auto;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.55;
}

.graph-shell .graph-sidepanel .meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(224, 231, 240, 0.96);
  background: rgba(250, 252, 255, 0.92);
  font-size: 12px;
  line-height: 1.45;
  color: rgba(87, 101, 118, 0.96);
}

.graph-shell .graph-sidepanel .meta-item strong {
  font-size: 11px;
  font-weight: 700;
  color: rgba(120, 132, 149, 0.92);
}

.graph-shell .graph-stats-section {
  margin-top: 0;
  padding-top: 12px;
}

.graph-shell .graph-stats-head {
  margin-bottom: 10px;
}

.graph-shell .graph-stats-title {
  font-size: 16px;
  color: rgba(50, 68, 92, 0.98);
}

.graph-shell .graph-stats-caption {
  font-size: 12px;
  color: rgba(101, 117, 139, 0.92);
}

.graph-shell .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
}

.graph-shell .stat-card {
  border: 1px solid rgba(224, 231, 240, 0.96);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(250, 252, 255, 0.92);
  min-height: 78px;
}

.graph-shell .stat-label {
  font-size: 12px;
  color: rgba(113, 126, 144, 0.92);
}

.graph-shell .stat-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  color: rgba(67, 79, 98, 0.98);
}

.graph-shell .graph-stats-chart {
  gap: 6px;
  margin-top: 12px;
}

.graph-shell .graph-stats-bar {
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  gap: 6px;
}

.graph-shell .graph-stats-bar-label,
.graph-shell .graph-stats-bar-value {
  font-size: 10.5px;
}

.graph-shell .graph-stats-bar-track {
  height: 8px;
  background: rgba(226, 233, 243, 0.94);
}

.graph-shell .graph-node-actions {
  margin-top: auto;
  padding-top: 4px;
}

.graph-shell .graph-sidepanel .link-list {
  margin-top: 0;
  gap: 10px;
}

.graph-shell .graph-sidepanel .link-item {
  padding: 12px 14px;
  border: 1px solid rgba(224, 231, 240, 0.96);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(246, 250, 255, 0.94));
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.graph-shell .graph-sidepanel .link-item:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 207, 227, 0.98);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 248, 255, 0.98));
}

.graph-shell .graph-sidepanel .link-item.active {
  border-color: rgba(163, 185, 220, 0.98);
  background: linear-gradient(180deg, rgba(246, 250, 255, 1), rgba(237, 244, 255, 0.98));
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .page-item,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .link-item {
  padding: 8px 0;
  min-height: 52px;
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .link-item-title,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .page-item-title {
  max-height: 2.7em;
  overflow: hidden;
}

.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .link-item-meta,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .page-item-meta {
  max-height: 2.7em;
  overflow: hidden;
}

.graph-shell .graph-sidepanel .related-title {
  margin: 10px 0 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #aa8a61;
  text-transform: uppercase;
}

.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #backlinksList,
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #childrenList {
  flex: 1 1 0;
  min-height: 0;
}

.graph-shell .graph-sidepanel .link-list,
.graph-shell .graph-sidepanel #previewPanel,
.graph-shell .graph-sidepanel #selectedMeta.meta-list {
  scrollbar-width: thin;
}

.graph-shell .graph-sidepanel .link-list::-webkit-scrollbar,
.graph-shell .graph-sidepanel #previewPanel::-webkit-scrollbar,
.graph-shell .graph-sidepanel #selectedMeta.meta-list::-webkit-scrollbar {
  width: 6px;
}

.graph-shell .graph-sidepanel .link-list::-webkit-scrollbar-thumb,
.graph-shell .graph-sidepanel #previewPanel::-webkit-scrollbar-thumb,
.graph-shell .graph-sidepanel #selectedMeta.meta-list::-webkit-scrollbar-thumb {
  background: rgba(160, 167, 177, 0.9);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .graph-shell-solo {
    padding: 12px;
  }

  .graph-layout-solo {
    grid-template-columns: 1fr;
  }

  .graph-stage-solo {
    min-height: calc(100vh - 220px);
  }
}

.graph-shell .selected-summary {
  line-height: 1.72;
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.selected-summary,
.preview-panel,
.meta-item,
.empty {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.node-badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: var(--page-soft);
  color: var(--page);
}

.meta-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.meta-item strong {
  color: var(--text);
}

.link-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.preview-panel {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

.large-preview {
  min-height: 640px;
  max-height: none;
}

.ai-result-panel {
  border: 1px solid rgba(180, 188, 171, 0.52);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 250, 245, 0.94));
}

.ai-result-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-result-rich {
  white-space: normal;
  padding: 14px;
  overflow: auto;
}

.grader-report,
.grader-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.grader-dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px;
  border-radius: 24px;
  color: #203222;
  background:
    radial-gradient(circle at top right, rgba(208, 232, 209, 0.9), transparent 30%),
    radial-gradient(circle at left bottom, rgba(226, 236, 255, 0.7), transparent 28%),
    linear-gradient(135deg, #f4faf1, #fcfdf8 48%, #f4f8ff);
  border: 1px solid rgba(206, 215, 198, 0.95);
  box-shadow: 0 20px 40px rgba(92, 103, 80, 0.08);
}

.grader-dashboard-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5d7058;
}

.grader-dashboard-title {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.grader-dashboard-subtitle {
  margin-top: 8px;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.grader-dashboard-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grader-hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(164, 179, 156, 0.9);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  color: #394a35;
}

.grader-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.grader-summary-card {
  border: 1px solid rgba(219, 224, 214, 0.96);
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 245, 0.97));
  box-shadow: 0 12px 28px rgba(73, 83, 61, 0.05);
}

.grader-summary-label {
  font-size: 12px;
  color: var(--muted);
}

.grader-summary-value {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
}

.grader-visual-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 0.95fr;
  gap: 14px;
}

.grader-visual-card {
  border: 1px solid rgba(219, 224, 214, 0.96);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 247, 0.96));
  box-shadow: 0 14px 30px rgba(73, 83, 61, 0.05);
}

.grader-visual-card-wide {
  grid-column: 1 / -1;
}

.grader-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.grader-distribution-chart {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grader-distribution-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.grader-distribution-label,
.grader-distribution-value {
  font-size: 12px;
  font-weight: 700;
  color: #53624c;
}

.grader-distribution-track,
.grader-rank-bar,
.grader-progress-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1e8;
}

.grader-distribution-fill,
.grader-rank-bar-fill,
.grader-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f7c54, #87a57e);
}

.grader-rank-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grader-rank-item {
  border: 1px solid rgba(220, 224, 216, 0.96);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.grader-rank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.grader-rank-index {
  font-size: 11px;
  font-weight: 800;
  color: #697761;
  letter-spacing: 0.08em;
}

.grader-rank-name {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.grader-rank-score {
  font-size: 22px;
  font-weight: 800;
  color: #31402d;
}

.grader-rank-bar {
  margin-top: 10px;
}

.grader-rank-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.grader-mistake-board {
  margin-top: 14px;
}

.grader-mistake-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grader-mistake-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 100px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(229, 211, 177, 0.92);
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffaf1, #fff3df);
}

.grader-mistake-row-head {
  background: rgba(255, 247, 231, 0.96);
  border-style: dashed;
  color: #8a6a2d;
  font-size: 12px;
  font-weight: 800;
}

.grader-mistake-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7b5a1b;
  font-size: 13px;
  font-weight: 700;
}

.grader-mistake-rank {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2d59f;
  color: #6a4c17;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.grader-mistake-metric {
  font-size: 13px;
  font-weight: 800;
  color: #6e5822;
  text-align: right;
}

.grader-student-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grader-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.grader-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.lesson-deck {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.lesson-slide-viewer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 30px;
  padding: 16px;
  background: linear-gradient(180deg, #f7f7f3, #eef2ec);
  border: 1px solid rgba(214, 220, 206, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 16px 32px rgba(98, 108, 90, 0.06);
}

.lesson-slide-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 6px;
}

.lesson-slide-toolbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #33402d;
}

.lesson-slide-toolbar-meta {
  font-size: 13px;
  font-weight: 700;
  color: #53624c;
}

.lesson-slide-toolbar-actions {
  display: flex;
  gap: 10px;
}

.lesson-ppt-shell {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 18px;
  min-height: 720px;
}

.lesson-slide-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
  padding: 4px 6px 4px 2px;
  border-right: 1px solid rgba(211, 217, 204, 0.85);
}

.lesson-slide-thumb {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(205, 212, 198, 0.9);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.lesson-slide-thumb:hover {
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.lesson-slide-thumb.active {
  border-color: #7f9a66;
  box-shadow: 0 0 0 2px rgba(127, 154, 102, 0.14);
  background: #fbfdf8;
}

.lesson-slide-thumb-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3e7;
  color: #53624c;
  font-size: 12px;
  font-weight: 800;
}

.lesson-slide-thumb-card {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  padding: 10px 9px;
  background: linear-gradient(180deg, #ffffff, #f4f7f1);
  border: 1px solid rgba(223, 228, 216, 0.94);
  display: flex;
  align-items: flex-end;
}

.lesson-slide-thumb-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  color: #44513e;
}

.lesson-slide-stage {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.45), transparent 22%),
    linear-gradient(180deg, rgba(226, 231, 223, 0.92), rgba(210, 216, 207, 0.96));
  padding: 24px;
  min-height: 720px;
}

.lesson-slide-card {
  width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
  min-height: 520px;
  border-radius: 22px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(243, 248, 255, 0.92), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 251, 247, 0.98)),
    #fff;
  border: 1px solid rgba(221, 226, 214, 0.96);
  box-shadow: 0 28px 56px rgba(69, 79, 59, 0.18);
  display: none;
}

.lesson-slide-card.active {
  display: block;
}

.lesson-slide-card.cover {
  background:
    radial-gradient(circle at top right, rgba(228, 240, 255, 0.98), transparent 32%),
    radial-gradient(circle at bottom left, rgba(236, 248, 224, 0.96), transparent 30%),
    linear-gradient(135deg, #fffdf8, #f5fbff 56%, #f8fcf2);
}

.lesson-slide-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
}

.lesson-slide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lesson-slide-page {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 248, 239, 0.96);
  border: 1px solid rgba(208, 215, 199, 0.9);
  font-size: 12px;
  font-weight: 800;
  color: #53624c;
  text-align: center;
}

.lesson-cover-shell {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 20px;
}

.lesson-cover-kicker {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #71806b;
}

.lesson-cover-title {
  max-width: 860px;
  font-size: clamp(42px, 4vw, 64px);
  line-height: 1.04;
  font-weight: 900;
  color: #2f3d2a;
}

.lesson-cover-subtitle {
  max-width: 760px;
  font-size: 20px;
  line-height: 1.8;
  color: #50604a;
}

.lesson-cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(198, 207, 192, 0.88);
  font-size: 12px;
  font-weight: 700;
  color: #465240;
}

.lesson-slide-index {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a8573;
}

.lesson-slide-title {
  margin-top: 10px;
  font-size: clamp(28px, 2.2vw, 36px);
  line-height: 1.22;
  font-weight: 900;
  color: #2f3d2a;
}

.lesson-slide-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 6px 0;
}

.lesson-slide-text,
.lesson-slide-bullet {
  font-size: clamp(18px, 1.28vw, 22px);
  line-height: 1.65;
  color: #465240;
}

.lesson-slide-bullet {
  position: relative;
  padding-left: 26px;
  font-weight: 700;
}

.lesson-slide-bullet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #88a46f;
}

.lesson-slide-spacer {
  height: 8px;
}

.lesson-slide-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(111, 127, 98, 0.14), rgba(111, 127, 98, 0.55), rgba(111, 127, 98, 0.14));
  margin: 4px 0;
}

.lesson-slide-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-slide-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f7ef;
  border: 1px solid rgba(202, 211, 193, 0.9);
  font-size: 13px;
  font-weight: 700;
  color: #52604c;
}

.lesson-slide-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(225, 231, 217, 0.9);
}

.lesson-slide-foot-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f6f8f1;
  border: 1px solid rgba(205, 214, 196, 0.88);
  font-size: 12px;
  font-weight: 700;
  color: #55624f;
}

.lesson-source-strip {
  border-radius: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(216, 223, 208, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 244, 0.96));
}

.lesson-source-title {
  font-size: 14px;
  font-weight: 800;
  color: #33402d;
}

.lesson-source-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f5f8ef;
  border: 1px solid rgba(201, 210, 191, 0.9);
  font-size: 12px;
  font-weight: 700;
  color: #4e5b47;
}

.lesson-file-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 640px;
}

.lesson-file-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.lesson-file-preview-title {
  font-size: 16px;
  font-weight: 800;
  color: #33402d;
}

.lesson-file-preview-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.lesson-file-preview-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lesson-file-preview-counter {
  font-size: 13px;
  font-weight: 700;
  color: #53624c;
}

.lesson-file-preview-shell {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 14px;
  min-height: 760px;
}

.lesson-file-thumb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 760px;
  overflow: auto;
}

.lesson-file-thumb {
  width: 100%;
  border: 1px solid rgba(205, 212, 198, 0.9);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 8px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  cursor: pointer;
}

.lesson-file-thumb.active {
  border-color: #7f9a66;
  box-shadow: 0 0 0 2px rgba(127, 154, 102, 0.16);
  background: #fbfdf8;
}

.lesson-file-thumb-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3e7;
  color: #53624c;
  font-size: 12px;
  font-weight: 800;
}

.lesson-file-thumb-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(223, 228, 216, 0.94);
  background: white;
}

.lesson-file-preview-stage {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(214, 220, 206, 0.94);
  background: linear-gradient(180deg, rgba(226, 231, 223, 0.92), rgba(210, 216, 207, 0.96));
  min-height: 760px;
  display: grid;
  place-items: center;
  padding: 18px;
}

.lesson-ppt-image {
  display: none;
  width: 100%;
  max-width: 1040px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: white;
  border-radius: 18px;
  box-shadow: 0 20px 42px rgba(69, 79, 59, 0.16);
}

.lesson-ppt-image.active {
  display: block;
}

.lesson-file-preview-empty {
  border-radius: 22px;
  border: 1px dashed rgba(196, 204, 188, 0.94);
  background: rgba(248, 249, 244, 0.96);
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
  color: #566450;
}

.grader-section-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.grader-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
}

.grader-student-card {
  border: 1px solid rgba(219, 224, 214, 0.96);
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 246, 0.97));
  box-shadow: 0 16px 32px rgba(73, 83, 61, 0.06);
}

.grader-student-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.grader-student-rank {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #697761;
}

.grader-student-card-name {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.grader-student-card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.grader-score-badge {
  min-width: 108px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: right;
  border: 1px solid rgba(214, 220, 208, 0.95);
  background: rgba(255, 255, 255, 0.82);
}

.grader-score-badge-main {
  font-size: 18px;
  font-weight: 800;
  color: #2f3d2b;
}

.grader-score-badge-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.grader-progress {
  margin-top: 14px;
}

.grader-progress-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.grader-card-chips {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grader-insight-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.grader-insight-chip.positive {
  background: #e8f6ea;
  border: 1px solid #c2ddc7;
  color: #2f6840;
}

.grader-insight-chip.neutral {
  background: #eef1f4;
  border: 1px solid #d8dfe6;
  color: #5b6270;
}

.grader-card-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grader-card-panel {
  border-radius: 18px;
  padding: 12px;
  background: #fbfcf8;
  border: 1px solid rgba(222, 226, 218, 0.96);
}

.grader-card-panel-title {
  font-size: 12px;
  font-weight: 800;
  color: #495744;
}

.grader-card-panel-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grader-list-item {
  font-size: 12px;
  line-height: 1.55;
  color: #4f5749;
}

.grader-list-item.muted {
  color: var(--muted);
}

.grader-detail-toggle {
  margin-top: 14px;
  border-top: 1px solid rgba(223, 227, 219, 0.95);
  padding-top: 12px;
}

.grader-detail-toggle summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: #41503c;
  list-style: none;
}

.grader-detail-toggle summary::-webkit-details-marker {
  display: none;
}

.grader-detail-body {
  margin-top: 12px;
}

.grader-student-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.grader-mini-stat {
  border: 1px solid rgba(223, 227, 219, 0.95);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.grader-mini-stat-label {
  font-size: 11px;
  color: var(--muted);
}

.grader-mini-stat-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.grader-question-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grader-question-item {
  border: 1px solid rgba(223, 227, 219, 0.95);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 250, 247, 0.97));
}

.grader-question-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.grader-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grader-question-no {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.grader-question-score {
  font-size: 16px;
  font-weight: 800;
  color: #33402d;
}

.grader-question-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.grader-question-panel {
  border-radius: 12px;
  padding: 10px;
  background: #fcfdfb;
  border: 1px solid rgba(232, 235, 228, 0.96);
}

.grader-question-panel-wide {
  grid-column: 1 / -1;
}

/* Keep the file-management workbench on a fixed three-column rail even when
   viewport-based responsive rules would normally collapse the layout. */
.workspace-shell #tab-files .files-layout-classic {
  grid-template-columns: 290px minmax(720px, 1fr) 350px;
  min-width: 1320px;
}

.grader-question-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #697761;
}

.grader-question-text {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #45503f;
  white-space: pre-wrap;
  word-break: break-word;
}

.grader-empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed rgba(180, 188, 171, 0.82);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 252, 0.78);
  color: var(--muted);
  text-align: center;
}

.grader-empty-state.compact {
  min-height: 88px;
}

.tone-excellent .grader-progress-fill,
.tone-excellent.grader-progress-fill,
.tone-excellent .grader-rank-bar-fill,
.tone-excellent.grader-rank-bar-fill {
  background: linear-gradient(90deg, #2f7d46, #73bc69);
}

.tone-good .grader-progress-fill,
.tone-good.grader-progress-fill,
.tone-good .grader-rank-bar-fill,
.tone-good.grader-rank-bar-fill {
  background: linear-gradient(90deg, #4d7fbe, #7fa9df);
}

.tone-pass .grader-progress-fill,
.tone-pass.grader-progress-fill,
.tone-pass .grader-rank-bar-fill,
.tone-pass.grader-rank-bar-fill {
  background: linear-gradient(90deg, #c9912d, #e1b35d);
}

.tone-risk .grader-progress-fill,
.tone-risk.grader-progress-fill,
.tone-risk .grader-rank-bar-fill,
.tone-risk.grader-rank-bar-fill {
  background: linear-gradient(90deg, #b55252, #de7e7e);
}

.grader-score-badge.tone-excellent {
  background: #edf9ef;
}

.grader-score-badge.tone-good {
  background: #eef5ff;
}

.grader-score-badge.tone-pass {
  background: #fff7ea;
}

.grader-score-badge.tone-risk {
  background: #fff0f0;
}

.grader-result-table-wrap,
.grader-breakdown-wrap {
  overflow: auto;
  border: 1px solid rgba(197, 204, 190, 0.88);
  border-radius: 12px;
  background: #ffffff;
}

.grader-result-table,
.grader-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.grader-result-table {
  min-width: 1380px;
}

.grader-result-table th,
.grader-result-table td,
.grader-breakdown-table th,
.grader-breakdown-table td {
  border: 1px solid rgba(215, 220, 209, 0.92);
  padding: 8px 10px;
  vertical-align: top !important;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
}

.grader-result-table thead th,
.grader-breakdown-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3ea;
  font-weight: 800;
  color: #33402d;
}

.grader-result-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

.grader-result-table tbody tr:nth-child(even) td {
  background: #fafcf8;
}

.grader-student-cell {
  min-width: 0;
}

.grader-student-name,
.grader-score-main {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.grader-student-meta,
.grader-score-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.grader-index-cell {
  width: 56px;
  text-align: center !important;
  font-weight: 700;
}

.grader-student-col {
  width: 180px;
}

.grader-paper-col {
  width: 170px;
}

.grader-score-col {
  width: 100px;
}

.grader-level-col {
  width: 90px;
}

.grader-breakdown-col {
  width: min(42vw, 560px);
  min-width: 360px;
}

.grader-text-col {
  min-width: 180px;
}

.grader-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.grader-status-chip.correct {
  color: #2f6840;
  background: #e5f4e8;
  border-color: #bddcc3;
}

.grader-status-chip.partial {
  color: #8a5a17;
  background: #fff1d8;
  border-color: #f0d39b;
}

.grader-status-chip.wrong {
  color: #8a3844;
  background: #fbe3e7;
  border-color: #e8bac3;
}

.grader-status-chip.review {
  color: #5b6270;
  background: #edf1f6;
  border-color: #c7d0db;
}

.grader-breakdown-table {
  min-width: 720px;
}

.grader-breakdown-table th,
.grader-breakdown-table td {
  padding: 6px 8px;
  font-size: 12px;
}

.grader-breakdown-table th {
  white-space: nowrap;
}

.grader-breakdown-empty {
  min-width: 260px;
  border: 1px dashed rgba(180, 188, 171, 0.82);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 252, 0.78);
  color: var(--muted);
}

.grader-breakdown-cell {
  min-height: 88px;
}

.grader-breakdown-empty-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

#aiResultPanel.ai-result-panel.ai-result-rich {
  min-height: 640px;
}

#docPreviewBody.large-preview {
  height: clamp(420px, 62vh, 760px);
  min-height: 420px;
  max-height: 72vh;
  padding: 18px 18px 12px;
  border: 1px solid rgba(180, 188, 171, 0.52);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(249, 250, 245, 0.9));
  color: #40463b;
  line-height: 1.72;
  overflow-y: auto;
  overflow-x: hidden;
}

.files-list-panel {
  padding: 16px;
}

#documentList.page-list {
  flex: 1 1 auto;
  min-height: 56vh;
  max-height: calc(100vh - 360px);
}

.files-tree-head {
  align-items: center;
}

.files-tree-head-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.files-tree-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(196, 204, 217, 0.92);
  border-radius: 999px;
  background: rgba(245, 248, 253, 0.96);
  width: fit-content;
}

.files-tree-mode-btn {
  border: 0;
  background: transparent;
  color: #66758a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.files-tree-mode-btn:hover {
  color: #31425f;
  background: rgba(225, 233, 245, 0.85);
}

.files-tree-mode-btn.active {
  color: #14325b;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(79, 104, 151, 0.16);
}

.files-preview-panel {
  padding: 18px 18px 16px;
}

.files-preview-panel .panel-head {
  align-items: flex-start;
}

.preview-mode-row {
  margin: 12px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-folder-row {
  padding: 10px 6px 8px;
}

.doc-folder-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.doc-folder-row {
  position: relative;
  border-radius: 0;
  padding: 12px 6px 10px;
  border-bottom: 1px solid rgba(224, 231, 241, 0.88);
}

.doc-folder-row:hover {
  background: rgba(245, 248, 253, 0.75);
}

.parsed-folder-row {
  border-radius: 0;
  padding: 12px 6px 10px;
  background: transparent;
  border-bottom: 1px solid rgba(224, 231, 241, 0.88);
}

.parsed-folder-row:hover {
  background: rgba(245, 248, 253, 0.75);
}

.parsed-folder-row.active {
  background: rgba(241, 246, 255, 0.9);
  box-shadow: inset 3px 0 0 #8fb2ea;
}

.doc-folder-icon {
  font-size: 16px;
}

.parsed-folder-icon {
  font-size: 16px;
}

.doc-folder-main {
  gap: 10px;
}

.doc-folder-caret {
  font-size: 11px;
  color: #8a98ab;
}

.parsed-folder-count {
  font-size: 11px;
  font-weight: 700;
  color: #8a98ab;
}

.doc-folder-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(183, 190, 175, 0.45);
}

.doc-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.doc-split-panel {
  min-width: 0;
  border: 1px solid rgba(188, 196, 181, 0.42);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.doc-split-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #4b5645;
}

.doc-split-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-file-row {
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.doc-file-row.active {
  background: linear-gradient(180deg, #e6ebff, #dde5ff);
  box-shadow: inset 3px 0 0 #5a63e8, 0 8px 18px rgba(90, 99, 232, 0.12);
}

.doc-file-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.hybrid-note {
  border: 1px solid rgba(180, 188, 171, 0.72);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 248, 241, 0.92));
  padding: 12px 14px;
}

.hybrid-note-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.hybrid-note-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.file-dialog-chat-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  overflow: hidden;
  background: #ffffff;
}

.file-dialog-chat-header {
  min-height: 54px;
  border-bottom: 1px solid rgba(235, 237, 240, 0.95);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
}

.file-dialog-chat-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2329;
}

.file-dialog-chat-subtitle {
  font-size: 11px;
  color: #b0b5bd;
}

.file-dialog-chat-stream {
  padding: 28px max(24px, 12vw) 24px;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.file-dialog-message {
  display: grid;
  gap: 8px;
}

.file-dialog-message.user {
  justify-items: end;
}

.file-dialog-message.assistant {
  justify-items: start;
}

.file-dialog-message-meta {
  font-size: 12px;
  font-weight: 700;
  color: #7d8877;
}

.file-dialog-message-bubble {
  max-width: min(760px, 92%);
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid rgba(230, 232, 236, 0.95);
  background: #ffffff;
  font-size: 14px;
  line-height: 1.8;
  color: #1f2329;
  white-space: pre-wrap;
  box-shadow: none;
}

.file-dialog-inline-upload-stack {
  position: relative;
  width: fit-content;
  max-width: min(420px, 100%);
}

.file-dialog-inline-upload-summary {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.file-dialog-inline-upload-pill {
  min-width: 0;
  width: min(200px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(246, 247, 250, 0.96);
  box-shadow: 0 8px 18px rgba(132, 142, 164, 0.10);
}

.file-dialog-inline-upload-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf8ee;
  color: #1db954;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.file-dialog-inline-upload-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.file-dialog-inline-upload-name {
  font-size: 13px;
  font-weight: 500;
  color: #1f1f1f;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-dialog-inline-upload-meta {
  font-size: 12px;
  color: #8f8f8f;
  line-height: 1.4;
}

.file-dialog-inline-upload-more {
  flex: 0 0 auto;
  min-width: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(246, 247, 250, 0.96);
  color: #7b7f88;
  font-size: 14px;
  cursor: default;
  box-shadow: 0 8px 18px rgba(132, 142, 164, 0.08);
}

.file-dialog-inline-upload-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 300px;
  max-width: min(440px, 92vw);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(224, 228, 236, 0.96);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 28px rgba(114, 126, 146, 0.16);
  display: grid;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 8;
}

.file-dialog-inline-upload-stack:hover .file-dialog-inline-upload-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.file-dialog-inline-upload-popover-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}

.file-dialog-inline-upload-popover-item:hover {
  background: rgba(246, 248, 252, 0.92);
}

.file-dialog-inline-upload-popover-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.file-dialog-inline-upload-popover-name {
  min-width: 0;
  font-size: 13px;
  color: #232a36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-dialog-message.user .file-dialog-message-bubble {
  border-radius: 18px;
  background: #eef4ff;
  border-color: #dce8ff;
}

.file-dialog-citation-row {
  max-width: min(1280px, 98%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-dialog-citation-chip {
  min-width: 0;
  max-width: 340px;
  border: 1px solid rgba(190, 208, 236, 0.9);
  border-radius: 999px;
  padding: 6px 10px 6px 7px;
  background: rgba(246, 249, 255, 0.96);
  color: #2a4f82;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.file-dialog-citation-chip:hover,
.file-dialog-citation-chip:focus-visible {
  border-color: rgba(94, 135, 205, 0.95);
  background: rgba(234, 241, 255, 0.98);
}

.file-dialog-citation-index {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(80, 124, 205, 0.12);
  color: #315fba;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 11px;
}

.file-dialog-citation-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-dialog-message-actions {
  max-width: min(1280px, 98%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.file-dialog-message:hover .file-dialog-message-actions,
.file-dialog-message:focus-within .file-dialog-message-actions {
  opacity: 1;
  transform: translateY(0);
}

.file-dialog-message-action {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.file-dialog-thinking-card {
  max-width: min(760px, 92%);
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(225, 232, 242, 0.95);
  background: rgba(248, 250, 255, 0.94);
}

.file-dialog-thinking-card.active {
  border-color: rgba(152, 183, 240, 0.95);
  background: rgba(244, 248, 255, 0.98);
}

.file-dialog-thinking-card.done {
  border-color: rgba(211, 223, 239, 0.92);
  background: rgba(249, 251, 255, 0.94);
}

.file-dialog-thinking-card.error {
  border-color: rgba(233, 183, 183, 0.96);
  background: rgba(255, 247, 247, 0.98);
}

.file-dialog-thinking-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #244067;
  font-size: 14px;
  font-weight: 700;
}

.file-dialog-thinking-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5b86e3;
  box-shadow: 0 0 0 4px rgba(91, 134, 227, 0.14);
  animation: file-dialog-thinking-pulse 1.4s ease-in-out infinite;
}

.file-dialog-thinking-card.done .file-dialog-thinking-dot {
  background: #7d93b7;
  box-shadow: 0 0 0 4px rgba(125, 147, 183, 0.12);
  animation: none;
}

.file-dialog-thinking-card.error .file-dialog-thinking-dot {
  background: #d05c5c;
  box-shadow: 0 0 0 4px rgba(208, 92, 92, 0.14);
  animation: none;
}

.file-dialog-thinking-details {
  display: grid;
  gap: 8px;
}

.file-dialog-thinking-details summary {
  list-style: none;
  cursor: pointer;
  color: #647a9c;
  font-size: 12px;
  font-weight: 700;
}

.file-dialog-thinking-details summary::-webkit-details-marker {
  display: none;
}

.file-dialog-thinking-details summary:hover {
  color: #46679b;
}

.file-dialog-qa-process {
  max-width: min(1280px, 98%);
  display: grid;
  gap: 8px;
}

.file-dialog-qa-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(225, 232, 242, 0.9);
  background: rgba(248, 250, 255, 0.9);
}

.file-dialog-qa-step-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: #9aa8ba;
  box-shadow: 0 0 0 4px rgba(154, 168, 186, 0.14);
}

.file-dialog-qa-step.active .file-dialog-qa-step-dot {
  background: #3f7ee8;
  box-shadow: 0 0 0 4px rgba(63, 126, 232, 0.16);
}

.file-dialog-qa-step.success .file-dialog-qa-step-dot {
  background: #2f9d68;
  box-shadow: 0 0 0 4px rgba(47, 157, 104, 0.16);
}

.file-dialog-qa-step.error .file-dialog-qa-step-dot {
  background: #d24c4c;
  box-shadow: 0 0 0 4px rgba(210, 76, 76, 0.16);
}

.file-dialog-qa-step.info .file-dialog-qa-step-dot {
  background: #7287a5;
}

.file-dialog-qa-step-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-dialog-qa-step-label {
  font-size: 13px;
  font-weight: 800;
  color: #25486f;
}

.file-dialog-qa-step-detail {
  font-size: 12px;
  line-height: 1.5;
  color: #72839c;
  word-break: break-word;
}

.file-dialog-process-list {
  max-width: min(1280px, 98%);
  display: grid;
  gap: 10px;
}

.file-dialog-process-list.compact {
  max-width: 100%;
}

.file-dialog-process-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(225, 232, 242, 0.94);
  background: rgba(248, 250, 255, 0.92);
}

.file-dialog-process-list.compact .file-dialog-process-item {
  padding: 9px 10px;
}

.file-dialog-process-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 7px;
  background: #8aa0bd;
  box-shadow: 0 0 0 4px rgba(138, 160, 189, 0.14);
}

.file-dialog-process-item.active .file-dialog-process-dot {
  background: #3f7ee8;
  box-shadow: 0 0 0 4px rgba(63, 126, 232, 0.16);
}

.file-dialog-process-item.success .file-dialog-process-dot {
  background: #2f9d68;
  box-shadow: 0 0 0 4px rgba(47, 157, 104, 0.16);
}

.file-dialog-process-item.error .file-dialog-process-dot {
  background: #d24c4c;
  box-shadow: 0 0 0 4px rgba(210, 76, 76, 0.16);
}

.file-dialog-process-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-dialog-process-title {
  font-size: 13px;
  font-weight: 800;
  color: #25486f;
}

.file-dialog-process-message {
  font-size: 13px;
  line-height: 1.55;
  color: #33445e;
  word-break: break-word;
}

.file-dialog-process-meta {
  font-size: 12px;
  line-height: 1.45;
  color: #7b8ca4;
  word-break: break-word;
}

.file-dialog-process-empty {
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(190, 208, 236, 0.9);
  background: rgba(248, 250, 255, 0.78);
  display: grid;
  gap: 5px;
}

.file-dialog-process-groups {
  max-width: min(1280px, 98%);
  display: grid;
  gap: 10px;
}

.file-dialog-process-groups.compact {
  max-width: 100%;
}

.file-dialog-process-file {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(225, 232, 242, 0.94);
  background: rgba(248, 250, 255, 0.92);
  display: grid;
  gap: 10px;
}

.file-dialog-process-file.active {
  border-color: rgba(92, 137, 212, 0.82);
  background: rgba(243, 247, 255, 0.96);
}

.file-dialog-process-file.success {
  border-color: rgba(142, 205, 169, 0.82);
  background: rgba(243, 250, 245, 0.95);
}

.file-dialog-process-file.error {
  border-color: rgba(226, 154, 154, 0.9);
  background: rgba(255, 247, 247, 0.96);
}

.file-dialog-process-file-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.file-dialog-process-file-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.file-dialog-process-file-title {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #253b58;
  line-height: 1.45;
  word-break: break-word;
}

.file-dialog-process-file-meta {
  font-size: 12px;
  line-height: 1.45;
  color: #75879f;
  word-break: break-word;
}

.file-dialog-process-state {
  flex: 0 0 auto;
  max-width: 120px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(231, 239, 255, 0.94);
  color: #315fba;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-dialog-process-state.success {
  background: rgba(226, 247, 235, 0.96);
  color: #24774e;
}

.file-dialog-process-state.error {
  background: rgba(255, 231, 231, 0.96);
  color: #a83c3c;
}

.file-dialog-process-file-events {
  display: grid;
  gap: 7px;
}

.file-dialog-process-file-event {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.file-dialog-process-file-event > span {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: #8aa0bd;
}

.file-dialog-process-file-event.active > span {
  background: #3f7ee8;
}

.file-dialog-process-file-event.success > span {
  background: #2f9d68;
}

.file-dialog-process-file-event.error > span {
  background: #d24c4c;
}

.file-dialog-process-file-event-message {
  font-size: 12px;
  line-height: 1.5;
  color: #354761;
  word-break: break-word;
}

.file-dialog-process-file-event-meta {
  font-size: 11px;
  line-height: 1.45;
  color: #8192aa;
}

.file-dialog-report {
  display: grid;
  gap: 12px;
}

.file-dialog-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.file-dialog-report-stat {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(225, 232, 242, 0.94);
  background: rgba(248, 250, 255, 0.92);
  display: grid;
  gap: 2px;
}

.file-dialog-report-value {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
  color: #25486f;
}

.file-dialog-report-label {
  font-size: 12px;
  color: #778aa3;
}

.file-dialog-report-meta {
  font-size: 12px;
  line-height: 1.6;
  color: #526783;
}

.file-dialog-report-files {
  display: grid;
  gap: 8px;
}

.file-dialog-report-file {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(225, 232, 242, 0.88);
  background: rgba(255, 255, 255, 0.84);
  display: grid;
  gap: 4px;
}

.file-dialog-report-file-title {
  font-size: 12px;
  font-weight: 800;
  color: #253b58;
  line-height: 1.45;
  word-break: break-word;
}

.file-dialog-report-file-meta {
  font-size: 11px;
  color: #7b8ca4;
  line-height: 1.45;
}

.file-dialog-composer {
  width: min(860px, calc(100% - 48px));
  margin: 0 auto 16px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(222, 226, 233, 0.95);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(25, 30, 40, 0.08);
  display: grid;
  gap: 8px;
}

.file-dialog-side-body {
  min-height: 0;
  overflow: hidden;
}

.file-dialog-history-shell {
  height: 100%;
  padding: 16px 10px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
}

.file-dialog-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.file-dialog-history-brand {
  padding-left: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #1f2329;
}

.file-dialog-new-chat-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(220, 224, 230, 0.95);
  background: #ffffff;
  color: #1f2329;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.file-dialog-new-chat-btn:hover,
.file-dialog-new-chat-btn:focus-visible {
  background: #f0f2f5;
}

.file-dialog-current-session {
  padding: 0 8px;
  font-size: 12px;
  color: #8a8f99;
  word-break: break-all;
}

.file-dialog-history-label {
  padding: 12px 8px 0;
  font-size: 12px;
  color: #8a8f99;
}

.file-dialog-history-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 2px;
}

.file-dialog-history-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  border-radius: 12px;
}

.file-dialog-history-entry:hover,
.file-dialog-history-entry.active,
.file-dialog-history-entry.menu-open {
  background: #ffffff;
}

.file-dialog-history-item {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1f2329;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.file-dialog-history-item:hover,
.file-dialog-history-item.active {
  background: transparent;
}

.file-dialog-history-more {
  width: 30px;
  height: 30px;
  margin: 8px 8px 0 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9aa0aa;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.file-dialog-history-more > span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: block;
}

.file-dialog-history-entry:hover .file-dialog-history-more,
.file-dialog-history-entry.menu-open .file-dialog-history-more,
.file-dialog-history-more.active {
  background: rgba(243, 245, 248, 0.98);
  color: #636c79;
}

.file-dialog-history-more:hover,
.file-dialog-history-more:focus-visible {
  background: rgba(236, 239, 244, 0.98);
  color: #2d3440;
}

.file-dialog-history-menu {
  position: absolute;
  top: 40px;
  right: 8px;
  min-width: 158px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(228, 232, 239, 0.98);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 16px 34px rgba(22, 29, 37, 0.12);
  backdrop-filter: blur(14px);
  z-index: 18;
}

.file-dialog-history-menu-item {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2a3038;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.file-dialog-history-menu-item:hover,
.file-dialog-history-menu-item:focus-visible {
  background: rgba(245, 247, 250, 0.98);
}

.file-dialog-history-menu-item.danger {
  color: #e14a4a;
}

.file-dialog-history-menu-item.danger:hover,
.file-dialog-history-menu-item.danger:focus-visible {
  background: rgba(255, 241, 241, 0.98);
}

.file-dialog-history-menu-icon {
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7b8492;
  font-size: 13px;
  flex: 0 0 16px;
}

.file-dialog-history-menu-item.danger .file-dialog-history-menu-icon {
  color: inherit;
}

.file-dialog-history-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: rgba(235, 238, 243, 0.98);
}

.file-dialog-history-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.file-dialog-history-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(242, 245, 250, 0.98);
  color: #7b8696;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.file-dialog-history-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #9aa0aa;
}

.file-dialog-history-empty {
  padding: 12px 8px;
  color: #9aa0aa;
  font-size: 13px;
}

.file-dialog-scroll-to-bottom {
  position: sticky;
  bottom: 18px;
  margin: -56px auto 0;
  z-index: 4;
  align-self: center;
  border: 1px solid rgba(190, 208, 236, 0.96);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #315fba;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(96, 118, 160, 0.14);
  cursor: pointer;
}

.file-dialog-scroll-to-bottom:hover,
.file-dialog-scroll-to-bottom:focus-visible {
  background: rgba(244, 248, 255, 0.98);
  border-color: rgba(116, 154, 222, 0.96);
}

@keyframes file-dialog-thinking-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.82);
    opacity: 0.72;
  }
}

.file-dialog-side-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr;
}

.file-dialog-side-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  display: grid;
  align-content: start;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 175, 205, 0.9) rgba(236, 241, 248, 0.9);
}

.file-dialog-side-scroll::-webkit-scrollbar {
  width: 8px;
}

.file-dialog-side-scroll::-webkit-scrollbar-track {
  background: rgba(236, 241, 248, 0.9);
  border-radius: 999px;
}

.file-dialog-side-scroll::-webkit-scrollbar-thumb {
  background: rgba(156, 175, 205, 0.92);
  border-radius: 999px;
}

.file-dialog-side-section {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(220, 228, 239, 0.92);
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  gap: 12px;
}

.file-dialog-side-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file-dialog-side-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #25486f;
}

.file-dialog-side-section-meta {
  font-size: 12px;
  color: #7f90a8;
  text-align: right;
}

.file-dialog-side-section-meta-left {
  margin-top: 4px;
  text-align: left;
  word-break: break-all;
}

.file-dialog-session-section {
  background: rgba(246, 249, 255, 0.96);
}

.file-dialog-session-new-btn {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.file-dialog-side-list {
  display: grid;
  gap: 10px;
}

.file-dialog-side-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(225, 232, 242, 0.94);
  background: rgba(248, 250, 255, 0.9);
  display: grid;
  gap: 6px;
}

.file-dialog-side-item[tabindex],
button.file-dialog-side-item {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.file-dialog-openable-item:hover,
.file-dialog-openable-item:focus-visible {
  border-color: rgba(98, 139, 205, 0.9);
  background: rgba(241, 246, 255, 0.96);
}

.file-dialog-side-item.citation-item {
  background: rgba(245, 248, 255, 0.96);
}

.file-dialog-side-item-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.file-dialog-source-toggle {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(190, 208, 236, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: #315fba;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.file-dialog-source-toggle.selected {
  border-color: rgba(61, 138, 91, 0.85);
  background: rgba(226, 247, 235, 0.96);
  color: #24774e;
}

.file-dialog-source-toggle:hover,
.file-dialog-source-toggle:focus-visible {
  border-color: rgba(94, 135, 205, 0.95);
}

.file-dialog-selected-sources-section {
  background: rgba(244, 250, 246, 0.96);
}

.file-dialog-selected-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-dialog-selected-source-pill {
  max-width: 100%;
  padding: 6px 7px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(142, 205, 169, 0.82);
  background: rgba(255, 255, 255, 0.94);
  color: #2b5d42;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.file-dialog-selected-source-pill > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-dialog-selected-source-pill > button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(47, 157, 104, 0.12);
  color: #24774e;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.file-dialog-side-item.real-item {
  background: rgba(243, 250, 245, 0.92);
}

.file-dialog-side-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.file-dialog-side-item-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #253b58;
  word-break: break-word;
}

.file-dialog-side-item-meta {
  font-size: 12px;
  color: #7b8ca4;
}

.file-dialog-side-item-note {
  font-size: 12px;
  line-height: 1.6;
  color: #4f6586;
}

.file-dialog-side-item-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(231, 239, 255, 0.94);
  color: #2a5db8;
  font-size: 11px;
  font-weight: 700;
}

.file-dialog-side-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-dialog-attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-dialog-attachment-card {
  min-width: 0;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 247, 250, 0.98), rgba(239, 241, 246, 0.98));
  border: 1px solid rgba(214, 219, 228, 0.92);
}

.file-dialog-attachment-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #5f8fff, #4f76e6);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.file-dialog-attachment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.file-dialog-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #26344f;
}

.file-dialog-attachment-meta {
  font-size: 12px;
  color: #75809a;
}

.file-dialog-attachment-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #94a0ba;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.file-dialog-input {
  min-height: 44px;
  max-height: 220px;
  margin-top: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  resize: none;
}

.file-dialog-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.file-dialog-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.file-dialog-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#tab-block-writer #fileDialogOrganizeButton {
  border: 0;
  background: transparent;
  color: #4f5968;
  min-height: 34px;
  padding: 6px 8px;
}

#tab-block-writer #fileDialogSendButton {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 14px;
  background: #2f6feb;
  box-shadow: none;
}


@media (max-width: 1200px) {
  #tab-block-writer .ai-chat-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - 24px);
  }

  #tab-block-writer .ai-chat-main-panel {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 24px);
  }

  #tab-block-writer .file-dialog-side-panel {
    height: auto;
    min-height: 0;
  }

  .file-dialog-side-body {
    min-height: 320px;
  }

  .file-dialog-chat-stream {
    padding: 4px 1% 0;
  }

  .file-dialog-message-bubble {
    max-width: 100%;
  }

  .file-dialog-inline-upload-stack {
    max-width: 100%;
  }

  .file-dialog-inline-upload-pill {
    width: min(100%, 240px);
  }

  .file-dialog-inline-upload-popover {
    min-width: 260px;
  }

  .file-dialog-composer {
    width: 100%;
  }

}

@media (max-width: 720px) {
  .file-dialog-side-section-head,
  .file-dialog-side-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.prompt-input {
  width: 100%;
  min-height: 180px;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px;
  resize: vertical;
  background: #fff;
}

.action-row,
.mode-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mode-btn.active {
  background: #eef3ea;
  border-color: #90a686;
}

.node-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.node-chip {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: #eff1ea;
  color: #51604a;
}

@media (max-width: 1200px) {
  .files-process-monitor {
    grid-template-columns: 1fr;
  }

  .files-process-card {
    height: 236px;
    max-height: 236px;
  }

  .files-process-card-body {
    min-height: 0;
  }

  .files-process-stage-row {
    grid-template-columns: 1fr;
  }

  .files-process-current-grid {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .workspace,
  .files-layout,
  .ai-chat-layout,
  .ai-layout,
  .ai-workbench {
    grid-template-columns: 1fr;
  }

  .graph-stage {
    height: clamp(420px, 62vh, 560px);
    min-height: 0;
  }

  .page-list {
    max-height: 320px;
  }

  .large-preview {
    min-height: 320px;
  }

  .files-sidebar {
    padding: 0;
    border-right: 0;
  }

  .files-center-column,
  .files-actions-panel-wide,
  .files-summary-panel,
  .files-sidebar {
    grid-area: auto;
  }

  .files-summary-panel {
    min-height: 0;
    position: static;
  }

  .files-summary-body {
    min-height: 320px;
    max-height: none;
  }

  .entry-card-upload-strip {
    grid-template-columns: 1fr;
  }

  .upload-strip-action {
    justify-content: stretch;
  }

  .files-main-classic {
    padding: 0;
  }

  .start-hub-grid {
    grid-template-columns: 1fr;
  }

  .save-modal-grid,
  .quick-ask-row,
  .entry-card-actions,
  .files-secondary-actions,
  .grader-summary-grid {
    grid-template-columns: 1fr;
  }

  .grader-visual-grid,
  .grader-card-grid,
  .grader-question-grid,
  .grader-student-stats {
    grid-template-columns: 1fr;
  }

  .lesson-hero-frame {
    grid-template-columns: 1fr;
  }

  .lesson-slide-card {
    aspect-ratio: auto;
    min-height: 0;
  }

  .grader-breakdown-col {
    width: 520px;
    min-width: 320px;
  }
}

@media (max-width: 720px) {
  .toolbar-actions {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-btn {
    flex: 1;
  }

  .graph-stage-foot {
    flex-direction: column;
    gap: 6px;
  }

  .lesson-ppt-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .lesson-slide-sidebar {
    max-height: none;
  }

  .lesson-file-preview-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .lesson-file-thumb-list {
    max-height: none;
  }

  .lesson-slide-stage {
    min-height: 0;
    padding: 12px;
  }

  .lesson-slide-card {
    aspect-ratio: auto;
    min-height: 0;
    width: 100%;
  }

  .grader-mistake-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .grader-mistake-metric {
    text-align: left;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .doc-preview-head-side {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .doc-preview-modal-card {
    width: calc(100vw - 16px);
    margin: 8px auto;
    max-height: calc(100vh - 16px);
  }
}

@media (max-width: 720px) {
  .files-process-card {
    height: auto;
    max-height: none;
  }
}

/* Product-facing polish for graph, governance, and AI tabs. Keep functionality
   intact while aligning the experience with the main workbench style. */

.graph-shell {
  padding: 10px 0 0;
}

.graph-shell-solo {
  padding: 0;
}

.graph-layout-solo {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.graph-canvas-panel-solo {
  padding: 18px 20px 14px;
  border-radius: 30px;
  border: 1px solid rgba(205, 217, 231, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.92)),
    linear-gradient(135deg, rgba(241, 246, 254, 0.86), rgba(255, 255, 255, 0.92));
  box-shadow: var(--shadow);
}

.graph-shell .canvas-toolbar {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(220, 228, 239, 0.92);
}

.graph-shell .canvas-toolbar h2 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.04;
  font-weight: 800;
  color: #1b3158;
}

.graph-shell .eyebrow {
  color: #6e83a4;
  letter-spacing: 0.18em;
}

.graph-shell .preview-subtitle,
.graph-shell .panel-meta,
.graph-shell .selected-summary,
.graph-shell .meta-item,
.graph-shell .empty,
.graph-shell .page-item-meta,
.graph-shell .link-item-meta,
.graph-shell #graphFootnote,
.graph-shell #graphViewHint {
  color: #6b7b91;
}

.graph-stage {
  border-radius: 28px;
  border: 1px solid rgba(210, 220, 233, 0.9);
  min-height: 0;
  height: clamp(480px, 62vh, 700px);
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 82% 24%, rgba(231, 240, 255, 0.68), rgba(231, 240, 255, 0) 30%),
    linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 18px 40px rgba(58, 84, 126, 0.08);
}

.graph-stage-foot {
  padding: 2px 2px 0;
}

.graph-sidepanel {
  position: sticky;
  top: 22px;
  gap: 14px;
  padding-left: 0;
  border-left: 0;
  max-height: calc(100vh - 22px);
  overflow: hidden;
}

.graph-side-card,
.graph-shell .graph-sidepanel .graph-side-card,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) {
  height: auto;
  min-height: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(248, 251, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.graph-nav-card {
  height: 210px;
  min-height: 210px;
  max-height: 210px;
}

.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2),
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(3),
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(4),
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(5) {
  height: 190px;
  min-height: 190px;
  max-height: 190px;
}

.graph-shell .graph-sidepanel > .graph-side-card:last-child {
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  flex: 0 0 auto;
}

.graph-shell .panel-title,
.graph-shell .page-item-title,
.graph-shell .link-item-title,
.graph-shell .meta-item strong,
.graph-shell .selected-summary,
.graph-shell #previewPanel {
  color: #203655;
}

.graph-shell .graph-side-card .panel-title {
  font-size: 15px;
  font-weight: 800;
}

.graph-shell .page-list,
.graph-shell .link-list {
  gap: 8px;
}

.graph-shell .graph-sidepanel .panel-head {
  flex: 0 0 auto;
}

.graph-shell .graph-sidepanel .panel-title,
.graph-shell .graph-sidepanel .related-title,
.graph-shell .graph-sidepanel .selected-summary,
.graph-shell .graph-sidepanel .meta-list {
  flex: 0 0 auto;
}

.graph-shell .page-item,
.graph-shell .link-item,
.graph-shell .graph-nav-card .page-item,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .page-item,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) .link-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(220, 228, 239, 0.82);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.graph-shell .page-item.active,
.graph-shell .link-item.active {
  border-color: rgba(121, 156, 222, 0.94);
  background: rgba(237, 243, 255, 0.96);
  box-shadow: 0 10px 22px rgba(79, 111, 190, 0.12);
}

.graph-shell .page-item:hover,
.graph-shell .link-item:hover {
  transform: none;
  background: rgba(243, 247, 255, 0.94);
  border-color: rgba(186, 202, 227, 0.94);
}

.graph-shell .page-item-title,
.graph-shell .link-item-title {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

.graph-shell .page-item-meta,
.graph-shell .link-item-meta {
  display: block;
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.82;
  white-space: normal;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

.graph-shell .ghost-btn,
.graph-shell .primary-btn,
.graph-shell .segmented-btn {
  min-height: 38px;
  border-radius: 14px;
  font-size: 13px;
}

.graph-shell .ghost-btn {
  border-color: rgba(194, 206, 221, 0.9);
  background: rgba(255, 255, 255, 0.8);
  color: #2f486d;
}

.graph-shell .primary-btn {
  background: linear-gradient(135deg, var(--accent), #5f90f2);
  color: #fff;
  border-color: rgba(38, 92, 203, 0.76);
}

.graph-shell .segmented-control {
  border-color: rgba(194, 206, 221, 0.88);
  background: rgba(246, 249, 253, 0.96);
}

.graph-shell .segmented-btn {
  color: #6a7c95;
}

.graph-shell .segmented-btn.active {
  background: rgba(233, 240, 255, 0.96);
  color: #1f57c6;
  box-shadow: inset 0 0 0 1px rgba(151, 178, 225, 0.34);
}

.graph-shell #previewPanel,
.graph-shell .selected-summary,
.graph-sidepanel #selectedMeta.meta-list {
  max-height: none;
}

.graph-shell .graph-nav-card #pageList.page-list,
.graph-shell .graph-sidepanel .link-list,
.graph-sidepanel #selectedMeta.meta-list,
.graph-shell #previewPanel {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.graph-shell .graph-sidepanel .link-list::-webkit-scrollbar,
.graph-sidepanel #selectedMeta.meta-list::-webkit-scrollbar,
.graph-shell #previewPanel::-webkit-scrollbar,
.graph-shell .graph-nav-card #pageList.page-list::-webkit-scrollbar {
  width: 8px;
}

.graph-shell .graph-sidepanel .link-list::-webkit-scrollbar-thumb,
.graph-sidepanel #selectedMeta.meta-list::-webkit-scrollbar-thumb,
.graph-shell #previewPanel::-webkit-scrollbar-thumb,
.graph-shell .graph-nav-card #pageList.page-list::-webkit-scrollbar-thumb {
  background: rgba(163, 180, 208, 0.88);
  border-radius: 999px;
}

.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #backlinksList,
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #childrenList {
  max-height: none;
}

.graph-manage-layout .doc-card.selected {
  border-color: rgba(66, 115, 210, 0.9);
  box-shadow: 0 10px 24px rgba(66, 115, 210, 0.12);
}

#graphManagerTree .folder-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

#graphManagerTree .folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(204, 214, 230, 0.9);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

#graphManagerTree .folder-row.active {
  border-color: rgba(66, 115, 210, 0.9);
  background: rgba(239, 244, 255, 0.95);
}

#graphManagerTree .folder-child-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 14px;
}

#graphManagerTree .folder-row-child {
  font-size: 13px;
}

#graphManagerTree .folder-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(233, 238, 247, 0.95);
  color: #51627d;
  font-size: 12px;
  text-align: center;
}

#graphManagerTree .graph-tree-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#graphManagerTree .graph-tree-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#graphManagerTree .graph-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #263547;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

#graphManagerTree .graph-tree-node:hover {
  background: rgba(240, 245, 253, 0.92);
}

#graphManagerTree .graph-tree-node.active {
  color: #10243f;
  font-weight: 700;
  background: rgba(236, 243, 255, 0.96);
}

#graphManagerTree .graph-tree-arrow,
#graphManagerTree .graph-tree-dot {
  width: 12px;
  flex: 0 0 12px;
  color: #58697f;
}

#graphManagerTree .graph-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

#graphManagerTree .root-children {
  padding-left: 16px;
}

#graphManagerTree .level-1-children {
  padding-left: 18px;
}

#graphManagerTree .level-0 {
  font-weight: 800;
}

#graphManagerTree .level-1 {
  font-weight: 700;
}

#graphManagerTree .level-2 {
  font-size: 13px;
  color: #33465c;
}

#graphManagerList {
  display: block;
}

.graph-manager-canvas-shell {
  min-height: 520px;
}

.graph-manager-canvas-svg {
  min-height: 520px;
}

.graph-manager-graph-host {
  min-height: 0;
}

.graph-manager-graph-node.selected .single-file-graph-node-dot {
  fill: #2f3b31;
  stroke: rgba(216, 228, 206, 0.96);
  stroke-width: 2;
  filter: drop-shadow(0 0 12px rgba(114, 145, 109, 0.28));
}

.graph-manager-graph-node.selected .single-file-graph-node-label {
  font-size: 12px;
  font-weight: 700;
  fill: #2f3b31;
}

#graphManagerTree .folder-count {
  background: transparent;
  color: #75849a;
  padding: 0;
  min-width: auto;
  border-radius: 0;
  font-size: 12px;
}

#graphManagerTree .graph-tree-group {
  gap: 2px;
}

#graphManagerDetail .files-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#graphManagerDetail .files-editor-label {
  font-size: 12px;
  font-weight: 700;
  color: #5e6d85;
}

.graph-shell .graph-sidepanel > .graph-side-card:nth-child(4) #sourceFilesList,
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(5) #relatedFilesList,
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(3) #relationReasonList {
  flex: 1 1 auto;
}

.graph-sidepanel .graph-node-actions {
  flex: 0 0 auto;
  margin-top: 10px;
}

.graph-shell #previewPanel {
  border: 1px solid rgba(212, 222, 235, 0.88);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  padding: 12px 14px;
  flex: 1 1 auto;
}

.graph-shell .node-badge {
  border: 1px solid rgba(172, 195, 234, 0.9);
  background: rgba(231, 239, 255, 0.96);
  color: #255fbd;
}

.ai-chat-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.95fr);
  gap: 18px;
}

.ai-chat-main-panel {
  padding: 20px;
  border-radius: 26px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.ai-chat-main-panel .panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(220, 228, 239, 0.92);
}

.ai-workbench {
  grid-template-columns: 340px minmax(0, 1fr) minmax(340px, 0.96fr);
  gap: 18px;
}

.ai-sidebar-panel,
.ai-main-column > .panel,
.ai-workbench > .panel {
  border-radius: 26px;
  border: 1px solid rgba(209, 220, 234, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.ai-sidebar-panel,
.ai-main-column > .panel,
.ai-workbench > .panel {
  padding: 20px;
}

.ai-sidebar-panel .panel-head,
.ai-main-column > .panel .panel-head,
.ai-workbench > .panel .panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(220, 228, 239, 0.92);
}

.ai-main-column {
  gap: 18px;
}

.avatar-page {
  display: grid;
  gap: 28px;
  padding: 28px 34px 40px;
}

.avatar-page-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  color: #14233b;
}

.avatar-page-header p {
  margin: 12px 0 0;
  color: #6f7d92;
  line-height: 1.6;
}

.avatar-library-panel,
.avatar-builder-panel,
.avatar-preview-panel {
  border-radius: 22px;
  border: 1px solid rgba(211, 224, 244, 0.96);
  background: #fff;
  box-shadow: 0 10px 28px rgba(85, 111, 156, 0.08);
  padding: 22px 28px 26px;
}

.avatar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.avatar-builder-head {
  margin-bottom: 18px;
}

.avatar-primary-btn,
.avatar-flat-btn {
  min-width: 116px;
}

.avatar-library-scroll {
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.avatar-library-scroll::-webkit-scrollbar {
  height: 10px;
}

.avatar-library-scroll::-webkit-scrollbar-thumb {
  background: rgba(147, 158, 180, 0.85);
  border-radius: 999px;
}

.avatar-library-track {
  display: flex;
  gap: 22px;
  min-width: max-content;
}

.avatar-library-card {
  width: 300px;
  flex: 0 0 300px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(210, 223, 242, 0.96);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 24px rgba(77, 104, 152, 0.08);
}

.avatar-library-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.avatar-library-card-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.avatar-card-menu-shell {
  position: relative;
  flex: 0 0 auto;
}

.avatar-card-more-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #7a8aa2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.avatar-card-more-btn > span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  display: block;
}

.avatar-card-more-btn:hover,
.avatar-card-more-btn:focus-visible,
.avatar-library-card.menu-open .avatar-card-more-btn {
  background: rgba(236, 242, 251, 0.96);
  color: #334a72;
}

.avatar-card-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 120px;
  padding: 8px;
  border: 1px solid rgba(214, 223, 238, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(75, 96, 138, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}

.avatar-library-card.menu-open .avatar-card-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.avatar-card-menu-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #c23d4b;
  cursor: pointer;
}

.avatar-card-menu-item:hover,
.avatar-card-menu-item:focus-visible {
  background: rgba(255, 239, 241, 0.96);
}

.avatar-library-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(208, 223, 247, 0.96);
}

.avatar-library-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #19283f;
}

.avatar-library-card-scene {
  margin: 6px 0 0;
  font-size: 13px;
  color: #7c899d;
}

.avatar-library-card-meta {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.avatar-library-card-meta div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #4d5c75;
}

.avatar-library-card-meta strong {
  color: #1d2a40;
  font-weight: 700;
}

.avatar-library-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.avatar-library-card-actions .ghost-btn,
.avatar-library-card-actions .primary-btn {
  flex: 1 1 0;
}

.avatar-builder-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  margin-bottom: 22px;
}

.avatar-builder-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 530px;
  gap: 28px;
  align-items: start;
}

.avatar-builder-left {
  display: grid;
  gap: 18px;
}

.avatar-builder-right {
  display: grid;
  gap: 18px;
  align-content: start;
}

.avatar-form-row {
  display: grid;
  gap: 10px;
}

.avatar-form-label {
  font-size: 13px;
  font-weight: 700;
  color: #3b4b63;
}

.avatar-input {
  min-height: 46px;
  border-radius: 14px;
}

.avatar-portrait-picker {
  display: grid;
  gap: 12px;
}

.avatar-portrait-current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(213, 224, 241, 0.96);
  border-radius: 16px;
  background: rgba(247, 250, 255, 0.96);
}

.avatar-portrait-current img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-portrait-current-copy {
  display: grid;
  gap: 2px;
}

.avatar-portrait-current-copy strong {
  color: #22344f;
  font-size: 14px;
}

.avatar-portrait-current-copy span {
  color: #8692a6;
  font-size: 12px;
}

.avatar-upload-box {
  min-height: 92px;
  border-radius: 16px;
  border: 2px dashed rgba(202, 211, 226, 0.96);
  background: rgba(251, 252, 255, 0.96);
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
  color: #8390a6;
  padding: 18px;
}

.avatar-upload-box strong {
  color: #5f6f87;
}

.avatar-upload-icon {
  font-size: 12px;
  font-weight: 800;
  color: #7f8a9c;
}

.avatar-voice-list {
  display: grid;
  gap: 12px;
}

.avatar-voice-option {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(216, 226, 241, 0.96);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
}

.avatar-voice-option:hover {
  border-color: rgba(93, 136, 231, 0.76);
}

.avatar-voice-option.active {
  border-color: #2b62f3;
  background: rgba(244, 248, 255, 0.98);
  box-shadow: 0 0 0 2px rgba(43, 98, 243, 0.1);
}

.avatar-voice-copy {
  display: grid;
  gap: 2px;
}

.avatar-voice-copy strong {
  color: #18283f;
  font-size: 15px;
}

.avatar-voice-copy span {
  color: #8b97ab;
  font-size: 12px;
}

.avatar-save-btn {
  width: 100%;
  min-height: 46px;
  font-size: 18px;
}

.avatar-preview-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.avatar-preview-photo {
  width: 210px;
  height: 280px;
  border-radius: 16px;
  object-fit: cover;
  border: 4px solid rgba(213, 226, 246, 0.96);
}

.avatar-preview-copy {
  display: grid;
  gap: 14px;
}

.avatar-preview-name {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #16253c;
}

.avatar-preview-desc {
  margin: 0;
  color: #6e7c92;
  line-height: 1.7;
}

.avatar-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avatar-preview-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(232, 241, 255, 0.96);
  color: #3060c8;
  font-size: 12px;
  font-weight: 700;
}

.avatar-preview-tag.success {
  background: rgba(225, 244, 232, 0.96);
  color: #1d7a56;
}

.avatar-preview-tag.accent {
  background: rgba(243, 232, 255, 0.96);
  color: #814ecf;
}

.avatar-preview-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-dialog-card {
  width: min(1080px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
}

.avatar-dialog-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(220, 228, 239, 0.92);
}

.avatar-dialog-body {
  margin-top: 18px;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 20px;
  min-height: 0;
  overflow: hidden;
}

.avatar-dialog-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98), rgba(238, 245, 255, 0.94));
  border: 1px solid rgba(212, 222, 235, 0.88);
}

.avatar-dialog-stage-media {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(212, 222, 235, 0.96);
  background: rgba(255, 255, 255, 0.92);
}

.avatar-dialog-photo {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.avatar-dialog-video-shell {
  position: absolute;
  inset: 0;
  margin-top: 0;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  min-height: 0;
}

.avatar-dialog-video-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
  object-fit: cover;
}

.avatar-dialog-stage-actions {
  display: none;
}

.avatar-dialog-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.avatar-dialog-messages {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(212, 222, 235, 0.88);
  background: rgba(247, 250, 255, 0.92);
}

.avatar-chat-row {
  display: flex;
}

.avatar-chat-row.user {
  justify-content: flex-end;
}

.avatar-chat-bubble {
  max-width: min(80%, 520px);
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.7;
  word-break: break-word;
}

.avatar-chat-bubble.assistant {
  background: rgba(255, 255, 255, 0.96);
  color: #2c405f;
  box-shadow: 0 8px 16px rgba(96, 114, 146, 0.08);
}

.avatar-chat-bubble.user {
  background: linear-gradient(135deg, #1c65df, #5a95f5);
  color: #fff;
}

.avatar-chat-bubble.pending {
  opacity: 0.78;
}

.avatar-chat-bubble.error {
  background: rgba(255, 243, 242, 0.98);
  color: #9f2d24;
}

.avatar-chat-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #6f8096;
}

.avatar-dialog-composer {
  display: flex;
  gap: 12px;
}

.avatar-dialog-composer .ai-input {
  flex: 1 1 auto;
}

@media (max-width: 980px) {
  .avatar-builder-top,
  .avatar-builder-body,
  .avatar-preview-shell,
  .avatar-dialog-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .avatar-page {
    padding: 20px 16px 28px;
  }

  .avatar-library-panel,
  .avatar-builder-panel,
  .avatar-preview-panel {
    padding: 18px;
  }

  .avatar-portrait-grid {
    grid-template-columns: 1fr;
  }

  .avatar-library-card {
    width: 280px;
    flex-basis: 280px;
  }

  .avatar-section-head,
  .avatar-preview-actions,
  .avatar-dialog-composer {
    flex-direction: column;
    align-items: stretch;
  }
}

.ai-tool-list {
  margin-top: 16px;
  gap: 12px;
}

.ai-tool-card {
  border: 1px solid rgba(212, 222, 235, 0.86);
  background: rgba(248, 251, 255, 0.82);
  border-radius: 20px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ai-tool-card:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 201, 229, 0.94);
  background: rgba(252, 253, 255, 0.98);
  box-shadow: 0 12px 24px rgba(76, 101, 146, 0.08);
}

.ai-tool-card.active {
  border-color: rgba(128, 165, 235, 0.92);
  background: rgba(236, 243, 255, 0.96);
  box-shadow: 0 14px 28px rgba(79, 111, 190, 0.12);
}

.ai-tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

#aiOperationPanel,
#sessionList,
#aiResultPanel {
  margin-top: 16px;
}

#sessionList.link-list {
  gap: 10px;
}

#sessionList .link-item {
  border-radius: 16px;
  border: 1px solid rgba(212, 222, 235, 0.86);
  background: rgba(248, 251, 255, 0.82);
}

#aiResultPanel {
  border: 1px solid rgba(212, 222, 235, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

@media (max-width: 1400px) {
  .graph-layout-solo,
  .ai-chat-layout,
  .ai-workbench,
  .avatar-builder-grid,
  .avatar-dialog-body {
    grid-template-columns: 1fr;
  }

  .graph-sidepanel {
    position: static;
    margin-top: 2px;
    max-height: none;
    overflow: visible;
  }

  .graph-nav-card,
  .graph-shell .graph-sidepanel > .graph-side-card:nth-child(2),
  .graph-shell .graph-sidepanel > .graph-side-card:nth-child(3),
  .graph-shell .graph-sidepanel > .graph-side-card:nth-child(4),
  .graph-shell .graph-sidepanel > .graph-side-card:nth-child(5),
  .graph-shell .graph-sidepanel > .graph-side-card:last-child {
    height: auto;
    min-height: 0;
  }
}

/* Final override: graph side panels should read like structured lists, not
   cards or pills. */
.graph-shell .graph-sidepanel .graph-side-card,
.graph-shell .graph-sidepanel .graph-side-card:not(.graph-nav-card) {
  padding: 16px 0 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(213, 223, 237, 0.92);
  background: transparent;
  box-shadow: none;
}

.graph-shell .graph-sidepanel .panel-head {
  padding: 0 0 10px;
}

.graph-shell .graph-sidepanel .graph-side-card .panel-title,
.graph-shell .graph-sidepanel .graph-side-card .panel-head .panel-title {
  padding: 0;
}

.graph-shell .graph-sidepanel .page-list,
.graph-shell .graph-sidepanel .link-list {
  gap: 0;
}

.graph-shell .graph-sidepanel .page-item,
.graph-shell .graph-sidepanel .link-item,
.graph-shell .graph-nav-card .page-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  gap: 4px;
  padding: 10px 0;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(227, 233, 242, 0.88);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.graph-shell .graph-sidepanel .page-item:last-child,
.graph-shell .graph-sidepanel .link-item:last-child,
.graph-shell .graph-nav-card .page-item:last-child {
  border-bottom: 0;
}

.graph-shell .graph-sidepanel .page-item.active,
.graph-shell .graph-sidepanel .link-item.active,
.graph-shell .graph-nav-card .page-item.active {
  border-color: rgba(162, 186, 227, 0.96);
  background: transparent;
  box-shadow: none;
}

.graph-shell .graph-sidepanel .page-item:hover,
.graph-shell .graph-sidepanel .link-item:hover,
.graph-shell .graph-nav-card .page-item:hover {
  transform: none;
  background: rgba(240, 245, 252, 0.72);
}

.graph-shell .graph-sidepanel .page-item-title,
.graph-shell .graph-sidepanel .link-item-title,
.graph-shell .graph-nav-card .page-item-title {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

.graph-shell .graph-sidepanel .page-item-meta,
.graph-shell .graph-sidepanel .link-item-meta,
.graph-shell .graph-nav-card .page-item-meta {
  display: block;
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.82;
  white-space: normal;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

.graph-shell .graph-sidepanel .related-title {
  margin: 2px 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #8a99ae;
  text-transform: uppercase;
}

.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #backlinksList,
.graph-shell .graph-sidepanel > .graph-side-card:nth-child(2) #childrenList {
  max-height: none;
}

