/* ============================================================
   主题：Cubox 蓝主题（cubox）— 2026-11-23 真机采样完整复刻
   品牌蓝 #2c46f1 + 三级文字灰 #3b3c3c/#707171/#a9aaab +
   图标灰 #6d7582 + 侧栏 #f9f9f9 + Cubox 精确阴影体系
   ============================================================ */

[data-theme="cubox"] {
  color-scheme: light;
  /* 表面：Cubox 白画布 + 灰侧栏 */
  --bg: #ffffff;
  --bg-deep: #f3f3f5;
  --sidebar: #f9f9f9;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.92);
  --panel-pop: rgba(255, 255, 255, 0.97);
  --card: #ffffff;
  --card-hover: #f3f3f3;
  /* 边界：Cubox 线色 */
  --border: #e5e8ed;
  --border-soft: rgba(229, 232, 237, 0.65);
  /* 侧栏文字：Cubox 三级灰 */
  --side-ink: #3b3c3c;
  --side-ink-dim: #3b3c3c;
  --side-ink-faint: #6e6e73; /* audit 2026-11-26: #a9aaab was 2.2-2.7:1 on #f9f9f9, below AA */
  --side-accent: #2c46f1;
  --side-accent-soft: rgba(44, 70, 241, 0.07);
  --side-hover: #f3f3f3;
  --side-border: #e5e8ed;
  /* 文字：Cubox content 三级 */
  --text: #3b3c3c;
  --text-dim: #707171;
  --text-faint: #6e6e73; /* audit 2026-11-26: AA recalibrated (was #a9aaab) */
  /* 强调：Cubox 品牌蓝全套 */
  --accent: #2c46f1;
  --accent-fill: #2c46f1;
  --accent-hover: #2338cf;
  --accent-ink: #2c46f1;
  --accent-soft: rgba(44, 70, 241, 0.08);
  /* 危险：Cubox alert 色 */
  --danger: #ea4f3d;
  --danger-ink: #d63a28;
  --danger-soft: rgba(234, 79, 61, 0.09);
  /* 右侧检查器 */
  --paper: #ffffff;
  --paper-hi: #fafafa;
  --paper-edge: #e5e8ed;
  --paper-tint: #f3f3f5;
  --ink: #3b3c3c;
  --ink-soft: #707171;
  --ink-faint: #6e6e73; /* audit 2026-11-26: AA recalibrated (was #a9aaab) */
  /* Cubox demo 品牌蓝对齐（--brand 此前从未定义，tab 下划线/选中色一直隐形） */
  --brand: #2c46f1;
  --brand-15: rgba(44, 70, 241, 0.09);
  /* 恒暗铬层 */
  --chrome: #18181b;
  --chrome-edge: rgba(255, 255, 255, 0.12);
  --on-chrome: #f5f5f7;
  --chrome-accent: #5b74f5;
  --veil-ink: #f5f5f7;
  --veil-ink-faint: #a1a1a6;
  /* 代码窗 */
  --code-bg: #f6f6f8;
  --code-edge: rgba(0, 0, 0, 0.07);
  --code-text: #3b3c3c;
  --code-muted: #6e6e73; /* AA recalibrated 2026-11-26 (was #a9aaab, 2.3:1 on #f6f6f8) */
  --tk-comment: #6e6e73; /* AA recalibrated 2026-11-26 (was #a9aaab) */
  --tk-string: #2c46f1;
  --tk-kw: #6d5aa8;
  --tk-num: #2c46f1;
  --tk-var: #3b3c3c;
  --tk-flag: #b45309;
  --tk-key: #2c46f1;
  /* 类型色：向 Cubox 蓝系收敛（保留辨识度） */
  --t-prompt: #c48420;
  --t-repo: #2c46f1;
  --t-link: #2c46f1;
  --t-snippet: #5b74f5;
  --t-note: #7464bc;
  --t-image: #c45484;
  --t-file: #6d7582;
  --t-privacy: #6d5aa8;
  --heat-use: #2c46f1;
  /* 图标 */
  --icon: #6d7582;
  /* 阴影：Cubox 真机精确值 */
  --shadow-menu: 0 0 0 0.5px rgba(109, 117, 130, 0.14), 0 12px 32px rgba(109, 117, 130, 0.12);
  --shadow-pop: 0 2px 8px rgba(24, 25, 28, 0.08), 0 10px 40px rgba(24, 25, 28, 0.18);
  --shadow-card: 0 1.5px 4.6px rgba(24, 25, 28, 0.06), 0 24.6px 31.5px -17.7px rgba(24, 25, 28, 0.07);
  /* 滚动条 */
  --scroll-thumb: rgba(109, 117, 130, 0.35);
  --scroll-thumb-hover: rgba(109, 117, 130, 0.55);
  /* 排版 */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  --mono: "SF Mono", "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  --font-hand: var(--sans);
  /* 圆角：Cubox 体系（导航行 6px / 卡片 10px / 弹窗 12px） */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-btn: 6px;
  --radius-input: 6px;
}

/* ---------- 形态覆盖：让结构观感对齐 Cubox ---------- */

/* audit 2026-11-26: 全局 kbd 用 --text-dim(#707171) 压 --bg-deep(#f3f3f5) = 4.42:1，差 AA 一线；
   kbd 内单独提到 #6e6e73（4.55:1），不动 --text-dim 本身以保持其余 demo 对齐 */
[data-theme="cubox"] kbd { color: #6e6e73; }

/* 侧栏导航行：Cubox 36px 高 / 6px 圆角 / 图标灰 */
[data-theme="cubox"] .nav-row {
  border-radius: 6px;
}
[data-theme="cubox"] .nav-row .nav-ic {
  color: var(--icon);
}
[data-theme="cubox"] .nav-row.active .nav-ic {
  color: var(--accent);
}

/* 工具栏：Cubox 无点阵底纹，纯白 */
[data-theme="cubox"] .toolbar {
  background-image: none;
}

/* 卡片：Cubox 精确双层软阴影 + 10px 圆角 + hover 深化 */
[data-theme="cubox"] .entry {
  border-radius: 10px;
  border-color: transparent;
  box-shadow: var(--shadow-card);
}
[data-theme="cubox"] .entry:hover {
  background: #ffffff;
  box-shadow: 0 1.5px 4.6px rgba(24, 25, 28, 0.09), 0 24.6px 31.5px -17.7px rgba(24, 25, 28, 0.13);
}
[data-theme="cubox"] .entry.selected {
  border-color: rgba(44, 70, 241, 0.45);
  background: rgba(44, 70, 241, 0.04);
  box-shadow: var(--shadow-card);
}

/* 卡片视图大卡：10px 圆角对齐 */
[data-theme="cubox"] body.view-cards .entry:not(.tile),
[data-theme="cubox"] body.view-cards .entry:not(.tile).selected {
  border-radius: 10px;
  border-color: transparent;
  box-shadow: var(--shadow-cubox, var(--shadow-card));
}

/* 类型铭牌：Cubox 无铭牌概念，弱化为浅蓝调小签 */
[data-theme="cubox"] .type-plate {
  color: #5b74f5;
  border-color: rgba(44, 70, 241, 0.16);
  background: rgba(44, 70, 241, 0.06);
  border-radius: 4px;
}

/* 卡片排版对齐 Cubox：标题 16/600、meta 12px、行距与间距贴 demo */
[data-theme="cubox"] body.view-cards .entry .entry-title {
  font-size: 15.5px; font-weight: 600;
}
[data-theme="cubox"] body.view-cards .entry .entry-desc {
  font-size: 12.5px; color: #707171;
}
[data-theme="cubox"] body.view-cards .entry .entry-meta,
[data-theme="cubox"] body.view-cards .entry .entry-date,
[data-theme="cubox"] body.view-cards .entry .entry-no {
  font-size: 12px; color: #a9aaab;
}
[data-theme="cubox"] body.view-cards .entry .type-plate {
  border-radius: 4px;
}

/* 命令面板选中态：黑胶囊 → 品牌蓝胶囊（Cubox 分段选中就是实蓝） */
[data-theme="cubox"] .cmd-item:hover,
[data-theme="cubox"] .cmd-item.active {
  background: var(--accent-fill);
}

/* 顶栏按钮：Cubox 28x28 图标钮观感 */
[data-theme="cubox"] .ghost-btn,
[data-theme="cubox"] .toolbar .btn {
  border-radius: 6px;
}

/* ---------- 结构对齐 demo：中列窄卡流 + 右栏一体白 + 侧栏头部 Cubox 形态 ---------- */

/* 中列：右栏打开时固定 296px 窄列（Cubox 卡片流），收起右栏时自然舒展铺满 */
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open .center {
  width: var(--mid-w, 296px); min-width: 232px; flex: none;
  border-right: 1px solid var(--border);
}
[data-theme="cubox"] .shell:not(.panel-open) .center {
  width: auto; min-width: 0; flex: 1 1 auto; border-right: 0;
}
[data-theme="cubox"] .shell:not(.panel-open) .mid-resizer { display: none; }
}
[data-theme="cubox"] .item-list { max-width: none; }
[data-theme="cubox"] .toolbar-head { padding: 12px 12px 8px 14px; }
[data-theme="cubox"] .toolbar-panel { padding: 0 12px 10px 14px; }
[data-theme="cubox"] #toolbar-context-label { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }

/* 抽屉去卡片化：右栏与页面一体白，纸卡铺满无边框（Cubox 阅读区形态） */
[data-theme="cubox"] .detail-drawer { background: #ffffff; }
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open {
  /* 中列固定 296 + 右栏吃掉全部剩余宽度（Cubox 三栏：264 | 296 | 弹性） */
  grid-template-columns: var(--sb-w, 236px) var(--mid-w, 296px) minmax(480px, 1fr);
}
}
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open .detail-drawer { width: 100%; }
}
@media (min-width: 720px) {
[data-theme="cubox"] .paper-card {
  width: auto; flex: 1 1 0; min-width: 0;
  border-left: 0; box-shadow: none;
}
}

/* 侧栏头部：logo 变 Cubox 蓝方块头像；统计行弱化；搜索框变灰底胶囊 */
[data-theme="cubox"] .sidebar-head .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-theme="cubox"] .sidebar-head .logo .icon { width: 15px; height: 15px; color: #ffffff; }
[data-theme="cubox"] .sidebar-head .stats { display: none; }
[data-theme="cubox"] .search-wrap {
  background: #ededed; border: 0; border-radius: 6px; height: 36px;
}
[data-theme="cubox"] .search-wrap:focus-within { background: #ffffff; border: 1px solid rgba(44, 70, 241, 0.35); }
[data-theme="cubox"] .search-wrap .search-ic { color: #707171; }

/* Cubox 单列窄卡流：视口级 media 双列在 296 容器里会挤爆，强制单列 */
[data-theme="cubox"] body.view-cards .item-list:not(.gallery) {
  grid-template-columns: minmax(0, 1fr);
}

/* 设置弹窗 Cubox 化：右侧滑出抽屉形态（点右上角 ⚙ 弹出，各种设置都在这） */
[data-theme="cubox"] #modal-settings .modal {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(430px, 92vw); height: 100dvh; max-height: none;
  border-radius: 0; border: 0; border-left: 1px solid var(--border);
  animation: cubox-drawer-in var(--dur-slow) var(--ease);
  box-shadow: -24px 0 60px rgba(24, 25, 28, 0.10);
}
@keyframes cubox-drawer-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 视图卡（view-cards）封面布局：卡片改纵向，封面区置顶 */
[data-theme="cubox"] body.view-cards .entry:not(.tile) {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
[data-theme="cubox"] body.view-cards .entry:not(.tile) .entry-main { padding: 12px 16px 12px; }

/* 卡片素化（demo 信息密度）：藏铭牌/编号/标签行/hover动作条，只留封面+标题+摘要+日期 */
[data-theme="cubox"] .entry .type-plate,
[data-theme="cubox"] .entry .entry-no,
[data-theme="cubox"] .entry .entry-row3 { display: none; }
[data-theme="cubox"] .entry:hover .row-act { display: none; }

/* 中列标题行去计数胶囊（demo 标题无计数） */
[data-theme="cubox"] .toolbar-count-pill { display: none; }

/* 素化补刀：selected/focus 态的 hover 动作条与使用次数标记也藏 */
[data-theme="cubox"] .entry.selected .row-act,
[data-theme="cubox"] .entry:focus-within .row-act { display: none; }
[data-theme="cubox"] .entry .use-mark,
[data-theme="cubox"] .entry .dusty-bit { display: none; }
[data-theme="cubox"] .entry .ai-organize-mark,
[data-theme="cubox"] .entry .ink-marks { display: none; }

/* ============ 卡片 demo 三层 face（封面+标题+favicon域名·时间） ============ */
.cubox-face { display: none; }
[data-theme="cubox"] body.view-cards .entry .cubox-face {
  display: block; padding: 4px 16px 14px;
}
[data-theme="cubox"] body.view-cards .entry:has(> .cubox-face):not([data-type="image"]) .entry-main { display: none; }
/* image 类型走 thumb 流：face 让位 */
[data-theme="cubox"] body.view-cards .entry[data-type="image"] .cubox-face { display: none; }
[data-theme="cubox"] body.view-cards .entry[data-type="image"] .entry-main { display: flex; }
.cf-title {
  font-size: 15.5px; font-weight: 600; line-height: 1.4; color: #3b3c3c;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cf-meta {
  margin-top: 10px; display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: #707171;
}
.cf-fav {
  width: 15px; height: 15px; border-radius: 3px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #ffffff;
}
.cf-sep, .cf-time { color: #a9aaab; }

/* 类型筛选：chips 网格 → demo 行式列表 */
[data-theme="cubox"] .type-chips-grid {
  display: flex; flex-direction: column; gap: 2px;
}
[data-theme="cubox"] .type-chips-grid .nav-row {
  height: 36px;
}
[data-theme="cubox"] .type-chips-grid .nav-row em.count {
  margin-left: auto;
}

/* ============================================================
   Cubox demo parity layer - 1:1 against cubox-ui-demo.html
   (every value below was measured on the rendered demo).
   All rules are scoped to [data-theme="cubox"]; the shared ai2-/qa2-/st2-/info2-
   base layer lives in /ai2.css (2026-11-26 audit: the old unscoped block here
   leaked #fff / --brand into every other theme).
   ============================================================ */
[data-theme="cubox"] {
  --brand-30: rgba(44, 70, 241, 0.3);
  --aura: #edeff3;
  --cx-gray-1: #f9f9f9; --cx-gray-2: #f3f3f3; --cx-gray-3: #ededed;
  --cx-gray-4: #e7e7e7; --cx-gray-5: #dcdcdc;
  --cx-line: #e5e8ed;
  --cx-shadow-row: 0 1px 4px rgba(0, 0, 0, 0.04);
  --sb-w: 264px;
}

/* ---------------- shell: sidebar | 296 list | flexible detail + 320 AI ---------------- */
[data-theme="cubox"] .detail-drawer { display: flex; background: #ffffff; }
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open .detail-drawer { width: 100%; }
}
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open {
  grid-template-columns: var(--sb-w, 264px) var(--mid-w, 296px) minmax(420px, 1fr);
}
}
@media (min-width: 720px) {
[data-theme="cubox"] .shell.panel-open .detail-drawer .paper-card {
  flex: 1; min-width: 0; width: auto; max-width: none; border-left: 0; box-shadow: none;
}
}
[data-theme="cubox"] #drawer-resizer { display: none; }
/* the fourth column belongs to library items only (see bindRightColumn in cubox.js) */
[data-theme="cubox"] #detail-drawer .ai-panel2 { display: none; }
[data-theme="cubox"] .shell.cx-item #detail-drawer .ai-panel2 { display: flex; }
[data-theme="cubox"] .shell.cx-item #detail-drawer .ai-panel2[hidden] { display: none; }

/* theme-scoped icon swap: .has-cx hosts the stock icon + one .ic-cx twin */
.ic-cx { display: none; }
[data-theme="cubox"] .has-cx > .icon:not(.ic-cx) { display: none; }
[data-theme="cubox"] .has-cx > .ic-cx { display: inline-block; }

/* ---------------- left sidebar (demo .sb) ---------------- */
[data-theme="cubox"] #sidebar { background: var(--cx-gray-1); padding: 0; gap: 0; }

/* user row: 56px, avatar 28 brand square with the first glyph, name 14/600, caret, fold */
[data-theme="cubox"] .sidebar-head { height: 56px; flex: none; padding: 12px 16px; gap: 8px; align-items: center; }
[data-theme="cubox"] #brand-menu-btn { height: 28px; padding: 0; gap: 8px; border-radius: 8px; }
[data-theme="cubox"] .sidebar-head .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #ffffff; }
[data-theme="cubox"] .sidebar-head .logo .icon { display: none; }
[data-theme="cubox"] .sidebar-head .logo::after { content: "\4ED3"; font-size: 13px; font-weight: 700; line-height: 1; }
[data-theme="cubox"] .brand-text h1 { font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: 0; color: var(--ink); }
[data-theme="cubox"] #brand-menu-btn .brand-caret { width: 14px; height: 14px; margin-left: 0; color: var(--ink-faint); transform: rotate(90deg); }
[data-theme="cubox"] #brand-menu-btn[aria-expanded="true"] .brand-caret { transform: rotate(-90deg); }
[data-theme="cubox"] #nav-toggle { width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 6px; background: none; color: var(--icon); }
[data-theme="cubox"] #nav-toggle:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] #nav-toggle .icon { width: 16px; height: 16px; }

/* quick row: gray search box 36px + white add button 36px */
[data-theme="cubox"] .sidebar-search { flex: none; padding: 4px 16px 8px; gap: 8px; margin: 0; }
[data-theme="cubox"] .search-wrap {
  height: 36px; padding: 0 14px; gap: 8px; display: flex; align-items: center;
  background: var(--cx-gray-3); border: 1px solid transparent; border-radius: 6px;
}
[data-theme="cubox"] .search-wrap:hover { background: var(--cx-gray-4); }
[data-theme="cubox"] .search-wrap:focus-within { background: #ffffff; border-color: var(--brand-30); }
[data-theme="cubox"] .search-wrap .search-ic { position: static; width: 15px; height: 15px; flex: none; color: var(--ink-soft); }
[data-theme="cubox"] #search {
  height: 100%; flex: 1; min-width: 0; padding: 0; border: 0; background: transparent;
  font-size: 14px; color: var(--ink);
}
[data-theme="cubox"] #search::placeholder { color: var(--ink-soft); }
[data-theme="cubox"] #search-kbd {
  flex: none; margin: 0; font-family: inherit; font-size: 11px; line-height: 16px;
  color: var(--ink-faint); background: #ffffff; border: 1px solid var(--cx-line); border-radius: 4px; padding: 1px 5px;
}
[data-theme="cubox"] #sb-quick-add {
  width: 36px; height: 36px; flex: none; background: #ffffff; border: 1px solid var(--cx-line);
  border-radius: 6px; color: var(--icon); padding: 0;
}
[data-theme="cubox"] #sb-quick-add:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] #sb-quick-add .icon { width: 16px; height: 16px; }

/* scroll area */
[data-theme="cubox"] .sidebar-scroll { padding: 4px 16px 8px; gap: 0; scrollbar-width: thin; }
[data-theme="cubox"] .sidebar-scroll::-webkit-scrollbar { width: 4px; }
[data-theme="cubox"] .sidebar-scroll::-webkit-scrollbar-thumb { background: var(--cx-gray-4); border-radius: 2px; }
[data-theme="cubox"] .sidebar-scroll .side-section + .side-section { margin-top: 8px; }

/* nav row: 36px, 14/500, white active card with hairline + soft shadow, brand icon */
[data-theme="cubox"] #sidebar .nav-row {
  width: 100%; flex: none; height: 36px; padding: 0 14px; gap: 8px; border-radius: 6px;
  display: flex; align-items: center; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--ink);
  border: 1px solid transparent; background: transparent; box-shadow: none;
}
[data-theme="cubox"] #sidebar .nav-row:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] #sidebar .nav-row.active {
  background: #ffffff; border-color: var(--cx-line); box-shadow: var(--cx-shadow-row);
}
[data-theme="cubox"] #sidebar .nav-row .nav-ic { width: 16px; height: 16px; flex: none; color: var(--ink); }
[data-theme="cubox"] #sidebar .nav-row.active .nav-ic { color: var(--brand); }
[data-theme="cubox"] #sidebar .nav-row .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="cubox"] #sidebar .nav-row em.count {
  margin: 0; padding: 0; min-width: 0; height: auto; border-radius: 0; background: none;
  font-size: 12px; font-weight: 500; color: var(--ink-faint);
}
[data-theme="cubox"] #zone-nav .nav-row[data-zone="inbox"] em.count.badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9999px;
  background: var(--brand); color: #ffffff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
[data-theme="cubox"] .nav-rows { display: flex; flex-direction: column; gap: 0; }

/* group header: 32px, 12/500 faint, chevron at the right edge */
[data-theme="cubox"] .side-section > .side-fold,
[data-theme="cubox"] .side-title-row { margin-top: 8px; }
[data-theme="cubox"] .side-title-row { position: relative; height: auto; padding: 0; border: 0; }
[data-theme="cubox"] .side-fold {
  width: 100%; height: 32px; padding: 0 8px 0 14px; gap: 8px; border: 0; border-radius: 6px;
  display: flex; align-items: center; text-align: left; background: none;
  font-size: 12px; font-weight: 500; color: var(--ink-faint);
}
[data-theme="cubox"] .side-fold:hover { color: var(--ink-soft); background: none; }
[data-theme="cubox"] .side-fold .side-title { flex: 1; font-size: 12px; font-weight: 500; color: inherit; letter-spacing: 0; }
[data-theme="cubox"] .side-fold .tri { width: 16px; height: 16px; margin-left: auto; color: inherit; transform: rotate(90deg); }
[data-theme="cubox"] .side-fold[aria-expanded="false"] .tri { transform: none; }
[data-theme="cubox"] .coll-head-tools {
  position: absolute; right: 26px; top: 4px; opacity: 0; transition: opacity 0.14s;
}
[data-theme="cubox"] .side-title-row:hover .coll-head-tools { opacity: 1; }
[data-theme="cubox"] .coll-new-btn,
[data-theme="cubox"] .coll-head-btn {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--ink-faint);
}

/* collection rows: colored dot + name + count (same rhythm as nav rows) */
[data-theme="cubox"] .coll-row {
  width: 100%; height: 36px; padding: 0 14px; gap: 8px; border: 1px solid transparent; border-radius: 6px;
  display: flex; align-items: center; text-align: left; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
[data-theme="cubox"] .coll-row:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] .coll-row.active { background: #ffffff; border-color: var(--cx-line); box-shadow: var(--cx-shadow-row); }
[data-theme="cubox"] .coll-row::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; margin: 0 4.5px 0 0;
  background: var(--cx-dot, var(--brand));
}
[data-theme="cubox"] .coll-row-wrap:nth-child(5n+1) .coll-row { --cx-dot: #2c46f1; }
[data-theme="cubox"] .coll-row-wrap:nth-child(5n+2) .coll-row { --cx-dot: #e9c46a; }
[data-theme="cubox"] .coll-row-wrap:nth-child(5n+3) .coll-row { --cx-dot: #2a9d8f; }
[data-theme="cubox"] .coll-row-wrap:nth-child(5n+4) .coll-row { --cx-dot: #e76f51; }
[data-theme="cubox"] .coll-row-wrap:nth-child(5n+5) .coll-row { --cx-dot: #264653; }
[data-theme="cubox"] .coll-row > .icon { display: none; }
[data-theme="cubox"] .coll-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="cubox"] .coll-count { font-size: 12px; font-weight: 500; color: var(--ink-faint); }

/* type rows: dot leads, label, plain count; the "all" row only appears as the way back */
[data-theme="cubox"] .type-chips-grid { display: flex; flex-direction: column; gap: 0; }
[data-theme="cubox"] .type-chips-grid .nav-row .nav-ic { order: -1; width: 16px; height: 16px; display: none; }
[data-theme="cubox"] .type-chips-grid .nav-row .dot {
  order: -1; width: 7px; height: 7px; margin: 0 4.5px 0 0; flex: none; border: 0;
}
[data-theme="cubox"] .type-chips-grid .nav-row .nav-label { order: 0; }
[data-theme="cubox"] .type-chips-grid .nav-row em.count { order: 1; margin-left: auto; font-size: 12px; }
[data-theme="cubox"] #sidebar .type-chips-grid .nav-row[data-type="all"].active { display: none; }

/* tag rows: tag glyph + name + count */
[data-theme="cubox"] #tag-filter { display: none; }
[data-theme="cubox"] #tag-index { display: flex; flex-direction: column; gap: 0; }
[data-theme="cubox"] #tag-index .tag {
  width: 100%; height: 36px; padding: 0 14px; gap: 8px; border: 1px solid transparent; border-radius: 6px;
  display: flex; align-items: center; text-align: left; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
[data-theme="cubox"] #tag-index .tag:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] #tag-index .tag.active { background: #ffffff; border-color: var(--cx-line); box-shadow: var(--cx-shadow-row); }
[data-theme="cubox"] #tag-index .tag::before {
  content: ""; width: 16px; height: 16px; flex: none; background-color: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 12 22l-8-8 8.6-8.6a2 2 0 0 1 1.4-.6H19a2 2 0 0 1 2 2v5.2a2 2 0 0 1-.4 1.4Z'/%3E%3Ccircle cx='16' cy='8' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 12 22l-8-8 8.6-8.6a2 2 0 0 1 1.4-.6H19a2 2 0 0 1 2 2v5.2a2 2 0 0 1-.4 1.4Z'/%3E%3Ccircle cx='16' cy='8' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-theme="cubox"] #tag-index .tag span { flex: 1; min-width: 0; font-size: 0; }
[data-theme="cubox"] #tag-index .tag span::after { content: attr(data-name); font-size: 14px; }
[data-theme="cubox"] #tag-index .tag em { font-size: 12px; font-weight: 500; font-style: normal; color: var(--ink-faint); }

/* foot: hairline on top, quieter rows */
[data-theme="cubox"] .sb-foot-nav {
  flex: none; padding: 8px 16px 16px; border-top: 1px solid var(--cx-gray-3);
  display: flex; flex-direction: column; gap: 2px;
}
[data-theme="cubox"] .sb-foot-nav .nav-row { font-weight: 400; color: var(--ink-soft); }
[data-theme="cubox"] .sb-foot-nav .nav-row .nav-ic { color: var(--ink-soft); }
[data-theme="cubox"] .sb-foot-nav .nav-row.active { font-weight: 500; color: var(--ink); }
[data-theme="cubox"] .sb-foot-nav .nav-row.active .nav-ic { color: var(--brand); }

/* ---------------- middle column (demo .mid) ---------------- */
[data-theme="cubox"] #center { border-right: 1px solid var(--cx-gray-3); background: #ffffff; }
@media (min-width: 720px) {
[data-theme="cubox"] #toolbar {
  height: auto; min-height: 56px; padding: 0 12px; border: 0; box-shadow: none;
  background: transparent; flex: none;
}
}
@media (min-width: 720px) {
[data-theme="cubox"] .toolbar-head { height: 56px; width: 100%; padding: 0; gap: 8px; border: 0; align-items: center; }
}
[data-theme="cubox"] #toolbar-context { margin-left: 12px; padding: 0; gap: 0; }
[data-theme="cubox"] #toolbar-context-label { font-size: 18px; font-weight: 800; letter-spacing: 0; line-height: 1.3; color: var(--ink); }
[data-theme="cubox"] .toolbar-count-pill { display: none; }
[data-theme="cubox"] #toolbar-toggle {
  margin-left: auto; width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 6px;
  background: none; color: var(--icon); flex: none;
}
[data-theme="cubox"] #toolbar-toggle:hover,
[data-theme="cubox"] #toolbar-toggle.on { background: var(--cx-gray-2); color: var(--ink); }
[data-theme="cubox"] #toolbar-toggle.on { color: var(--brand); }
[data-theme="cubox"] #toolbar-toggle .icon { width: 16px; height: 16px; stroke-width: 1.6; }

/* display options panel (demo .mid-pop) */
[data-theme="cubox"] .toolbar-panel {
  margin: 0 0 6px; padding: 4px 14px 14px; background: #ffffff;
  border: 1px solid var(--cx-line); border-radius: 10px; box-shadow: var(--cx-shadow-row);
}
[data-theme="cubox"] #toolbar-panel > .toolbar-control-group,
[data-theme="cubox"] #toolbar-panel > .toolbar-display-group,
[data-theme="cubox"] #toolbar-panel > #adaptive-slot { display: none; }
.cx-mp { display: none; }
[data-theme="cubox"] .cx-mp { display: block; }
.mp-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--cx-gray-3); }
.mp-row:last-of-type { border-bottom: 0; }
.mp-label { font-size: 13px; color: var(--ink); font-weight: 500; }
.mp-select { position: relative; }
.mp-select select {
  appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 13px; color: var(--ink-soft);
  background: var(--cx-gray-1); border: 1px solid var(--cx-line); border-radius: 6px;
  padding: 5px 26px 5px 12px; outline: none; cursor: pointer; max-width: 150px;
}
.mp-select::after {
  content: ""; position: absolute; right: 9px; top: 50%; margin-top: -3px;
  border: 4px solid transparent; border-top-color: var(--ink-faint); pointer-events: none;
}
.mp-block-label { font-size: 12px; color: var(--ink-faint); padding: 12px 0 8px; }
.layout-cards { display: flex; gap: 10px; }
.layout-card {
  flex: 1; padding: 10px 8px 8px; border: 1px solid var(--cx-line); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12px; color: var(--ink-soft); background: #ffffff; cursor: pointer;
}
.layout-card:hover { border-color: var(--cx-gray-5); }
.layout-card.on { border-color: var(--brand); color: var(--brand); }
.layout-thumb { width: 56px; height: 36px; padding: 3px; border: 1px solid var(--cx-gray-4); border-radius: 4px; display: flex; gap: 2px; }
.layout-card.on .layout-thumb { border-color: var(--brand-30); }
.lt-single { flex-direction: column; }
.lt-single .lt-line { flex: 1; display: flex; gap: 2px; }
.lt-single .lt-line i { background: var(--cx-gray-4); border-radius: 1px; }
.lt-single .lt-line i:first-child { width: 14px; }
.lt-single .lt-line i:last-child { flex: 1; }
.lt-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.lt-grid i { background: var(--cx-gray-4); border-radius: 1px; }
.layout-card.on .lt-grid i,
.layout-card.on .lt-single .lt-line i { background: var(--brand-30); }

/* list canvas (demo .mid-list) */
[data-theme="cubox"] #list-scroll { padding: 4px 12px 16px; scrollbar-width: thin; }
[data-theme="cubox"] #list-scroll::-webkit-scrollbar { width: 4px; }
[data-theme="cubox"] #list-scroll::-webkit-scrollbar-thumb { background: var(--cx-gray-4); border-radius: 2px; }
[data-theme="cubox"] #list { display: flex; flex-direction: column; gap: 14px; padding: 0; margin: 0; }

/* ---------------- cards (demo .card): cover on top, title, meta ---------------- */
[data-theme="cubox"] #list .entry:has(> .card-cover):not(.tile) {
  flex: none; flex-direction: column; align-items: stretch; gap: 0; height: auto; padding: 0;
  overflow: hidden; border: 1px solid transparent; border-radius: 10px; background: #ffffff;
  box-shadow: var(--shadow-card);
}
[data-theme="cubox"] #list .entry:has(> .card-cover):not(.tile):hover {
  background: #ffffff;
  box-shadow: 0 1.5px 4.6px rgba(24, 25, 28, 0.08), 0 24.6px 31.5px -17.7px rgba(24, 25, 28, 0.14);
}
[data-theme="cubox"] #list .entry.selected:not(.tile):not([data-type="image"]) {
  border-color: var(--brand); background: #ffffff; box-shadow: var(--shadow-card);
}
[data-theme="cubox"] #list .entry:has(> .card-cover):not(.tile) .entry-main,
[data-theme="cubox"] #list .entry[data-type="image"] .cubox-face { display: none; }
[data-theme="cubox"] #list .entry:has(> .card-cover) .cubox-face { display: block; padding: 12px 16px 12px; }
[data-theme="cubox"] .card-cover {
  width: 100%; height: 120px; flex: none; margin: 0; border-radius: 0;
  display: flex; align-items: center; justify-content: center; background: var(--aura);
}
[data-theme="cubox"] .cover-glyph {
  width: 84px; height: 84px; margin: 0; border-radius: 50%;
  background: rgba(44, 70, 241, 0.1); color: rgba(44, 70, 241, 0.75);
}
[data-theme="cubox"] .cover-glyph .icon { width: 40px; height: 40px; stroke-width: 1.2; }
[data-theme="cubox"] #list .entry:has(> .card-cover) > .dot {
  position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; margin: 0;
  border-radius: 50%; background: var(--brand) !important;
}
[data-theme="cubox"] .cf-title {
  font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="cubox"] .cf-meta { margin: 10px 0 0; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
[data-theme="cubox"] .cf-fav { width: 14px; height: 14px; margin-right: 2px; border-radius: 3px; font-size: 9px; font-weight: 400; color: #ffffff; }
[data-theme="cubox"] .cf-domain { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="cubox"] .cf-sep { margin: 0 2px; color: var(--ink-faint); }
[data-theme="cubox"] .cf-time { margin-left: 4px; color: var(--ink-soft); flex: none; }

/* display mode = titles only (demo .mid-list.rows) */
[data-theme="cubox"] body.compact #list { gap: 4px; }
[data-theme="cubox"] body.compact #list-scroll { padding-top: 8px; }
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover):not(.tile),
[data-theme="cubox"] body.compact #list .entry.selected:not(.tile):not([data-type="image"]) {
  border-color: transparent; border-radius: 8px; box-shadow: none; background: transparent;
}
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover):not(.tile):hover { background: var(--cx-gray-1); box-shadow: none; }
[data-theme="cubox"] body.compact #list .entry.selected:not(.tile):not([data-type="image"]) { background: var(--brand-15); }
[data-theme="cubox"] body.compact #list .entry .card-cover,
[data-theme="cubox"] body.compact #list .entry .cf-meta,
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover) > .dot { display: none; }
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover) .cubox-face { padding: 0; }
[data-theme="cubox"] body.compact .cf-title {
  display: block; font-size: 14px; font-weight: 500; padding: 9px 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* layout = tiles (demo .mid-list.tiles)；收起右栏时多列自适应铺开 */
[data-theme="cubox"] body.view-cards #list.item-list:not(.gallery) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 900px) {
  [data-theme="cubox"] body.view-cards .shell:not(.panel-open) #list.item-list:not(.gallery) {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
[data-theme="cubox"] body:not([data-zone="library"]).view-cards #list.item-list:not(.gallery) { grid-template-columns: minmax(0, 1fr); gap: 5px; }
[data-theme="cubox"] body.view-cards #list .entry .card-cover { height: 72px; }
[data-theme="cubox"] body.view-cards #list .entry .cover-glyph { width: 52px; height: 52px; }
[data-theme="cubox"] body.view-cards #list .entry .cover-glyph .icon { width: 26px; height: 26px; }
[data-theme="cubox"] body.view-cards #list .entry .cf-title { font-size: 13px; }
[data-theme="cubox"] body.view-cards #list .entry:has(> .card-cover) .cubox-face { padding: 10px 12px 10px; }
[data-theme="cubox"] body.view-cards #list .entry .cf-meta { margin-top: 8px; flex-wrap: wrap; }

/* inbox and todo rows carry no cover and no demo face: they stay plain list rows
   with the list rhythm from before the parity layer */
[data-theme="cubox"] body:not([data-zone="library"]) #list-scroll,
[data-theme="cubox"] body:not([data-zone="library"]).compact #list-scroll { padding: 12px 22px 28px; }
[data-theme="cubox"] body:not([data-zone="library"]) #list,
[data-theme="cubox"] body:not([data-zone="library"]).compact #list { gap: 5px; }

/* ---------------- detail column (demo .detail) ---------------- */
[data-theme="cubox"] .dt-bar { height: 56px; padding: 0 14px; gap: 8px; border-bottom: 0; background: transparent; }
[data-theme="cubox"] .dt-bar .tbtn {
  width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 6px; background: none; color: var(--ink);
}
[data-theme="cubox"] .dt-bar .tbtn:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] .dt-bar .tbtn.on { background: var(--brand-15); color: var(--brand); }
[data-theme="cubox"] .dt-bar .right-group { display: flex; gap: 6px; }
[data-theme="cubox"] .dt-bar .right-group .tbtn { margin: 0; }
[data-theme="cubox"] .dt-bar-title { font-size: 13px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0; }
[data-theme="cubox"] #d-read-view { padding: 0 48px 80px; font-size: 15.5px; }
[data-theme="cubox"] .d-read-head { padding-top: 24px; }
[data-theme="cubox"] .d-read-head h2 { font-size: 26px; font-weight: 700; line-height: 1.4; letter-spacing: 0; color: var(--ink); }
[data-theme="cubox"] .d-read-meta { margin-top: 10px; font-size: 13px; color: var(--ink-faint); }
[data-theme="cubox"] .d-read-body { margin-top: 22px; color: var(--ink); }

/* Aa popover (demo .aa-pop) */
[data-theme="cubox"] .aa-wrap { position: relative; }
[data-theme="cubox"] #aa-pop {
  top: 40px; right: -36px; width: 232px; padding: 14px 14px 8px; z-index: 60; /* -36 = panel button + gap: aligns to the group edge like the demo */
  background: #ffffff; border: 0; border-radius: 12px; box-shadow: var(--shadow-pop);
}
[data-theme="cubox"] .aa-label { padding: 4px 0 8px; font-size: 12px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0; }
[data-theme="cubox"] .aa-seg { display: flex; gap: 8px; }
[data-theme="cubox"] .aa-btn {
  flex: 1; height: 32px; padding: 0; gap: 4px; border: 0; border-radius: 8px;
  background: var(--cx-gray-2); font-family: inherit; font-size: 13px; font-weight: 400; color: var(--ink);
}
[data-theme="cubox"] .aa-btn:hover { background: var(--cx-gray-3); }
[data-theme="cubox"] .aa-btn.on { background: var(--brand); color: #ffffff; }
[data-theme="cubox"] .aa-fonts { padding-bottom: 6px; }
[data-theme="cubox"] .aa-font-item {
  width: 100%; height: 34px; padding: 0 10px; gap: 8px; border-radius: 6px;
  display: flex; align-items: center; text-align: left;
  font-family: inherit; font-size: 14px; font-weight: 400; color: var(--ink);
}
[data-theme="cubox"] .aa-font-item:hover { background: var(--cx-gray-2); }
[data-theme="cubox"] .aa-font-item .check { visibility: hidden; color: var(--brand); font-weight: 700; }
[data-theme="cubox"] .aa-font-item.on .check { visibility: visible; }

/* legacy base (ai-panel2 / ai2- / qa2- / st2- / info2-) moved to /ai2.css
   (2026-11-26 audit: unscoped #fff / --brand leaked into every other theme;
   the shared base layer now lives tokenized in ai2.css). */


/* ---------------- AI panel (demo .ai-panel) ---------------- */
[data-theme="cubox"] .ai-panel2 {
  width: 320px; flex: none; border-left: 1px solid var(--cx-gray-3);
  display: flex; flex-direction: column; background: #ffffff;
}
[data-theme="cubox"] .ai-panel2[hidden] { display: none; }
[data-theme="cubox"] .ai2-tabs {display: flex; padding: 8px 16px 0; border-bottom: 1px solid var(--cx-gray-3); }
[data-theme="cubox"] .ai2-tab {
  flex: 1; height: 38px; border: 0; background: transparent; position: relative;
  font-family: inherit; font-size: 14px; font-weight: 400; color: var(--ink-faint); cursor: pointer;
}
[data-theme="cubox"] .ai2-tab.on {color: var(--brand); font-weight: 600; }
[data-theme="cubox"] .ai2-tab.on::after {
  content: ""; position: absolute; left: 25%; right: 25%; bottom: 0;
  height: 2px; border-radius: 1px; background: var(--brand);
}
[data-theme="cubox"] .ai2-view {flex: 1; min-height: 0; display: flex; flex-direction: column; }
[data-theme="cubox"] .ai2-view[hidden] {display: none; }
[data-theme="cubox"] .ai2-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 20px; position: relative;
}
[data-theme="cubox"] .ai2-body[hidden] {display: none; }
[data-theme="cubox"] .ai2-empty {font-size: 13px; font-weight: 400; color: var(--ink-faint); text-align: center; line-height: 1.7; }
[data-theme="cubox"] .ai2-run {
  height: 38px; padding: 0 18px; gap: 6px; border: 1px solid var(--cx-line); border-radius: 19px;
  background: #ffffff; box-shadow: var(--cx-shadow-row);
  display: flex; align-items: center; font-family: inherit; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer;
}
[data-theme="cubox"] .ai2-run:hover {border-color: var(--brand-30); color: var(--brand); }
[data-theme="cubox"] .ai2-result {flex: 1; width: 100%; overflow-y: auto; padding: 18px 6px; font-size: 13.5px; line-height: 1.8; color: var(--ink); }
[data-theme="cubox"] .ai2-result ul {padding-left: 18px; }
[data-theme="cubox"] .ai2-result li {margin-bottom: 10px; }

/* QA pane (demo .qa-*) */
[data-theme="cubox"] .qa2-wrap {flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 8px; }
[data-theme="cubox"] .qa2-wrap[hidden] {display: none; }
[data-theme="cubox"] .qa2-input {
  height: 40px; width: 100%; padding: 0 12px; outline: none;
  border: 1px solid var(--brand-30); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: transparent;
}
[data-theme="cubox"] .qa2-input::placeholder {color: var(--ink-soft); }
[data-theme="cubox"] .qa2-input:focus {border-color: var(--brand); }
[data-theme="cubox"] .qa2-sec {font-size: 12px; color: var(--ink-faint); padding: 14px 0 8px; }
[data-theme="cubox"] .qa2-list {flex: 1; overflow-y: auto; }
[data-theme="cubox"] .qa2-preset {
  height: 40px; width: 100%; padding: 0 12px; border: 0; border-radius: 6px; background: transparent;
  text-align: left; font-family: inherit; font-size: 13.5px; font-weight: 400; color: var(--ink); cursor: pointer;
}
[data-theme="cubox"] .qa2-preset:hover {background: var(--brand-15); }
[data-theme="cubox"] .qa2-chat {flex: 1; overflow-y: auto; padding: 6px 2px; }
[data-theme="cubox"] .qa2-chat[hidden] {display: none; }
[data-theme="cubox"] .qa2-msg {margin-bottom: 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink); }
[data-theme="cubox"] .qa2-msg .who {font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }

/* annotate pane (demo .an-*) */
[data-theme="cubox"] #d-ann-view[hidden] {display: none; }
[data-theme="cubox"] .an-head {padding: 14px 16px 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
[data-theme="cubox"] .d-ann-list {flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
[data-theme="cubox"] #d-ann-view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
[data-theme="cubox"] .d-ann-card {
  position: relative; padding: 10px 12px; border: 1px solid var(--cx-gray-3); border-radius: 10px;
  background: #ffffff; box-shadow: none;
}
[data-theme="cubox"] .d-ann-card .ann-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; align-items: center; }
[data-theme="cubox"] .d-ann-card .ann-dot { width: 12px; height: 12px; border: 1px solid var(--cx-gray-5); border-radius: 50%; }
[data-theme="cubox"] .d-ann-card .ann-quote {
  margin-top: 6px; padding: 0 0 0 8px; border: 0; border-left: 3px solid var(--ann-c, #ffeb3b);
  border-radius: 0; background: none;
  font-size: 13px; line-height: 1.7; color: var(--ink);
}
[data-theme="cubox"] .d-ann-card .ann-note { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }
[data-theme="cubox"] .d-ann-card .ann-time { font-size: 12px; color: var(--ink-faint); }
[data-theme="cubox"] .d-ann-empty { padding: 24px 16px; font-size: 13px; color: var(--ink-faint); text-align: center; line-height: 1.7; }

/* ---------------- info pane (demo #pane-info) ---------------- */
[data-theme="cubox"] #pane2-info .ai2-info-scroll {
  position: relative; display: flex; flex-direction: column; padding: 12px 16px 0;
}
[data-theme="cubox"] #pane2-info .ai2-info-scroll > .d-body { display: contents; }
[data-theme="cubox"] #pane2-info .d-head-row,
[data-theme="cubox"] #pane2-info .d-content,
[data-theme="cubox"] #pane2-info #d-note,
[data-theme="cubox"] #pane2-info #d-colls,
[data-theme="cubox"] #pane2-info #d-atts,
[data-theme="cubox"] #pane2-info #d-Links,
[data-theme="cubox"] #pane2-info #d-links,
[data-theme="cubox"] #pane2-info .d-info-section,
[data-theme="cubox"] #pane2-info .d-info-meta-bar,
[data-theme="cubox"] #pane2-info .info2-action-deck { display: none !important; }
[data-theme="cubox"] #info2-cover, [data-theme="cubox"] #info2-link, [data-theme="cubox"] #info2-desc, [data-theme="cubox"] #info2-coll, [data-theme="cubox"] #info2-time {order: 0; }
[data-theme="cubox"] #info2-cover[hidden], [data-theme="cubox"] #info2-link[hidden] {display: none; }
[data-theme="cubox"] #info2-cover {order: 0; }
[data-theme="cubox"] #pane2-info .d-title-row {order: 1; }
[data-theme="cubox"] #info2-desc {order: 2; }
[data-theme="cubox"] #info2-link {order: 3; }
[data-theme="cubox"] #info2-coll {order: 4; }
[data-theme="cubox"] #pane2-info #d-tags-line {order: 5; }
[data-theme="cubox"] #pane2-info .info2-status {order: 6; }
[data-theme="cubox"] #pane2-info .info2-ops {order: 7; }
[data-theme="cubox"] #info2-time {order: 8; }

[data-theme="cubox"] .info2-cover {
  width: 100%; height: 150px; margin: 0; border-radius: 8px; background: var(--aura) !important;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="cubox"] .info2-cover .icon {width: 44px; height: 44px; stroke-width: 1.2; color: rgba(44, 70, 241, 0.55); }
[data-theme="cubox"] #pane2-info .d-title-row {display: block; margin: 12px 0 0; padding: 0; border: 0; gap: 0; }
[data-theme="cubox"] #pane2-info #d-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; padding: 4px 0; border: 0; background: none; outline: none;
  font-size: 14.5px; font-weight: 600; line-height: 1.5; color: var(--ink); cursor: default;
}
[data-theme="cubox"] #pane2-info #d-swap-title,
[data-theme="cubox"] #pane2-info #d-read,
[data-theme="cubox"] #pane2-info #d-preview { display: none; }
[data-theme="cubox"] #info2-desc {
  width: 100%; padding: 2px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
[data-theme="cubox"] #info2-desc:empty::before {content: "\6DFB\52A0\63CF\8FF0"; }
[data-theme="cubox"] .info2-link {
  display: flex; align-items: center; gap: 6px; min-width: 0; margin: 8px 0 2px;
  font-size: 12.5px; color: var(--ink-soft);
}
[data-theme="cubox"] .info2-link .fav {
  width: 14px; height: 14px; flex: none; border-radius: 3px;
  display: flex; align-items: center; justify-content: center; font-size: 9px; color: #ffffff;
}
[data-theme="cubox"] .info2-link a {min-width: 0; color: var(--ink-soft); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="cubox"] .info2-link a:hover {color: var(--brand); }
[data-theme="cubox"] .info2-coll {
  display: flex; align-items: center; justify-content: space-between; padding: 11px 0;
  border-bottom: 1px solid var(--cx-gray-3);
  font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer;
}
[data-theme="cubox"] .info2-coll:hover {color: var(--brand); }
[data-theme="cubox"] .info2-coll .k2-line {display: flex; align-items: center; gap: 8px; }
[data-theme="cubox"] .info2-coll .icon {width: 16px; height: 16px; stroke-width: 1.6; }
[data-theme="cubox"] .info2-coll .chev {font-size: 15px; line-height: 1; }
[data-theme="cubox"] #pane2-info #d-tags-line {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; margin: 0; border: 0;
  border-bottom: 1px solid var(--cx-gray-3);
}
[data-theme="cubox"] #pane2-info #d-tags-line[hidden] {display: none; }
[data-theme="cubox"] #pane2-info #d-tags-line .note-ref {
  display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 8px;
  border: 0; border-radius: 5px; background: var(--cx-gray-2);
  font-family: inherit; font-size: 0; line-height: 1.4; color: var(--ink-soft); cursor: pointer;
}
[data-theme="cubox"] #pane2-info #d-tags-line .note-ref::after {content: attr(data-name); font-size: 12px; order: 1; }
[data-theme="cubox"] #pane2-info #d-tags-line .note-ref::before {content: "\00D7"; font-size: 13px; color: var(--ink-faint); order: 2; }

[data-theme="cubox"] .info2-status {padding: 8px 0; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--cx-gray-3); }
[data-theme="cubox"] .info2-status .st2-row {
  height: 32px; padding: 0 8px; gap: 8px; border-radius: 6px;
  display: flex; align-items: center; font-size: 13px; font-weight: 400; color: var(--ink-soft); cursor: pointer;
}
[data-theme="cubox"] .info2-status .st2-row .icon {width: 16px; height: 16px; flex: none; color: inherit; stroke-width: 1.6; }
[data-theme="cubox"] .info2-status .st2-row:hover {background: var(--cx-gray-1); color: var(--ink); }
[data-theme="cubox"] .info2-ops {padding: 8px 0; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--cx-gray-3); }
[data-theme="cubox"] .info2-ops .st2-row {
  height: auto; padding: 0; border-radius: 6px; display: block;
  font-size: 13px; font-weight: 400; line-height: 1.66; color: var(--ink-soft); cursor: pointer;
}
[data-theme="cubox"] .info2-ops .st2-row .icon {width: 16px; height: 16px; color: inherit; stroke-width: 1.6; vertical-align: -3px; }
[data-theme="cubox"] .info2-ops .st2-row:hover {background: var(--cx-gray-1); color: var(--ink); }
[data-theme="cubox"] .info2-ops .st2-row.st2-danger {color: #ea4f3d; }
[data-theme="cubox"] .info2-ops .st2-row.st2-danger:hover {background: rgba(234, 79, 61, 0.06); color: #ea4f3d; }
[data-theme="cubox"] .info2-ops .st2-row.starred, [data-theme="cubox"] .info2-ops .st2-row.starred .icon {color: #f2b01e; }
[data-theme="cubox"] .info2-time {font-size: 12px; color: var(--ink-faint); padding: 10px 0 14px; }

/* slots injected by the skin layer are inert under the other themes */
.cx-only { display: none; }
[data-theme="cubox"] #info2-desc, [data-theme="cubox"] #info2-time { display: block; }

/* action strip is not part of the demo pane: rests hidden, surfaces on cover hover */
[data-theme="cubox"] #pane2-info .d-quick-strip {
  position: absolute; top: 120px; right: 24px; z-index: 3; margin: 0; gap: 6px;
  opacity: 0; pointer-events: none;
}
[data-theme="cubox"] #pane2-info .ai2-info-scroll.strip-on .d-quick-strip { opacity: 1; pointer-events: auto; }
[data-theme="cubox"] .cf-fav:empty { display: none; }

/* ---------------- Ctrl K quick jump (adaptive compact -> two-pane modal) ---------------- */
[data-theme="cubox"] #modal-quickjump { background: rgba(24, 25, 28, 0.14); align-items: flex-start; justify-content: center; z-index: 100; }
[data-theme="cubox"] #modal-quickjump .qj-box {
  width: min(460px, calc(100vw - 32px)); margin: 10vh 0 0; border: 1px solid var(--cx-gray-3); border-radius: 12px;
  box-shadow: var(--shadow-pop); overflow: hidden; background: #ffffff;
}
[data-theme="cubox"] #modal-quickjump .qj-box.qj-expanded {
  width: min(880px, calc(100vw - 36px));
  height: min(560px, 78vh);
  max-height: min(560px, 78vh);
  margin-top: 8vh;
}
[data-theme="cubox"] #modal-quickjump .qj-head { height: 44px; padding: 0 14px; gap: 8px; border-bottom: 1px solid var(--cx-gray-3); background: none; }
[data-theme="cubox"] #modal-quickjump .qj-head .icon { width: 15px; height: 15px; color: var(--ink-faint); }
[data-theme="cubox"] #modal-quickjump .qj-head kbd { display: none; }
[data-theme="cubox"] #qj-input { height: 42px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 400; color: var(--ink); }
[data-theme="cubox"] #qj-input::placeholder { color: var(--ink-soft); }
[data-theme="cubox"] #qj-results { padding: 4px 6px 6px; max-height: min(320px, 52vh); }
[data-theme="cubox"] #modal-quickjump .qj-box.qj-expanded #qj-results {
  max-height: none; border-right: 1px solid var(--cx-gray-3);
}
[data-theme="cubox"] #qj-results .cmd-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 500; color: var(--ink-faint); background: none; border: 0; }
[data-theme="cubox"] #qj-results .cmd-group em { display: none; }
[data-theme="cubox"] #qj-results .cmd-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  width: 100%; height: auto; padding: 7px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--ink); text-align: left; cursor: pointer;
}
[data-theme="cubox"] #qj-results .cmd-item:hover,
[data-theme="cubox"] #qj-results .cmd-item.active { background: var(--brand-15); color: var(--ink); }
[data-theme="cubox"] #qj-results .cmd-item .ci-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="cubox"] #qj-results .cmd-item .ci-no { font-size: 11px; color: var(--ink-faint); flex: none; }
[data-theme="cubox"] #qj-results .cmd-item .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--brand)); flex: none; }
[data-theme="cubox"] #modal-quickjump .qj-preview { background: #fafbfd; }
[data-theme="cubox"] #modal-quickjump .qj-pv-head,
[data-theme="cubox"] #modal-quickjump .qj-pv-actions { border-color: var(--cx-gray-3); }
[data-theme="cubox"] #modal-quickjump .qj-pv-title { color: var(--ink); }
[data-theme="cubox"] #modal-quickjump .qj-pv-body { color: var(--ink); }
[data-theme="cubox"] #modal-quickjump .qj-act-btn { border-color: var(--cx-gray-3); background: #fff; color: var(--ink); }
[data-theme="cubox"] #modal-quickjump .qj-act-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="cubox"] #modal-quickjump .qj-foot { padding: 6px 14px; gap: 8px; border-top: 1px solid var(--cx-gray-3); font-size: 11px; color: var(--ink-faint); background: none; }
[data-theme="cubox"] #modal-quickjump .qj-foot kbd { font-family: inherit; font-size: 10.5px; color: var(--ink-faint); background: var(--cx-gray-2); border: 0; border-radius: 4px; padding: 1px 5px; }
@media (max-width: 759px) {
  [data-theme="cubox"] #modal-quickjump .qj-box.qj-expanded { width: calc(100vw - 24px); height: auto; max-height: 76vh; }
  [data-theme="cubox"] #modal-quickjump .qj-box.qj-expanded #qj-results { border-right: 0; max-height: 58vh; }
}

/* ---------------- responsive: fourth column & narrow viewports ---------------- */
@media (min-width: 720px) and (max-width: 1279px) {
  [data-theme="cubox"] .shell.panel-open:not(.capture-open) {
    grid-template-columns: var(--sb-w, 264px) minmax(220px, var(--mid-w, 296px)) minmax(420px, 1fr);
  }
  [data-theme="cubox"] .ai-panel2 { width: 280px; }
}
@media (max-width: 1151px) {
  [data-theme="cubox"] .shell.cx-item #detail-drawer .ai-panel2:not([hidden]) {
    display: flex; position: fixed; right: 0; top: 0; bottom: 0;
    width: min(340px, 88vw); z-index: 60;
    box-shadow: -16px 0 40px rgba(15, 18, 34, 0.16);
    border-left: 1px solid var(--cx-line);
  }
}

/* ---------------- card overlays: two-step delete confirmation ----------------
   The strip was laid out for full-width rows (sentence + two buttons in a row).
   Inside a 260px cover card that clipped the sentence and stacked the buttons
   one glyph per line, so the card stacks it instead. */
[data-theme="cubox"] #list .entry:has(> .card-cover) .confirm-strip {
  flex-direction: column; justify-content: center; align-items: center; gap: 10px;
  padding: 14px 16px; text-align: center;
}
[data-theme="cubox"] #list .entry:has(> .card-cover) .confirm-strip > span {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="cubox"] #list .entry:has(> .card-cover) .confirm-strip > b,
[data-theme="cubox"] #list .entry:has(> .card-cover) .confirm-strip > i { flex: none; white-space: nowrap; }
/* titles-only rows are a single 39px line: keep one line and ellipsize the sentence */
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover) .confirm-strip {
  flex-direction: row; justify-content: flex-start; gap: 8px; padding: 0 12px; text-align: left;
}
[data-theme="cubox"] body.compact #list .entry:has(> .card-cover) .confirm-strip > span {
  display: block; -webkit-line-clamp: none; flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* tiles are ~130px wide: tighter gutters so the buttons still fit on one line */
[data-theme="cubox"] body.view-cards #list .entry:has(> .card-cover) .confirm-strip { padding: 10px; gap: 6px; }

/* ---------------- collapsed rail ---------------- */
[data-theme="cubox"] .profile-avatar { background: var(--brand); }
[data-theme="cubox"] .sidebar-head #sb-quick-add { background: var(--brand-15); color: var(--brand); }
[data-theme="cubox"] body.sidebar-collapsed .sidebar-head {
  flex-direction: column-reverse; justify-content: center; align-items: center; gap: 8px; padding: 12px 8px 8px; height: auto;
}
[data-theme="cubox"] body.sidebar-collapsed .sidebar-scroll { padding: 6px 8px; }
[data-theme="cubox"] body.sidebar-collapsed #sidebar .side-section + .side-section { margin-top: 0; }
[data-theme="cubox"] body.sidebar-collapsed #zone-nav .nav-row {
  position: relative; align-self: center; width: 38px; height: 38px; padding: 0; gap: 0;
  border-radius: 10px; justify-content: center;
}
[data-theme="cubox"] body.sidebar-collapsed #zone-nav .nav-row[data-zone="inbox"] em.count.badge {
  display: inline-flex; position: absolute; right: -2px; top: -1px; margin: 0;
  height: 15px; min-width: 15px; padding: 0 4px; font-size: 10px; line-height: 15px;
  box-shadow: 0 0 0 1.5px var(--cx-gray-1);
}
[data-theme="cubox"] body.sidebar-collapsed .sb-profile-foot { align-items: center; padding: 10px 8px 14px; }

/* ---------------- narrow desktop / tablet ---------------- */
@media (min-width: 720px) and (max-width: 1279px) {
  [data-theme="cubox"] .shell.panel-open:not(.capture-open) .center { width: auto; min-width: 230px; }
}
@media (min-width: 720px) and (max-width: 979px) {
  [data-theme="cubox"] .shell.panel-open:not(.capture-open) {
    grid-template-columns: var(--sb-w, 264px) minmax(200px, var(--mid-w, 296px)) minmax(min(280px, 34vw), 1fr);
  }
  [data-theme="cubox"] .shell.panel-open:not(.capture-open) .center { width: auto; min-width: 200px; }
  [data-theme="cubox"] #d-read-view { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 719px) {
  [data-theme="cubox"] #d-read-view { padding: 0 20px 60px; }
}

/* ---------------- middle column resizer ---------------- */
[data-theme="cubox"] .mid-resizer {
  position: absolute; top: 0; right: -3px; bottom: 0; width: 6px; z-index: 5;
  cursor: col-resize; touch-action: none;
}
[data-theme="cubox"] .mid-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 2px;
  border-radius: 1px; background: transparent; transition: background .12s;
}
[data-theme="cubox"] .mid-resizer:hover::after,
[data-theme="cubox"] body.mid-resizing .mid-resizer::after { background: var(--brand-30); }
[data-theme="cubox"] body.mid-resizing { cursor: col-resize; user-select: none; }
[data-theme="cubox"] body.mid-resizing iframe,
[data-theme="cubox"] body.mid-resizing #list-scroll { pointer-events: none; }
[data-theme="cubox"] .shell { --mid-w: var(--mid-w-set, 296px); }

/* ---------------- fourth column: Cubox tokens & flow ---------------- */
[data-theme="cubox"] .ai2-head { border-bottom-color: var(--cx-gray-3); }
[data-theme="cubox"] .ai2-close:hover,
[data-theme="cubox"] .ai2-back:hover { background: var(--cx-gray-2); color: var(--ink); }
[data-theme="cubox"] .info2-entries { border-bottom-color: var(--cx-gray-3); }
[data-theme="cubox"] .st2-nav { height: 34px; color: var(--ink); }
[data-theme="cubox"] .st2-nav:hover { background: var(--cx-gray-1); }
[data-theme="cubox"] .st2-nav:hover .icon:not(.chev) { color: var(--brand); }
[data-theme="cubox"] .st2-nav em { background: var(--cx-gray-2); }
[data-theme="cubox"] .zone-switch { background: var(--cx-gray-2); }
[data-theme="cubox"] .zone-switch button.on { color: var(--brand); }
[data-theme="cubox"] #pane2-info .info2-entries { order: 6; }
[data-theme="cubox"] #pane2-info .info2-status { order: 7; }
[data-theme="cubox"] #pane2-info .info2-ops { order: 8; }
[data-theme="cubox"] #pane2-info .info2-move { order: 9; }
[data-theme="cubox"] #pane2-info .info2-capture { order: 10; }
[data-theme="cubox"] #info2-time { order: 11; }
[data-theme="cubox"] #pane2-info .d-quick-strip { display: none !important; }
[data-theme="cubox"] .task-card .task-strip { border-color: var(--cx-gray-3); padding: 9px 12px; }

/* ---------------- todo & trash zones: full-width center + 400px inspector ---------------- */
[data-theme="cubox"] body[data-zone="todo"] .mid-resizer,
[data-theme="cubox"] body.trash-page-open .mid-resizer { display: none; }
[data-theme="cubox"] body[data-zone="todo"] .center,
[data-theme="cubox"] body.trash-page-open .center { width: auto; min-width: 0; }
@media (min-width: 1025px) {
  [data-theme="cubox"] body[data-zone="todo"] .shell.panel-open:not(.capture-open),
  [data-theme="cubox"] body.trash-page-open .shell.panel-open:not(.capture-open) {
    grid-template-columns: var(--sb-w, 264px) minmax(0, 1fr) minmax(280px, 400px);
  }
}
@media (max-width: 1024px) {
  [data-theme="cubox"] body[data-zone="todo"] .shell.panel-open:not(.capture-open) {
    grid-template-columns: var(--sb-w, 264px) minmax(0, 1fr) 0;
  }
}

/* ---------------- capture workspace: spans column 2 + column 3 ---------------- */
@media (min-width: 720px) {
  [data-theme="cubox"] .shell.capture-open {
    grid-template-columns: var(--sb-w, 264px) minmax(0, 1fr) !important;
  }
}
[data-theme="cubox"] .capture-card .cap-zones { background: var(--cx-gray-2); }
[data-theme="cubox"] .capture-card .cap-zone.active { color: var(--brand); }
[data-theme="cubox"] .capture-card .d-body::-webkit-scrollbar { width: 4px; }
