/* RAUM CMS — Editor-specific styles */

.layout { display: flex; flex: 1; min-height: 0; }

/* Editor + Preview Split */
.editor-column { flex: 1; min-width: 280px; display: flex; flex-direction: column; min-height: 0; background: #131316; }
.gutter {
  width: 10px; min-width: 10px; flex-shrink: 0;
  background: #1e1e22; cursor: col-resize; user-select: none;
  border-left: 1px solid #2a2a2e;
}
.gutter:hover { background: #252529; }
.gutter::before { content: ''; display: block; width: 2px; height: 32px; margin: 50vh 0 0 4px; background: #3a3a3e; border-radius: 1px; }
.preview-wrap { flex: 1; min-width: 200px; display: flex; flex-direction: column; min-height: 0; background: #0a0a0c; }
.preview-header { padding: 6px 12px; background: #1a1a1e; border-bottom: 1px solid #2a2a2e; font-size: 0.75rem; color: #4ade80; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.lang-pill { font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; border: 1px solid #3a3a3e; background: transparent; color: #6a6a6e; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4; position: relative; }
.lang-pill:hover { color: #b0b0b4; border-color: #5a5a5e; }
.lang-pill.active { color: #4ade80; border-color: #4ade80; }
.lang-pill .pill-indicator { font-size: 0.55rem; margin-left: 2px; }
.lang-pill .pill-indicator.ok { color: #4ade80; }
.lang-pill .pill-indicator.stale { color: #ffc107; }
#preview { flex: 1; border: none; width: 100%; height: 100%; min-height: 0; background: #0e0e10; color-scheme: dark; }

/* Sidebar */
.sidebar { width: 260px; min-width: 180px; max-width: 50vw; flex-shrink: 0; background: #16161a; border-right: none; display: flex; flex-direction: column; transition: margin-left 0.2s ease, opacity 0.2s ease; }
.sidebar.collapsed { margin-left: -100%; opacity: 0; pointer-events: none; width: 260px !important; }
.sidebar-gutter { width: 6px; min-width: 6px; flex-shrink: 0; background: #1e1e22; cursor: col-resize; user-select: none; border-right: 1px solid #2a2a2e; }
.sidebar-gutter:hover, .sidebar-gutter.dragging { background: #252529; }
.sidebar-gutter::before { content: ''; display: block; width: 2px; height: 24px; margin: 50vh 0 0 2px; background: #3a3a3e; border-radius: 1px; }
.sidebar.collapsed + .sidebar-gutter { display: none; }
.sidebar-toggle { position: fixed; top: 10px; left: 10px; z-index: 60; background: #2a2a2e; color: #e4e2de; border: 1px solid #35353a; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: 0.75rem; display: none; }
.sidebar-toggle:hover { background: #35353a; }
.sidebar.collapsed ~ .editor-column .sidebar-toggle, .sidebar-toggle.visible { display: block; }
.sidebar h2 { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8a8693; margin: 16px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-collapse-btn { background: none; border: none; color: #5a5566; cursor: pointer; font-size: 0.8rem; padding: 2px 6px; }
.sidebar-collapse-btn:hover { color: #e4e2de; }
@media (max-width: 900px) {
  .sidebar { margin-left: -100%; opacity: 0; pointer-events: none; position: absolute; z-index: 55; height: 100%; }
  .sidebar.mobile-open { margin-left: 0; opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: block; }
  .sidebar-gutter { display: none; }
  .snippet-column { display: none; }
}
.search { margin: 8px 12px 12px; padding: 8px 12px; background: #1a1a1e; border: 1px solid #252529; border-radius: 8px; color: #e4e2de; font-size: 0.82rem; }
.search::placeholder { color: #504c5a; }
.search:focus { outline: none; border-color: #c49a82; background: #1e1e22; }
.sidebar-section { border-bottom: 1px solid #2a2a2e; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar-section.collapsed { flex: 0 0 auto; }
.section-toggle { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px 8px 16px; background: none; border: none; color: #8a8693; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.section-toggle:hover { color: #e4e2de; }
.section-toggle .section-label { flex: 1; text-align: left; }
.section-actions { display: flex; align-items: center; gap: 1px; margin-left: auto; }
.section-actions .sa-btn { background: none; border: none; color: #5a5566; cursor: pointer; padding: 3px 5px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.section-actions .sa-btn:hover { color: #b0aab8; background: rgba(255,255,255,.05); }
.section-actions .sa-btn.active { color: #c49a82; background: rgba(196,154,130,.1); }
.section-actions .sa-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-actions .sa-sep { width: 1px; height: 14px; background: #2a2a2e; margin: 0 3px; }
.section-collapse { background: none; border: none; color: inherit; cursor: pointer; padding: 0; display: flex; align-items: center; }
.section-label { cursor: pointer; }
.section-arrow { font-size: 0.65rem; transition: transform 0.2s ease; display: inline-block; }
.sidebar-section.collapsed .section-arrow { transform: rotate(-90deg); }
.sidebar-section.collapsed .section-actions .sa-sep,
.sidebar-section.collapsed .section-actions [data-action="new-folder"],
.sidebar-section.collapsed .section-actions [data-action="new-item"] { display: none; }
.sidebar-section.collapsed .section-body { max-height: 0 !important; padding-top: 0; padding-bottom: 0; }
.section-body { overflow-y: auto; padding: 0 8px 8px; flex: 1; min-height: 0; transition: max-height 0.3s ease, padding 0.3s ease; }
.page-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; margin: 1px 0; border-radius: 8px; color: #e4e2de; text-decoration: none; font-size: 0.85rem; cursor: pointer; }
.page-item:hover { background: #252529; }
.page-item.active { background: rgba(196,154,130,0.15); color: #c49a82; }
.page-item.add { justify-content: center; opacity: 0.5; font-size: 0.75rem; padding: 6px 12px; }
.page-item .frag-badge { font-size: 0.6rem; opacity: 0.5; margin-left: 4px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.draft { background: #6b7280; }
.status-dot.live { background: #ef4444; }
.status-dot.published { background: #60a5fa; }
.status-dot.modified { background: #eab308; }
.view-tabs { display: none; }

/* Tree view */
.tree-node-header { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 6px; font-size: .82rem; cursor: pointer; user-select: none; transition: background .12s; }
.tree-item { color: #b0aab8; text-decoration: none; }
.tree-item:hover { background: rgba(255,255,255,.05); }
.tree-item.active { background: rgba(196,154,130,.15); color: #c49a82; }
.tree-item .status-dot { margin-left: auto; flex-shrink: 0; }
.tree-menu-btn { margin-left: 4px; opacity: 0; font-size: .9rem; color: #5a5566; cursor: pointer; padding: 0 2px; flex-shrink: 0; transition: opacity .12s; }
.tree-node-header:hover .tree-menu-btn { opacity: 1; }
.tree-menu-btn:hover { color: #b0aab8; }
.tree-folder { font-size: .78rem; color: #7a7688; font-weight: 600; letter-spacing: .01em; }
.tree-folder:hover { background: rgba(255,255,255,.04); color: #9a96a8; }
.folder-arrow { font-size: .6rem; transition: transform .15s; width: 10px; display: inline-block; text-align: center; flex-shrink: 0; cursor: pointer; }
.folder-arrow.collapsed { transform: rotate(-90deg); }
.folder-arrow.arrow-hidden { visibility: hidden; }
.tree-node > .tree-children { padding-left: 14px; }
.tree-children.collapsed { display: none; }
.tree-children.tree-root { padding-left: 0; }
.tree-children.tree-root, .tree-children.tree-orphans { min-height: 20px; }
.tree-orphan-label { font-size: .65rem; color: #5a5566; padding: 12px 8px 4px; letter-spacing: .04em; border-top: 1px solid #222226; margin-top: 4px; }
.tree-add-folder { display: none; }

/* Sortable (drag-and-drop) */
.sortable-ghost { opacity: .3; }
.sortable-chosen .tree-node-header { background: rgba(196,154,130,.08); border-radius: 6px; }
.sortable-fallback { opacity: .8; background: #1e1e22; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.5); }

/* Tree context menu */
.tree-ctx { position: fixed; z-index: 9000; background: #1e1e22; border: 1px solid #2e2e34; border-radius: 8px; padding: 4px 0; min-width: 150px; box-shadow: 0 8px 30px rgba(0,0,0,.6), 0 0 1px rgba(255,255,255,.05); }
.tree-ctx-item { padding: 6px 14px; font-size: .78rem; color: #b0aab8; cursor: pointer; transition: background .1s; }
.tree-ctx-item:hover { background: rgba(255,255,255,.06); color: #e0dce6; }
.tree-ctx-item.danger { color: #e45; }
.tree-ctx-item.danger:hover { background: rgba(228,69,69,.1); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #131316; }

/* Toolbar */
.editor-toolbar {
  padding: 10px 14px;
  background: #18181c;
  border-bottom: 1px solid #2a2a2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}
.editor-toolbar .left { display: flex; align-items: center; gap: 8px; }
.editor-toolbar .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5a5566; }
.editor-toolbar .name { font-size: 0.9rem; color: #e4e2de; }
.rename-btn { background: none; border: none; color: #5a5566; cursor: pointer; padding: 2px; border-radius: 4px; display: inline-flex; align-items: center; flex-shrink: 0; transition: color .15s; }
.rename-btn:hover { color: #e4e2de; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; display: none; flex-shrink: 0; }
.dirty-dot.visible { display: inline-block; }
.editor-toolbar .actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.editor-toolbar button, .editor-toolbar a.btn { padding: 7px 14px; border: none; border-radius: 6px; font-weight: 500; font-size: 0.8rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-save { background: #c49a82; color: #0a0a0c; }
.btn-save:hover { opacity: 0.9; }
.btn-preview { background: #2a2a2e; color: #e4e2de; }
.btn-preview:hover { background: #35353a; }
.btn-preview.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Version dropdown */
#version-select { display: none; }
.ver-wrap { position: relative; }
.ver-btn { background: #2a2a2e; color: #e4e2de; border: 1px solid #333338; border-radius: 6px; padding: 6px 10px 6px 12px; font-size: 0.78rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; min-width: 210px; transition: background .15s, border-color .15s; }
.ver-btn:hover { background: #333338; border-color: #444; }
.ver-btn .ver-arrow { font-size: 0.55rem; margin-left: auto; opacity: 0.35; transition: transform .2s; }
.ver-wrap.open .ver-btn .ver-arrow { transform: rotate(180deg); }
.ver-wrap.open .ver-btn { border-color: #4a4a50; background: #333338; }
.ver-btn .ver-label { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.04em; line-height: 1.3; }
.ver-label.live { background: rgba(239,68,68,0.12); color: #f87171; }
.ver-label.published { background: rgba(96,165,250,0.12); color: #93bbfd; }
.ver-label.modified { background: rgba(234,179,8,0.12); color: #facc15; }
.ver-label.draft { background: rgba(255,255,255,0.05); color: #6b7280; }
.ver-dd { position: absolute; right: 0; top: 100%; margin-top: 5px; background: #1e1e22; border: 1px solid #2e2e33; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset; z-index: 60; min-width: 290px; max-height: 360px; overflow-y: auto; padding: 5px; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.ver-dd.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ver-dd::-webkit-scrollbar { width: 5px; }
.ver-dd::-webkit-scrollbar-track { background: transparent; }
.ver-dd::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.ver-dd-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 0.78rem; color: #807b87; border-radius: 6px; transition: background .1s, color .1s; }
.ver-dd-item:hover { background: rgba(255,255,255,0.04); color: #b0aab8; }
.ver-dd-item.active { color: #e4e2de; background: rgba(196,154,130,0.08); }
.ver-dd-item .ver-label { font-size: 0.58rem; min-width: 52px; text-align: center; }
.ver-dd-item .ver-date { flex: 1; }
.ver-dd-item .ver-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; flex-shrink: 0; box-shadow: 0 0 6px rgba(239,68,68,0.5); animation: ver-pulse 2.5s ease-in-out infinite; }
@keyframes ver-pulse { 0%,100% { box-shadow: 0 0 4px rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 8px rgba(239,68,68,0.7); } }
.ver-dd-item + .ver-dd-item { border-top: 1px solid rgba(255,255,255,0.03); }
#version-restore-btn { font-size: 0.78rem; padding: 5px 10px; }

/* More menu */
.toolbar-more-wrap { position: relative; }
.toolbar-more-btn { background: #2a2a2e; color: #e4e2de; border: none; border-radius: 6px; padding: 7px 10px; cursor: pointer; font-size: 0.85rem; line-height: 1; }
.toolbar-more-btn:hover { background: #35353a; }
.toolbar-more-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 50; min-width: 180px; padding: 4px 0; }
.toolbar-more-menu.open { display: block; }
.toolbar-more-menu button { display: block; width: 100%; text-align: left; padding: 8px 14px; background: none; border: none; color: #e4e2de; font-size: 0.8rem; cursor: pointer; border-radius: 0; }
.toolbar-more-menu button:hover { background: #252529; }

/* Link page modal */
.link-page-modal { position: absolute; top: 100%; right: 0; width: 260px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; padding: 8px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.link-page-search { width: 100%; padding: 6px 10px; background: #16161a; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: .82rem; margin-bottom: 6px; }
.link-page-search:focus { outline: none; border-color: #c49a82; }
.link-page-list { max-height: 240px; overflow-y: auto; }
.link-page-list a { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; color: #e4e2de; text-decoration: none; font-size: .83rem; border-radius: 4px; cursor: pointer; }
.link-page-list a .link-slug { font-size: .72rem; color: #5a5566; margin-left: 8px; flex-shrink: 0; }
.link-page-list a:hover { background: #252529; }

/* Frontmatter bar */
.frontmatter-bar {
  padding: 8px 14px;
  background: #15151a;
  border-bottom: 1px solid #2a2a2e;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.frontmatter-bar.hidden { display: none; }
.frontmatter-bar .field { display: flex; align-items: center; gap: 6px; }
.frontmatter-bar .field.fm-article { display: none; }
.frontmatter-bar.has-article .field.fm-article { display: flex; }
.frontmatter-bar .field.fm-protection { display: none; }
.frontmatter-bar.has-protection .field.fm-protection { display: flex; }
.frontmatter-bar label { font-size: 0.7rem; color: #5a5566; white-space: nowrap; }
.frontmatter-bar input { padding: 6px 10px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: 0.8rem; flex: 1; min-width: 100px; max-width: 200px; }
.frontmatter-bar input.fm-wide { max-width: 260px; }
.frontmatter-bar input:focus { outline: none; border-color: #c49a82; }

/* Snippet column (vertical sidebar) */
.snippet-column { width: 120px; min-width: 100px; flex-shrink: 0; background: #131316; border-right: 1px solid #2a2a2e; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
.snippet-column::-webkit-scrollbar { width: 4px; }
.snippet-bar {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.snippet-bar .lbl { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5a5566; margin: 8px 0 2px; padding: 0 4px; }
.snippet-bar .lbl:first-child { margin-top: 0; }
.snippet-btn { padding: 4px 8px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 5px; color: #b0aaa0; font-size: 0.72rem; cursor: pointer; white-space: nowrap; text-align: left; }
.snippet-btn:hover { background: rgba(196, 154, 130, 0.15); border-color: #c49a82; color: #c49a82; }
.snippet-btn.active { border-color: #c49a82; color: #c49a82; }

/* Format bar (Markdown) */
.format-bar { padding: 4px 14px; background: #15151a; border-bottom: 1px solid #2a2a2e; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.format-bar button { padding: 4px 10px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 4px; color: #b0aaa0; font-size: 0.8rem; cursor: pointer; font-weight: 600; }
.format-bar button:hover { background: #252529; color: #e4e2de; }
.format-bar button i { font-style: normal; }

/* A/B Test bar */
.ab-bar { display: flex; align-items: center; padding: 6px 14px; gap: 10px; background: #1a1a1e; border-bottom: 1px solid #2a2a2e; flex-shrink: 0; }
.ab-label { font-size: 0.7rem; color: #5a5566; white-space: nowrap; }
.ab-variants { display: flex; gap: 2px; }
.ab-variant-pill { padding: 4px 12px; border: 1px solid #2a2a2e; background: #1e1e22; color: #b0aaa0; font-size: 0.75rem; border-radius: 12px; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.ab-variant-pill:hover { background: #252529; color: #e4e2de; }
.ab-variant-pill.active { background: rgba(196,154,130,0.15); border-color: #c49a82; color: #c49a82; font-weight: 600; }
.ab-create-btn, .ab-settings-btn { padding: 4px 10px; background: transparent; border: 1px solid #2a2a2e; border-radius: 6px; color: #5a5566; font-size: 0.7rem; cursor: pointer; white-space: nowrap; }
.ab-create-btn:hover, .ab-settings-btn:hover { background: #252529; border-color: #3a3a3e; color: #e4e2de; }

/* AI Variant Modal extras */
.ab-gen-loading { display: none; align-items: center; gap: 8px; padding: 12px 0; color: #8a8693; font-size: 0.85rem; }
.ab-gen-loading.visible { display: flex; }
.ab-gen-loading .spinner { width: 16px; height: 16px; border: 2px solid #3a3a3e; border-top-color: #c49a82; border-radius: 50%; animation: spin 0.8s linear infinite; }
.template-gen-preview { margin-top: 12px; }
.template-gen-preview label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; display: block; }
.template-gen-preview pre { background: #16161a; border: 1px solid #2a2a2e; border-radius: 6px; padding: 12px; font-size: 0.78rem; color: #c8c4bc; max-height: 50vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

/* Media Picker (inline in editor) */
.media-picker-filters { display: flex; gap: 8px; padding: 12px 20px; border-bottom: 1px solid #2a2a2e; align-items: center; flex-wrap: wrap; }
.media-picker-filters input { padding: 6px 10px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: 0.8rem; flex: 1; min-width: 120px; max-width: 280px; }
.media-picker-filters input:focus { outline: none; border-color: #c49a82; }
.mp-type-pills { display: flex; gap: 2px; background: #1a1a1e; border-radius: 8px; padding: 3px; border: 1px solid #2a2a2e; }
.mp-type-pill { padding: 5px 14px; border: none; background: transparent; color: #8a8693; font-size: 0.8rem; border-radius: 6px; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.mp-type-pill:hover { color: #e4e2de; background: rgba(255,255,255,0.04); }
.mp-type-pill.active { background: rgba(196,154,130,0.15); color: #c49a82; font-weight: 600; }
.mp-tag-wrap { position: relative; }
.mp-tag-btn { padding: 6px 12px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: 0.8rem; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.mp-tag-btn:hover { border-color: #c49a82; }
.mp-tag-btn .arrow { font-size: 0.6rem; color: #5a5566; }
.mp-tag-btn .active-tag { color: #c49a82; font-weight: 600; }
.mp-tag-dd { display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 210; min-width: 220px; max-height: 280px; overflow: hidden; flex-direction: column; }
.mp-tag-dd.open { display: flex; }
.mp-tag-dd-search { padding: 8px 10px; border: none; border-bottom: 1px solid #2a2a2e; background: #1a1a1e; color: #e4e2de; font-size: 0.8rem; outline: none; }
.mp-tag-dd-search::placeholder { color: #5a5566; }
.mp-tag-dd-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.mp-tag-dd-item { padding: 6px 12px; font-size: 0.8rem; color: #b0aaa0; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.mp-tag-dd-item:hover { background: #252529; color: #e4e2de; }
.mp-tag-dd-item.selected { color: #c49a82; font-weight: 600; }
.mp-tag-dd-item .cnt { font-size: 0.65rem; color: #5a5566; margin-left: auto; }
.mp-active-tag { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: rgba(196,154,130,0.15); border: 1px solid #c49a82; border-radius: 12px; font-size: 0.75rem; color: #c49a82; }
.mp-active-tag .x { cursor: pointer; font-weight: bold; margin-left: 2px; }
.mp-active-tag .x:hover { color: #e45; }
.mp-manage-link { font-size: 0.7rem; color: #5a5566; text-decoration: none; margin-left: auto; }
.mp-manage-link:hover { color: #c49a82; }
.mp-playback-wrap { display: flex; align-items: center; gap: 6px; }
.mp-playback-label { font-size: 0.75rem; color: #8a8693; white-space: nowrap; }
.media-picker-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 20px; overflow-y: auto; max-height: 70vh; }
.mp-item { flex: 0 0 130px; background: #1a1a1e; border: 2px solid #2a2a2e; border-radius: 8px; cursor: pointer; overflow: hidden; transition: border-color 0.15s; }
.mp-item:hover { border-color: #c49a82; }
.mp-item .mp-thumb { width: 100%; height: 126px; background: #111114; overflow: hidden; position: relative; }
.mp-item .mp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-item .mp-thumb .mp-icon-prev { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mp-item .mp-thumb .mp-icon-prev img { position: static; width: 50%; height: 50%; object-fit: contain; filter: invert(0.7); }
.mp-item .mp-thumb .mp-vid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: #5a5566; }
.mp-item .mp-name { padding: 5px 6px; font-size: 0.65rem; color: #8a8693; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-empty { width: 100%; text-align: center; color: #5a5566; font-size: 0.85rem; padding: 30px; }
.mp-provider-badge { display: inline-block; font-size: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 4px; border-radius: 3px; position: absolute; top: 4px; left: 4px; z-index: 2; }
.mp-provider-badge.youtube { background: #c00; color: #fff; }
.mp-provider-badge.vimeo { background: #1ab7ea; color: #fff; }

/* Editor textarea + Syntax-Highlight-Overlay */
.editor-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.editor-wrap { position: relative; flex: 1; min-height: 200px; display: flex; }
.editor-highlight { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; padding: 16px; overflow-y: scroll; overflow-x: hidden; pointer-events: none; background: #111114; color: #e4e2de; font-family: ui-monospace, monospace; font-size: 14px; line-height: 22px; tab-size: 2; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; border: none; box-sizing: border-box; }
.editor-highlight .fm-delim { color: #5a5566; }
.editor-highlight .fm-key { color: #8a8693; }
.editor-highlight .fm-val { color: #7dd3fc; }
.editor-highlight .sc-tag { color: #fbbf24; }
.editor-highlight .sc-attr { color: #93c5fd; }
.editor-highlight .sc-val { color: #86efac; }
.editor-highlight .sc-placeholder { color: #5a5566; }
.editor-highlight .md-head { color: #a78bfa; }
.editor-highlight .md-bold { color: #f5f3ef; }
.editor-highlight .md-italic { color: #c4b5a0; }
.editor-highlight .md-link { color: #7dd3fc; }
.editor-highlight .md-placeholder { color: #5a5566; }
#editor { -webkit-appearance: none; appearance: none; position: relative; z-index: 1; flex: 1; width: 100%; min-height: 200px; margin: 0; padding: 16px; background: transparent; color: transparent; caret-color: #e4e2de; border: none; resize: none; font-family: ui-monospace, monospace; font-size: 14px; line-height: 22px; tab-size: 2; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; overflow-y: scroll; overflow-x: hidden; -webkit-user-select: text; user-select: text; }
#editor::selection { background: rgba(80, 130, 200, 0.4); }
#editor::-moz-selection { background: rgba(80, 130, 200, 0.4); }
#editor::placeholder { color: #5a5566; }
#editor:focus { outline: none; }
.editor-status { padding: 4px 14px; font-size: 0.7rem; color: #5a5566; background: #131316; border-top: 1px solid #1e1e22; flex-shrink: 0; }

/* Chat */
.chat-gutter { height: 6px; flex-shrink: 0; background: #1e1e22; cursor: row-resize; border-top: 1px solid #2a2a2e; position: relative; z-index: 2; }
.chat-gutter:hover { background: #252529; }
.chat { height: 200px; min-height: 80px; flex-shrink: 0; border-top: 1px solid #2a2a2e; display: flex; flex-direction: column; background: #16161a; }
.chat-header { padding: 8px 12px; font-size: 0.75rem; font-weight: 600; color: #8a8693; border-bottom: 1px solid #2a2a2e; }
.chat-area { flex: 1; overflow-y: auto; padding: 12px; font-size: 0.8rem; color: #b0aaa0; white-space: pre-wrap; word-break: break-word; }
.chat-area .msg { margin-bottom: 10px; }
.chat-area .msg.user { color: #c49a82; }
.chat-area .msg.assistant { color: #8a8693; }
.chat-area .msg.loading { color: #5a5566; font-style: italic; }
.chat-area .msg.error { color: #e45; }
.chat-area .msg.warn { color: #e4c2a0; font-style: italic; }
.ai-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ai-option-btn { text-align: left; padding: 8px 12px; font-size: 0.8rem; background: #1e1e22; color: #e4e2de; border: 1px solid #333; border-radius: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ai-option-btn:hover { background: #2a2a2e; border-color: #4ade80; }
.ai-stream { white-space: pre-wrap; opacity: 0.7; }
.ai-stream::after { content: '\25CA'; animation: blink 0.6s infinite; margin-left: 2px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.msg.assistant .ai-result { background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; padding: 10px 12px; margin-top: 4px; white-space: pre-wrap; }
.msg.assistant .ai-actions { display: flex; gap: 6px; margin-top: 6px; }
.msg.assistant .ai-actions button { padding: 4px 10px; font-size: 0.7rem; background: #2a2a2e; color: #b0aaa0; border: 1px solid #333; border-radius: 6px; cursor: pointer; }
.msg.assistant .ai-actions button:hover { background: #333; color: #e4e2de; }
.msg.assistant .ai-replace { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.msg.assistant .ai-replace-find, .msg.assistant .ai-replace-new { flex: 1; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 0.8rem; }
.msg.assistant .ai-replace-find { border-color: #5a3030; color: #c88; text-decoration: line-through; }
.msg.assistant .ai-replace-new { border-color: #305a30; color: #8c8; }
.msg.assistant .ai-replace-arrow { display: flex; align-items: center; color: #5a5566; font-size: 1.2rem; }
.msg.assistant .ai-replace-btn { padding: 4px 10px; font-size: 0.7rem; background: #2a2a2e; color: #b0aaa0; border: 1px solid #333; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.msg.assistant .ai-replace-btn:hover { background: #333; color: #e4e2de; }
.msg.assistant .ai-replace-btn:disabled { opacity: 0.5; cursor: default; }
.chat-input-wrap { padding: 8px 12px; border-top: 1px solid #2a2a2e; display: flex; gap: 8px; align-items: flex-end; }
.chat-input-wrap textarea { flex: 1; padding: 10px 12px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; color: #e4e2de; font-size: 0.9rem; font-family: inherit; resize: none; overflow-y: hidden; min-height: 40px; max-height: 160px; line-height: 1.4; }
.chat-input-wrap textarea:focus { outline: none; border-color: #c49a82; }
.chat-input-wrap button { padding: 10px 16px; background: #2a2a2e; color: #e4e2de; border: none; border-radius: 8px; cursor: pointer; font-size: 0.85rem; flex-shrink: 0; }
#ai-model-select { padding: 6px 8px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #b0aaa0; font-size: 0.75rem; cursor: pointer; max-width: 120px; }
#ai-model-select:focus { outline: none; border-color: #c49a82; }

/* Utility classes */
.fm-toggle-btn { font-size: 0.65rem; padding: 3px 8px; }
.chat-knowledge { padding: 6px 12px; font-size: 0.72rem; color: #5a5566; border-top: 1px solid #2a2a2e; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chat-knowledge .kp-label { flex-shrink: 0; }
.kp-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; border: 1px solid #2e2e33; background: transparent; color: #5a5566; font-size: 0.68rem; cursor: pointer; transition: all .15s; user-select: none; white-space: nowrap; }
.kp-pill:hover { border-color: #444; color: #8a8693; }
.kp-pill.active { background: rgba(196,154,130,0.1); border-color: rgba(196,154,130,0.3); color: #c49a82; }
.kp-pill .kp-sys { font-size: 0.58rem; padding: 1px 4px; border-radius: 3px; background: rgba(255,255,255,0.05); color: #6b6578; margin-left: 1px; }
.kp-pill.active .kp-sys { background: rgba(196,154,130,0.12); color: #a08878; }
.kp-pill input { display: none; }
.sidebar-footer { margin-top: auto; padding: 12px 16px; border-top: 1px solid #2a2a2e; font-size: 0.65rem; color: #5a5566; line-height: 1.5; }
.mt-8 { margin-top: 8px; }

/* Components body (settings modal variant) */
.components-body { overflow-y: auto; max-height: 60vh; }

/* Plan feature */
.plan-hint { margin-bottom: 10px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 12px 0; }
.plan-add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.plan-add-input { flex: 1; }
.hint-mb { margin-bottom: 8px; }
.code-block { display: block; margin-bottom: 8px; font-size: 0.75rem; word-break: break-all; }
.empty-hint { font-size: 0.85rem; }
.plan-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.plan-done { text-decoration: line-through; color: #888; }

/* Help / Knowledge Base */
.help-body { font-size: 0.85rem; line-height: 1.5; }
.help-body code { background: #1e1e22; padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; color: #c49a82; }
.help-intro { color: #8a8693; margin: 0 0 12px; }
.help-footer { margin-top: 12px; color: #5a5566; }
.kb-back-btn { background: none; border: none; color: #8a8693; cursor: pointer; font-size: 0.8rem; padding: 4px 8px; border-radius: 4px; margin-right: 8px; }
.kb-back-btn:hover { color: #e4e2de; background: #2a2a2e; }
.kb-article-list { list-style: none; padding: 0; margin: 0; }
.kb-article-list a { display: block; padding: 10px 16px; color: #e4e2de; text-decoration: none; font-size: 0.85rem; border-bottom: 1px solid #1e1e22; cursor: pointer; }
.kb-article-list a:hover { background: #252529; }
.help-body h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 12px; color: #e4e2de; }
.help-body h2 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; color: #d4d0cc; }
.help-body h3 { font-size: 0.9rem; font-weight: 600; margin: 16px 0 6px; color: #b0aaa0; }
.help-body ul, .help-body ol { padding-left: 20px; margin: 8px 0; }
.help-body li { margin: 4px 0; }
.help-body a { color: #c49a82; text-decoration: none; }
.help-body a:hover { text-decoration: underline; }
.help-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.help-body blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid #3a3a3e; color: #8a8693; background: #1a1a1e; border-radius: 0 6px 6px 0; }
.help-body pre { background: #1e1e22; padding: 12px 14px; border-radius: 6px; overflow-x: auto; margin: 8px 0; font-size: 0.8rem; color: #c49a82; }
.help-body hr { border: none; border-top: 1px solid #2a2a2e; margin: 16px 0; }
.help-body p { margin: 8px 0; }
.kb-icon { height: 1.2em; width: 1.2em; vertical-align: middle; display: inline-block; }
.kb-category-toggle {
  display: block; width: 100%; padding: 6px 12px; background: none; border: none;
  color: #b0acba; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.3px; cursor: pointer; text-align: left;
}
.kb-category-toggle:hover { color: #e2dfe8; }
.kb-category-header { display: flex; align-items: center; }
.kb-category-header .kb-category-toggle { flex: 1; }
.kb-cat-del { background: none; border: none; color: #5a5566; cursor: pointer; font-size: 0.85rem; padding: 2px 6px; line-height: 1; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.kb-category-header:hover .kb-cat-del { opacity: 1; }
.kb-cat-del:hover { color: #e74c3c; }
.kb-cat-arrow { display: inline-block; width: 12px; font-size: 0.7rem; }
.kb-subheading {
  padding-left: 28px !important; font-size: 0.78rem !important;
  color: #6b6578 !important;
}
.kb-subheading:hover { color: #b0acba !important; }
.kb-article-toggle {
  display: flex; align-items: center; padding: 8px 12px; margin: 1px 0; border-radius: 8px;
  color: #e4e2de; text-decoration: none; font-size: 0.85rem; cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
}
.kb-article-toggle:hover { background: #252529; }
.kb-article-toggle.active { background: rgba(196,154,130,0.15); color: #c49a82; }
.kb-art-arrow { display: inline-block; width: 14px; font-size: 0.7rem; color: #6b6578; flex-shrink: 0; }
.kb-article-body { padding-left: 14px; }
.kb-drag-handle { cursor: grab; color: #4a4656; font-size: 0.7rem; margin-right: 6px; user-select: none; flex-shrink: 0; }
.kb-drag-handle:hover { color: #8a8693; }
[draggable].kb-dragging { opacity: 0.4; }
.kb-drag-over { border-top: 2px solid #7c5cfc !important; margin-top: -1px; }
.kb-drag-over-folder { background: rgba(124,92,252,0.12) !important; }
.kb-search-wrap {
  padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kb-search-wrap input {
  width: 100%; padding: 8px 12px; background: #1e1e24; border: 1px solid #333;
  border-radius: 6px; color: #e2dfe8; font-size: 0.85rem;
}
.kb-search-wrap input:focus { outline: none; border-color: #7c5cfc; }
.kb-search-result {
  display: block; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; text-decoration: none; color: inherit;
}
.kb-search-result:hover { background: rgba(124,92,252,0.08); }
.kb-search-result .kb-sr-heading {
  font-size: 0.85rem; font-weight: 600; color: #e2dfe8; margin-bottom: 2px;
}
.kb-search-result .kb-sr-path {
  font-size: 0.72rem; color: #6b6578; margin-bottom: 4px;
}
.kb-search-result .kb-sr-preview {
  font-size: 0.8rem; color: #8a8494; line-height: 1.4;
}
.kb-search-result mark {
  background: rgba(124,92,252,0.25); color: #c4b5fd; border-radius: 2px;
  padding: 0 1px;
}
.kb-ask-wrap {
  padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kb-ask-input-row { display: flex; gap: 6px; }
.kb-ask-input-row input {
  flex: 1; padding: 8px 12px; background: #1e1e24; border: 1px solid #333;
  border-radius: 6px; color: #e2dfe8; font-size: 0.85rem;
}
.kb-ask-input-row input:focus { outline: none; border-color: #7c5cfc; }
.kb-ask-input-row button {
  padding: 8px 14px; background: #7c5cfc; color: #fff; border: none;
  border-radius: 6px; font-size: 0.82rem; cursor: pointer; white-space: nowrap;
}
.kb-ask-input-row button:hover { background: #6a4ce0; }
.kb-ask-input-row button:disabled { opacity: 0.5; cursor: default; }
.kb-ask-response {
  margin-top: 8px; padding: 12px; background: #1e1e24; border-radius: 6px;
  font-size: 0.85rem; color: #c8c4d0; line-height: 1.5; max-height: 300px;
  overflow-y: auto;
}
.kb-ask-response .kb-ask-sources {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #333;
  font-size: 0.75rem; color: #6b6578;
}

/* Redirects table */
.redirects-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.redirects-table th { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #5a5566; text-align: left; padding: 6px 4px; border-bottom: 1px solid #2a2a2e; }
.redirects-table td { padding: 4px; vertical-align: middle; }
.redirects-table input[type="text"] { width: 100%; padding: 7px 8px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: 0.8rem; }
.redirects-table input[type="text"]:focus { outline: none; border-color: #c49a82; }
.redirects-table select { padding: 7px 6px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #e4e2de; font-size: 0.8rem; appearance: auto; }
.redirects-table select:focus { outline: none; border-color: #c49a82; }
.redirect-del-btn { background: none; border: 1px solid #2a2a2e; border-radius: 6px; color: #8a8693; cursor: pointer; padding: 5px 8px; font-size: 0.8rem; line-height: 1; }
.redirect-del-btn:hover { background: #35353a; color: #e45; border-color: #e45; }
.redirect-add-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 6px; color: #b0aaa0; font-size: 0.8rem; cursor: pointer; }
.redirect-add-btn:hover { background: #252529; border-color: #c49a82; color: #e4e2de; }
.redirects-empty { font-size: 0.8rem; color: #5a5566; padding: 12px 0; }

/* Publishing section */
.publish-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.publish-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #c49a82; color: #0a0a0c; border: none; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.publish-btn:hover { opacity: 0.9; }
.publish-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.publish-status { font-size: 0.8rem; color: #8a8693; }
.publish-status.success { color: #6cc070; }
.publish-status.error { color: #e45; }
.publish-last { font-size: 0.75rem; color: #5a5566; margin-top: 8px; }

/* Embed frame */
#embed-frame { width: 100%; height: 100%; border: none; }

/* Attribute hint popup */
.attr-hint { position: fixed; z-index: 200; background: #1e1e22; border: 1px solid #2a2a2e; border-radius: 8px; padding: 8px 12px; font-size: 0.8rem; box-shadow: 0 4px 16px rgba(0,0,0,.3); max-width: 320px; }
.attr-hint-desc { color: #8a8693; margin-bottom: 4px; font-size: 0.72rem; line-height: 1.4; }
.attr-hint-label { color: #5a5566; font-size: 0.68rem; margin-bottom: 6px; }
.attr-hint-values { display: flex; flex-wrap: wrap; gap: 4px; }
.attr-hint-val { padding: 3px 10px; border-radius: 6px; border: 1px solid #2a2a2e; background: #16161a; color: #b0aaa0; cursor: pointer; font-size: 0.78rem; transition: all 0.15s; }
.attr-hint-val:hover { background: #252529; color: #e4e2de; }
.attr-hint-val.current { border-color: #c49a82; color: #c49a82; background: rgba(196,154,130,0.1); }
