/* Course Studio — premium editorial workspace */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');
@import url('canon-f1-spine.css');

.admin-courses-page {
  --acs-gold: #c6a96b;
  --acs-teal: #00bcd4;
  --acs-bg: #0a0a0a;
  --acs-panel: #121212;
  --acs-border: rgba(255, 255, 255, 0.08);
  background: var(--acs-bg);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #e8e8e8;
}

.admin-courses-page #acsApp,
.admin-courses-page .acs-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-courses-page .acs-app[hidden] {
  display: none !important;
}

.acs-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--acs-border);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.acs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acs-brand h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}

.acs-brand-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--acs-gold);
  border: 1px solid rgba(198, 169, 107, 0.35);
  padding: 3px 8px;
  border-radius: 20px;
}

.acs-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.acs-header-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.acs-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  border: 1px solid var(--acs-border);
  background: transparent;
  color: #ddd;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.acs-btn:hover { border-color: rgba(198, 169, 107, 0.4); color: #fff; }
.acs-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.acs-btn--gold { background: rgba(198, 169, 107, 0.15); border-color: rgba(198, 169, 107, 0.4); color: var(--acs-gold); }
.acs-btn--primary { background: rgba(0, 188, 212, 0.15); border-color: rgba(0, 188, 212, 0.35); color: var(--acs-teal); }

/* Vision roadmap */
.acs-vision {
  margin: 12px 16px 0;
  border: 1px solid rgba(198, 169, 107, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(198, 169, 107, 0.06), rgba(0, 188, 212, 0.04));
  overflow: hidden;
  flex-shrink: 0;
  max-height: min(36vh, 320px);
  overflow-y: auto;
}

.acs-vision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.acs-vision-head h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--acs-gold);
}

.acs-vision-body {
  display: none;
  padding: 0 16px 16px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #aaa;
}

.acs-vision.open .acs-vision-body { display: block; }

.acs-roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.acs-roadmap-col h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  color: #888;
}

.acs-roadmap-col--live h3 { color: var(--acs-teal); }
.acs-roadmap-col--next h3 { color: var(--acs-gold); }

.acs-roadmap ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.acs-roadmap li {
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}

.acs-roadmap li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: #555;
}

.acs-roadmap li.done::before { content: '✓'; color: var(--acs-teal); }
.acs-roadmap li.soon::before { content: '◐'; color: var(--acs-gold); }

/* Workspace grid */
.acs-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 28%) 1fr minmax(200px, 22%);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-top: 12px;
  border-top: 1px solid var(--acs-border);
}

.acs-workspace > .acs-catalog,
.acs-workspace > .acs-studio {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.acs-workspace > .acs-meta-rail {
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .acs-workspace { grid-template-columns: minmax(240px, 32%) 1fr; }
  .acs-meta-rail {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(72vh, 520px);
    z-index: 180;
    width: auto;
    border-top: 1px solid var(--acs-border);
    border-left: none;
    border-radius: 16px 16px 0 0;
    background: #141414;
    overflow-y: auto;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  }
  .acs-meta-rail.acs-meta-rail--sheet-open {
    display: block;
  }
}

@media (max-width: 900px) {
  .acs-workspace { grid-template-columns: 1fr; }
  .acs-catalog {
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--acs-border);
  }
}

.acs-catalog {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--acs-border);
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.acs-search,
.acs-meta {
  flex-shrink: 0;
}

#acsTree {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(198, 169, 107, 0.5) rgba(255, 255, 255, 0.06);
}

#acsTree::-webkit-scrollbar,
.acs-meta-rail::-webkit-scrollbar {
  width: 8px;
}

#acsTree::-webkit-scrollbar-track,
.acs-meta-rail::-webkit-scrollbar-track {
  background: transparent;
}

#acsTree::-webkit-scrollbar-thumb,
.acs-meta-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

#acsTree::-webkit-scrollbar-thumb:hover,
.acs-meta-rail::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 169, 107, 0.45);
}

.acs-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #111;
  color: #fff;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.acs-meta { font-size: 0.72rem; color: #666; margin-bottom: 10px; }

.acs-course { border-bottom: 1px solid var(--acs-border); }
.acs-course-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  cursor: pointer;
}
.acs-course-head:hover { background: rgba(255,255,255,0.03); }
.acs-course-title { flex: 1; font-weight: 600; font-size: 0.88rem; }
.acs-course-id { font-size: 0.65rem; color: #666; font-family: monospace; }
.acs-chevron { color: #555; width: 14px; }
.acs-weeks { display: none; padding: 0 8px 12px 22px; }
.acs-course.open .acs-weeks { display: block; }

.acs-week { margin-bottom: 14px; }
.acs-week-title { font-size: 0.8rem; font-weight: 600; margin: 0 0 6px; color: #ccc; }
.acs-week-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.acs-part-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.acs-chip {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--acs-border);
  background: transparent;
  color: #bbb;
  cursor: pointer;
  text-decoration: none;
}
.acs-chip:hover { border-color: var(--acs-teal); color: var(--acs-teal); }
.acs-chip--edit { border-color: rgba(198,169,107,0.3); color: var(--acs-gold); }
.acs-chip--active { background: rgba(0,188,212,0.12); border-color: var(--acs-teal); color: var(--acs-teal); }
.acs-chip--gold { border-color: rgba(198,169,107,0.5); color: var(--acs-gold); }
.acs-chip--danger { border-color: rgba(229,115,115,0.45); color: #e57373; }
.acs-chip--danger:hover { border-color: #e57373; color: #ff8a80; }
.acs-chip--drag { cursor: grab; color: #666; padding: 2px 6px; user-select: none; }
.acs-part-row--dragging { opacity: 0.45; }
.acs-part-row--drag-over { outline: 1px dashed var(--acs-teal); border-radius: 8px; }

.acs-btn--sm { padding: 5px 10px; font-size: 0.72rem; }
.acs-btn--block { width: 100%; justify-content: center; margin-top: 12px; }
.acs-editor-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Draft/publish onboarding banner */
.acs-draft-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(240, 160, 80, 0.35);
  background: rgba(240, 160, 80, 0.08);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #ddd;
  flex-shrink: 0;
}
.acs-draft-banner.hidden { display: none; }
.acs-draft-banner-text { flex: 1; }
.acs-draft-banner strong { color: #f0c080; }

/* Markdown toolbar */
.acs-md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--acs-border);
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.acs-md-btn {
  padding: 4px 10px;
  font-size: 0.72rem;
  border: 1px solid var(--acs-border);
  border-radius: 6px;
  background: transparent;
  color: #bbb;
  cursor: pointer;
}
.acs-md-btn:hover { border-color: var(--acs-gold); color: var(--acs-gold); }

/* Metadata rail */
.acs-meta-rail {
  border-left: 1px solid var(--acs-border);
  padding: 14px 12px 20px;
  min-height: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.95), rgba(8, 8, 8, 0.98));
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acs-meta-rail-title {
  margin: 0 0 10px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--acs-gold);
  font-weight: 600;
}
.acs-meta-dl { margin: 0; }
.acs-meta-dl dt { color: #666; font-size: 0.65rem; margin-top: 8px; }
.acs-meta-dl dd { margin: 2px 0 0; color: #ddd; }
.acs-mono { font-family: ui-monospace, monospace; font-size: 0.68rem; word-break: break-all; }
.acs-meta-rail-section { margin: 0; }

.acs-panel-card {
  padding: 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.acs-panel-help {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #9a9a9a;
}
.acs-panel-status {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #8a8a8a;
}
.acs-panel-status--ok { color: #9ec9a8; }
.acs-panel-status--error { color: #e8a0a0; }
.acs-field-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #777;
  margin-bottom: 4px;
}
.acs-review-steps {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #b0b0b0;
  font-size: 0.72rem;
  line-height: 1.55;
}
.acs-review-steps li { margin-bottom: 4px; }
.acs-publish-week { margin-top: 4px; }

/* Doctrine linter */
.acs-lint-panel { max-height: 220px; overflow-y: auto; }
.acs-lint-muted { color: #666; margin: 0; font-size: 0.75rem; }
.acs-lint-ok { color: var(--acs-teal); margin: 0; font-size: 0.75rem; }
.acs-lint-item {
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  border: 1px solid var(--acs-border);
}
.acs-lint-item--error { border-color: rgba(255,100,100,0.4); background: rgba(255,80,80,0.08); }
.acs-lint-item--warning { border-color: rgba(255,180,80,0.35); background: rgba(255,160,60,0.06); }
.acs-lint-item--info { border-color: rgba(255,255,255,0.08); color: #999; }
.acs-lint-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.acs-status-draft { color: #f0a050; }
.acs-status-published { color: var(--acs-teal); }
.acs-status-synced { color: #888; }

/* Editor pane */
.acs-studio {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--acs-panel);
}

.acs-studio-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.acs-studio-editor[hidden] {
  display: none !important;
}

.acs-studio-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: #666;
}

.acs-studio-empty h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: #999;
  margin: 0 0 8px;
}

.acs-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--acs-border);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.acs-editor-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 120px;
}

.acs-editor-tabs {
  display: flex;
  gap: 4px;
}

.acs-tab {
  padding: 6px 12px;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  border-radius: 6px;
}
.acs-tab.active { background: rgba(255,255,255,0.06); color: #fff; }

.acs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .acs-split { grid-template-columns: 1fr; }
  .acs-preview-pane { display: none; }
  .acs-split.preview-only .acs-source-pane { display: none; }
  .acs-split.preview-only .acs-preview-pane { display: block; }
}

.acs-source-pane, .acs-preview-pane {
  overflow: auto;
  min-height: 0;
  height: 100%;
}

.acs-source-pane {
  border-right: 1px solid var(--acs-border);
  display: flex;
  flex-direction: column;
}

.acs-cheat {
  padding: 10px 12px;
  font-size: 0.72rem;
  color: #888;
  border-bottom: 1px solid var(--acs-border);
  line-height: 1.6;
  max-height: 72px;
  overflow-y: auto;
  flex-shrink: 0;
}
.acs-cheat code { color: var(--acs-gold); background: rgba(198,169,107,0.1); padding: 1px 4px; border-radius: 3px; }

.acs-editor-textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: none;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  padding: 14px;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
}

.acs-preview-pane {
  padding: 16px 20px;
  background: #0d0d0d;
  font-family: 'Source Serif 4', Georgia, serif;
  --reader-text: #f5efe3;
  --reader-gold: #c7a45b;
  --reader-sans: system-ui, -apple-system, sans-serif;
  --reader-serif: 'Source Serif 4', Georgia, serif;
}

.acs-preview-pane .lesson-editorial { font-size: 0.95rem; }

.acs-editor-foot {
  flex-shrink: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--acs-border);
  font-size: 0.72rem;
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acs-editor-foot-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acs-part-nav-label {
  font-size: 0.75rem;
  color: #999;
  min-width: 6.5em;
  text-align: center;
}

.acs-editor-foot-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.acs-denied {
  padding: 48px 24px;
  text-align: center;
  color: #aaa;
}

/* Modals */
.acs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.acs-modal-backdrop.open { display: flex; }

.acs-modal {
  width: min(480px, 100%);
  background: #161616;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 20px;
}

.acs-modal h3 { margin: 0 0 12px; font-size: 1rem; }
.acs-field { margin-bottom: 12px; }
.acs-field label { display: block; font-size: 0.75rem; color: #888; margin-bottom: 4px; }
.acs-field input, .acs-field select, .acs-field textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.85rem;
}
.acs-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.acs-modal--wide { width: min(920px, 100%); max-height: 90vh; overflow: auto; }

.acs-sync-intro {
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
  margin: 0 0 12px;
}
.acs-sync-intro code { font-size: 0.72rem; color: #ccc; }

.acs-sync-draft-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #bbb;
  margin-bottom: 10px;
  cursor: pointer;
}

.acs-sync-status {
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 12px;
}

.acs-sync-table-wrap { overflow-x: auto; margin-bottom: 8px; }

.acs-sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.acs-sync-table th,
.acs-sync-table td {
  border: 1px solid var(--acs-border);
  padding: 8px 10px;
  text-align: left;
}
.acs-sync-table th {
  background: rgba(255,255,255,0.04);
  color: var(--acs-gold);
  font-weight: 600;
}

.acs-sync-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.acs-sync-pill--ok { background: rgba(76,175,80,0.15); color: #81c784; }
.acs-sync-pill--warn { background: rgba(255,152,0,0.15); color: #ffb74d; }
.acs-sync-pill--miss { background: rgba(158,158,158,0.15); color: #bdbdbd; }
.acs-sync-pill--err { background: rgba(244,67,54,0.15); color: #e57373; }

.acs-sync-delta { color: #888; font-size: 0.72rem; }

.acs-version-panel { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }

.acs-version-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--acs-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.acs-version-meta { font-size: 0.72rem; color: #aaa; line-height: 1.4; }

.acs-version-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* Cover art picker */
.acs-cover-picker { display: flex; flex-direction: column; gap: 8px; }
.acs-cover-preview {
  width: 96px;
  height: 144px;
  border-radius: 8px;
  border: 1px dashed rgba(198, 169, 107, 0.45);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.acs-cover-preview[aria-hidden="true"] { display: none; }
.acs-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acs-cover-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acs-cover-status { font-size: 0.75rem; color: #c6a96b; margin: 0; min-height: 1.1em; }
.acs-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
label.acs-btn--file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.acs-course-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acs-course-cover-thumb {
  width: 28px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(198, 169, 107, 0.35);
  flex-shrink: 0;
}
.acs-course-cover-placeholder {
  width: 28px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #666;
  border: 1px dashed #444;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Version diff */
.acs-diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.acs-diff-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c6a96b;
}
.acs-diff-pane {
  margin: 0;
  padding: 12px;
  max-height: min(55vh, 520px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #ddd;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--acs-border);
  border-radius: 8px;
}
@media (max-width: 800px) {
  .acs-diff-grid { grid-template-columns: 1fr; }
}

/* Canon AI rail */
.acs-canon-section { border-top: 1px solid rgba(198, 169, 107, 0.2); padding-top: 12px; }
.acs-canon-index-meta { font-size: 0.68rem; color: #777; margin: 0 0 8px; }
.acs-canon-instruction {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--acs-border);
  background: #0a0a0a;
  color: #ccc;
  font-size: 0.75rem;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
}
.acs-canon-help {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: #999;
}
.acs-canon-help summary {
  cursor: pointer;
  color: var(--acs-gold);
  margin-bottom: 6px;
}
.acs-canon-help ol {
  margin: 0 0 6px 1.1rem;
  padding: 0;
}
.acs-canon-help li { margin: 0 0 4px; }
.acs-canon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.acs-canon-status {
  font-size: 0.68rem;
  color: #888;
  margin: 0;
  line-height: 1.45;
}
.acs-canon-status--error { color: #f08080; }
.acs-canon-citations {
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 0.65rem;
  color: #666;
  max-height: 100px;
  overflow-y: auto;
}
.acs-version-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.acs-version-latest {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0,188,212,0.15);
  color: var(--acs-teal);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.acs-modal--tall { max-height: 92vh; display: flex; flex-direction: column; }
.acs-version-preview-body {
  flex: 1;
  overflow: auto;
  max-height: 55vh;
  border: 1px solid var(--acs-border);
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
  background: #0a0a0a;
  font-size: 0.85rem;
}

.acs-mobile-tools-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 170;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 28px;
  border: 1px solid rgba(0, 188, 212, 0.45);
  background: rgba(0, 188, 212, 0.18);
  color: var(--acs-teal);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.acs-mobile-tools-fab.is-visible {
  display: inline-flex;
}

.acs-mobile-rail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 175;
  background: rgba(0, 0, 0, 0.55);
}

.acs-mobile-rail-backdrop.open {
  display: block;
}

/* Review / analytics / books */
.acs-select {
  width: 100%;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  font: inherit;
}
.acs-field--compact { margin: 0 0 10px; }
.acs-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.acs-review-notes { margin-top: 10px; max-height: 160px; overflow: auto; }
.acs-review-note {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}
.acs-review-note-meta { opacity: 0.65; margin-bottom: 4px; font-size: 0.68rem; }
.acs-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(50vh, 420px);
  overflow: auto;
  margin-top: 12px;
}
.acs-queue-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.acs-queue-item:hover {
  border-color: rgba(198, 169, 107, 0.45);
  background: rgba(198, 169, 107, 0.08);
}
.acs-queue-item span { font-size: 0.75rem; opacity: 0.7; }
.acs-analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.acs-stat {
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  text-align: center;
}
.acs-stat-n {
  display: block;
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--acs-gold);
}
.acs-stat-l {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.acs-analytics-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}
.acs-tree-section {
  margin-bottom: 18px;
}
.acs-tree-section-title {
  margin: 0 0 10px;
  padding: 0 2px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--acs-gold);
  font-weight: 600;
}
.acs-kind-badge {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acs-gold);
  border: 1px solid rgba(198, 169, 107, 0.4);
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.acs-kind-badge--link {
  color: var(--acs-teal);
  border-color: rgba(0, 188, 212, 0.4);
}
.acs-course--book {
  border-color: rgba(198, 169, 107, 0.22);
}
.acs-book-advanced {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(198, 169, 107, 0.35);
  background: rgba(198, 169, 107, 0.04);
}
.acs-book-advanced summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--acs-gold);
  font-weight: 600;
}
.acs-book-advanced[open] summary { margin-bottom: 8px; }
.acs-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #ccc;
  margin: 8px 0;
  cursor: pointer;
}
.acs-check--prominent {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(198, 169, 107, 0.35);
  background: rgba(198, 169, 107, 0.06);
  margin: 0 0 12px;
}
.acs-check--prominent strong {
  display: block;
  color: #eee;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.acs-check-help {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #9a9a9a;
  margin-top: 2px;
}
.acs-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.acs-cover-picker--compact .acs-cover-preview {
  width: 64px;
  height: 84px;
  margin-bottom: 8px;
}
.acs-book-side {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  min-height: 200px;
}
.acs-modal-backdrop.open {
  animation: acsModalIn 0.18s ease-out;
}
@keyframes acsModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (max-width: 720px) {
  .acs-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acs-book-layout { grid-template-columns: 1fr; }
  .acs-field-row { grid-template-columns: 1fr; }
  .acs-header-actions { width: 100%; justify-content: flex-start; }
  .acs-header-group { flex-wrap: wrap; }
}

