/* SC_Brain Console Stylesheet - Elegant Enterprise Light Theme */
:root {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #2563eb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0284c7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.7rem;
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.nav-links a.active {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  font-weight: 600;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-tag {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Main Layout */
.app-main {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.page-title-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}

.page-subheading {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Stat Cards (Unified 4-Grid) */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Panel Containers */
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  gap: 0.75rem;
}

.panel-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-body {
  padding: 1.25rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  background-color: #f1f5f9;
  color: #1e293b;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background-color: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger:hover {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #f87171;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.18rem 0.5rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.badge-success {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-danger {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-info {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-neutral {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Action Banners & Notifications (Restrained & Elegant) */
.action-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid transparent;
}

.action-banner.info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.action-banner.success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.action-banner.warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.action-banner.danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Forms & Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Modals */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 580px;
  width: 100%;
  overflow: hidden;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  background-color: #f8fafc;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: #1e293b;
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Knowledge Explorer Directory Tree */
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.folder-node {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #ffffff;
}

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.folder-header:hover {
  background-color: #f1f5f9;
}

.folder-title-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.folder-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 14px;
  display: inline-block;
  transition: transform 0.15s ease;
}

.folder-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.folder-badge {
  font-size: 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-weight: 500;
}

.folder-content {
  border-top: 1px solid var(--border-color);
  display: none;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem 0.6rem 2.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.84rem;
  transition: background-color 0.1s ease;
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover {
  background-color: #f8fafc;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.file-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 1rem;
}

/* Markdown Render Container */
.markdown-body {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}

.markdown-body h1 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.markdown-body h2 {
  font-size: 1.15rem;
}

.markdown-body h3 {
  font-size: 1rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin-bottom: 0.85rem;
}

.markdown-body pre {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

.markdown-body blockquote {
  border-left: 3px solid var(--border-focus);
  padding-left: 0.75rem;
  color: var(--text-secondary);
  background-color: #f8fafc;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  font-size: 0.84rem;
}

.markdown-body th {
  background-color: #f8fafc;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

/* Document Title Link (Replaces button) */
.doc-title-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.doc-title-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Lifecycle Unified Panel & Interactive Filter Cards */
.lifecycle-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.lifecycle-stat-tile {
  background-color: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
  user-select: none;
}

.lifecycle-stat-tile:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.lifecycle-stat-tile.active {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.filter-pill.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Compact, wrapping Console query controls. */
.filter-bar > .form-select,
.filter-bar > .form-input {
  width: auto;
  min-width: 150px;
  flex: 1 1 170px;
}
.filter-bar > .btn { flex: 0 0 auto; }
.data-table details summary { cursor: pointer; }
.data-table details[open] summary { margin-bottom: .5rem; }

/* Administrator workspace: clear sections, bounded tables, responsive controls. */
:root { --header-height: 64px; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; scroll-padding-top: calc(var(--header-height) + 76px); }
.app-header { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); height: auto; min-height: 64px; padding: .65rem 1.5rem; gap: .8rem; flex-wrap: wrap; }
.brand-area, .user-area { flex-shrink: 0; min-width: 0; }
.brand-logo { flex: 0 0 32px; }
.brand-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-badge { min-width: 0; max-width: 8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header nav { min-width: 0; }
.app-header > .user-area { justify-self: end; min-width: 0; }
.app-header .admin-tag { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-tag strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-links a { white-space: nowrap; font-weight: 600; }
.app-main { max-width: 1600px; padding: 1.5rem 1.5rem 2rem; min-width: 0; overflow-wrap: anywhere; }
.page-title-bar { margin-bottom: 1.1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.page-title-bar > div { min-width: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.25rem; }
.overview-grid > .panel { min-width: 0; }
.lifecycle-summary { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.lifecycle-summary > div { min-width: 110px; }
.grid-cards { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stat-card { min-width: 0; }
.stat-value, .stat-desc { overflow-wrap: anywhere; }
.stat-version { font-size: clamp(1.15rem, 2vw, 1.75rem); }
.action-banner { flex-wrap: wrap; }
.action-banner > div { min-width: 0; }
.section-tabs { display: flex; gap: .4rem; padding: .5rem; margin: 0 0 1rem; position: sticky; top: var(--header-height); z-index: 80; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.section-tabs a { flex: 1; padding: .7rem .8rem; text-align: center; color: var(--text-secondary); font-size: .92rem; font-weight: 600; text-decoration: none; border-radius: var(--radius-sm); white-space: nowrap; }
.section-tabs a:hover { background: var(--bg-base); }
.section-tabs a[aria-selected="true"] { background: var(--accent-light); color: var(--accent-primary); box-shadow: inset 0 -2px var(--accent-primary); }
.section-tabs span { font-size: .75rem; margin-left: .35rem; font-variant-numeric: tabular-nums; }
.section-help { color: var(--text-muted); font-size: .83rem; margin: 0 0 .8rem; }
.knowledge-section { display: none; scroll-margin-top: calc(var(--header-height) + 76px); }
.knowledge-section.is-initial,
.knowledge-section:target { display: block; }
html:has(.knowledge-section:target) .knowledge-section.is-initial:not(:target) { display: none; }
.panel-header { flex-wrap: wrap; }
.panel-title { min-width: 0; }
.table-scroll { max-height: min(65vh,720px); overflow: auto; scrollbar-gutter: stable; }
.table-scroll th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px var(--border-color); }
.data-table td { overflow-wrap: anywhere; }
.data-table code { overflow-wrap: anywhere; }
.model-table { min-width: 1080px; }
.model-table td:nth-child(1), .model-table td:nth-child(2) { min-width: 160px; }
.model-table td:nth-child(3) { min-width: 125px; }
.model-table td:last-child { min-width: 150px; }
.review-table { table-layout: fixed; min-width: 940px; }
.review-table th:nth-child(1) { width: 29%; }
.review-table th:nth-child(2) { width: 27%; }
.review-table th:nth-child(3) { width: 16%; }
.review-table th:nth-child(4) { width: 28%; }
.review-table td { vertical-align: top; }
.review-table input, .review-table select { margin-bottom: .35rem; }
.review-table details { margin-top: .2rem; }
.popular-body { padding: 0; }
.audit-table { min-width: 800px; }
.users-table { min-width: 1100px; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; min-width: 240px; }
.directory-body { max-height: 65vh; overflow: auto; }
.folder-header { width: 100%; border: 0; text-align: left; font-family: inherit; gap: .75rem; }
.folder-title-area { min-width: 0; flex-wrap: wrap; gap: .4rem; }
.folder-name { overflow-wrap: anywhere; }
.folder-badge { flex-shrink: 0; }
.folder-content .data-table { min-width: 780px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.modal-card { max-height: calc(100dvh - 3rem); display: flex; flex-direction: column; }
.modal-card > form { display: flex; flex-direction: column; min-height: 0; }
.modal-header, .modal-footer { flex-shrink: 0; gap: .75rem; }
.modal-header > .btn, .modal-footer > .btn { flex-shrink: 0; }
.modal-footer { flex-wrap: wrap; }
.modal-header h3 { overflow-wrap: anywhere; }
.modal-header > div { min-width: 0; overflow-wrap: anywhere; }
.modal-body { min-height: 0; min-width: 0; }
.markdown-body { min-width: 0; overflow-wrap: anywhere; overflow-x: auto; }
#previewPath { overflow-wrap: anywhere; min-width: 0; }
.pagination { flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
a { color: var(--accent-primary); }
summary { cursor: pointer; }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -100px; z-index: 1100; padding: .75rem; background: white; }
.skip-link:focus { top: .5rem; }
@media (max-width: 1250px) {
  .app-header { grid-template-columns: minmax(0,1fr) auto; }
  .app-header nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .app-header > .user-area { grid-column: 2; grid-row: 1; }
  .nav-links { justify-content: center; }
}
@media (max-width: 900px) {
  .grid-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
}
@media (max-width: 600px) {
  .app-main { padding: 1rem .75rem 1.5rem; }
  .app-header { padding: .5rem .75rem; gap: .4rem; }
  .brand-area { gap: .4rem; flex-wrap: wrap; }
  .brand-title { font-size: .95rem; }
  .brand-badge { font-size: .65rem; }
  .admin-tag { display: none; }
  .nav-links { justify-content: flex-start; }
  .nav-links a { font-size: .8rem; padding: .4rem .65rem; }
  .section-tabs { flex-wrap: wrap; gap: .25rem; }
  .section-tabs a { flex: 1 1 40%; padding: .5rem .25rem; font-size: .85rem; }
  .panel-header, .panel-body { padding: .85rem; }
  .popular-body { padding: 0; }
  .page-heading { font-size: 1.15rem; }
  .stat-card { padding: .85rem; }
  .stat-value { font-size: 1.45rem; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: .5rem; }
  .modal-card { max-height: calc(100dvh - 1rem); }
  .modal-footer { flex-wrap: wrap; }
  .folder-title-area > span:not(.folder-arrow):not(.folder-name) { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .app-header nav { overflow: visible; }
  .nav-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .2rem; }
  .nav-links a { display: block; text-align: center; white-space: normal; font-size: .76rem; padding: .35rem .2rem; }
}

#manual-evidence { scroll-margin-top: calc(var(--header-height) + 20px); }
.save-confirmation { color: #047857; background: #ecfdf5; border-radius: 6px; padding: .6rem .8rem; margin-bottom: .75rem; }
.form-section-title { font-size: .95rem; margin: 1rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border-color); }
