/* ============================================
   extra.css — Auth, Calendar, AI, Comments, Notifications
   New block types and database extras
   ============================================ */

/* -------- AUTH SCREEN -------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
}
.auth-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
}
.auth-blob-1 { width: 500px; height: 500px; background: #5b8def; top: -100px; left: -100px; animation: blob 20s infinite; }
.auth-blob-2 { width: 400px; height: 400px; background: #e96b6b; bottom: -50px; right: 10%; animation: blob 25s infinite reverse; }
.auth-blob-3 { width: 350px; height: 350px; background: #48bb78; top: 40%; right: -100px; animation: blob 22s infinite; }
@keyframes blob {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-50px) scale(1.1); }
  66% { transform: translate(-20px,20px) scale(0.95); }
}
[data-theme="dark"] .auth-blob { opacity: 0.25; }
.auth-container {
  position: relative; z-index: 1;
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15,15,15,0.15);
  padding: 36px 32px;
  width: 100%; max-width: 400px;
  backdrop-filter: blur(10px);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 50px; height: 50px;
  background: var(--text); color: var(--bg);
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; margin-bottom: 12px;
}
.auth-title { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.auth-sub { margin: 0; color: var(--text-2); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.auth-field input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px; color: var(--text);
  outline: none;
  transition: border-color .12s;
}
.auth-field input:focus { border-color: var(--primary); }
.auth-error {
  color: var(--danger); font-size: 13px;
  display: none; padding: 6px 10px; background: rgba(235,87,87,0.08);
  border-radius: 4px;
}
.auth-error:not(:empty) { display: block; }
.auth-btn {
  width: 100%; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s;
}
.auth-btn:hover { background: var(--hover); }
.auth-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-btn.primary:hover { background: var(--primary-hover); }
.auth-btn.social { margin-bottom: 8px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: var(--text-3); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-foot-link {
  text-align: center; margin: 12px 0 0;
  font-size: 13px; color: var(--text-2);
}
.auth-foot-link a { color: var(--primary); text-decoration: none; }
.auth-foot-link a:hover { text-decoration: underline; }
.auth-foot {
  position: relative; z-index: 1;
  text-align: center; padding: 16px;
  font-size: 12px; color: var(--text-3);
}

/* -------- WORKSPACE MENU -------- */
.wm-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
}
.wm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.wm-user-info { flex: 1; min-width: 0; }
.wm-user-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-user-email { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-label { padding: 6px 10px 4px; font-size: 11px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.wm-ws-icon { width: 22px; text-align: center; flex-shrink: 0; }
.wm-item.active { background: var(--hover-strong); }
.wm-item.danger { color: var(--danger); }
.wm-item.danger:hover { background: rgba(235,87,87,0.08); }

/* -------- TOPBAR BADGES -------- */
.tb-comment-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 999px;
  min-width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn { position: relative; }

/* -------- NEW BLOCK TYPES -------- */
.toggle-empty {
  color: var(--text-light); font-style: italic;
  padding: 4px 2px; cursor: pointer;
}
.toggle-empty:hover { color: var(--text-3); }

/* Image */
.block-image-wrap { margin: 0; }
.image-caption {
  font-size: 13px; color: var(--text-2); padding: 6px 2px;
  outline: none; min-height: 20px;
}

/* Video */
.block-video-wrap {
  width: 100%; border-radius: 4px; overflow: hidden;
  background: #000;
}
.block-video-wrap iframe, .block-video-wrap video {
  width: 100%; aspect-ratio: 16/9; display: block;
  border: none;
}

/* Audio */
.block-audio audio { width: 100%; }

/* File block */
.file-block {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none; color: var(--text);
  width: 100%;
  transition: background .12s;
}
.file-block:hover { background: var(--hover); }
.file-block .file-name { flex: 1; font-size: 14px; }
.file-block .file-size { font-size: 12px; color: var(--text-2); }

/* Embed */
.block-embed-wrap {
  width: 100%; border-radius: 4px; overflow: hidden;
}
.block-embed-wrap iframe { display: block; border: none; max-width: 100%; }

/* Math */
.math-display {
  padding: 16px; text-align: center;
  background: var(--bg-2); border-radius: 4px;
  font-family: 'Cambria', 'Times New Roman', serif;
  font-size: 18px; cursor: pointer;
  min-height: 40px;
  color: var(--text);
}
.math-display:hover { background: var(--hover); }
.block-math.editing .math-display { display: none; }
.block-math:not(.editing) .math-edit { display: none; }
.math-edit {
  font-family: var(--font-mono);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 10px;
  font-size: 13px;
}
.math-render { display: inline-block; }
.math-render .frac {
  display: inline-flex; flex-direction: column;
  vertical-align: middle;
  margin: 0 2px;
  font-size: 0.85em;
}
.math-render .frac .num {
  border-bottom: 1px solid currentColor;
  padding: 0 4px;
}
.math-render .frac .den { padding: 0 4px; }
.math-render .sqrt { display: inline-block; }
.math-render .sqrt-content {
  border-top: 1px solid currentColor;
  padding: 0 2px;
}
.math-render sup, .math-render sub { font-size: 0.7em; }
.math-empty { color: var(--text-3); font-style: italic; }

/* Page link */
.pl-row {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 3px;
  cursor: pointer; color: var(--text); text-decoration: none;
  font-weight: 500;
}
.pl-row:hover { background: var(--hover); text-decoration: underline; }
.pl-row.pl-create { color: var(--text-2); font-weight: 400; font-style: italic; }
.pl-title { text-decoration: underline; text-decoration-color: var(--text-3); }

/* Mention */
.mention-block {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px 1px 2px; background: var(--bg-2); border-radius: 999px;
  font-size: 13px; color: var(--text); font-weight: 500;
}
.mention-avatar {
  width: 18px; height: 18px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.mention-inline {
  background: var(--primary-soft); color: var(--primary);
  padding: 1px 6px; border-radius: 3px;
  font-weight: 500;
}
.page-mention {
  background: var(--bg-2); border-radius: 3px;
  padding: 1px 6px; color: var(--text); font-weight: 500;
  text-decoration: none;
}
.page-mention:hover { background: var(--hover); }

/* Bookmark input */
.bookmark-input {
  flex: 1; padding: 8px 12px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg-2);
  font-size: 14px; color: var(--text); outline: none;
}
.bookmark-input:focus { border-color: var(--primary); }

/* Block media empty */
.block-media-empty {
  width: 100%;
  background: var(--bg-2); border: 1px dashed var(--border-strong);
  border-radius: 6px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.bme-head {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 14px;
}
.bme-head svg { flex-shrink: 0; }
.bme-tabs { display: flex; gap: 4px; }
.bme-tab {
  background: transparent; border: none;
  padding: 4px 10px; border-radius: 4px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.bme-tab:hover { background: var(--hover); color: var(--text); }
.bme-tab.active { background: var(--hover-strong); color: var(--text); }
.bme-form { display: flex; flex-direction: column; gap: 8px; }
.unsplash-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  max-height: 280px; overflow-y: auto; margin-top: 8px;
}
.unsplash-grid img {
  width: 100%; height: 70px; object-fit: cover;
  border-radius: 4px; cursor: pointer;
  transition: transform .15s;
}
.unsplash-grid img:hover { transform: scale(1.02); outline: 2px solid var(--primary); }

/* Simple table */
.simple-table-wrap { margin: 4px 0; }
.simple-table {
  border-collapse: collapse; width: max-content; min-width: 100%;
  font-size: 14px;
}
.simple-table th, .simple-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  min-width: 100px;
  vertical-align: top;
  outline: none;
}
.simple-table th {
  background: var(--bg-2);
  font-weight: 500;
  color: var(--text-2);
  font-size: 13px;
}
.simple-table td:focus, .simple-table th:focus {
  background: var(--primary-soft);
}
.st-actions { display: flex; gap: 4px; padding: 6px 0; }
.st-btn {
  background: transparent; border: 1px dashed var(--border);
  padding: 4px 10px; border-radius: 4px;
  color: var(--text-2); font-size: 12px;
}
.st-btn:hover { background: var(--hover); color: var(--text); }

/* TOC */
.toc-block {
  background: var(--bg-2); border-radius: 4px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.toc-item {
  cursor: pointer; padding: 4px 0;
  color: var(--text); text-decoration: none;
  font-size: 14px;
}
.toc-item:hover { text-decoration: underline; }
.toc-h1 { padding-left: 0; font-weight: 500; }
.toc-h2 { padding-left: 16px; }
.toc-h3 { padding-left: 32px; font-size: 13px; color: var(--text-2); }

/* Breadcrumb block */
.breadcrumb-block {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2);
  padding: 4px 0;
}
.bc-item-block {
  cursor: pointer; padding: 2px 6px; border-radius: 3px;
}
.bc-item-block:hover { background: var(--hover); color: var(--text); }
.bc-sep { color: var(--text-3); }

/* Sync block */
.sync-block {
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary-soft);
  padding: 8px;
}
.sync-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--primary);
  margin-bottom: 6px; padding: 0 4px;
}
.sync-meta { font-size: 11px; }
.sync-inner { background: var(--bg); border-radius: 3px; padding: 4px; }

/* Action button */
.action-button {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 16px; border-radius: 4px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
}
.action-button:hover { background: var(--primary-hover); }
.button-label {
  font-size: 12px; color: var(--text-3);
  padding: 4px 0; outline: none;
}

/* Code block extras */
.code-actions { display: flex; gap: 4px; }
.code-action {
  background: transparent; border: none;
  color: var(--text-2); font-size: 12px;
  padding: 2px 6px; border-radius: 3px;
  cursor: pointer;
}
.code-action:hover { background: var(--hover); color: var(--text); }

/* Block comment badge */
.block-comment-badge {
  position: absolute; top: 4px; right: -8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px; font-size: 11px; color: var(--text-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  box-shadow: var(--shadow-sm);
}
.block-comment-badge:hover { background: var(--hover); color: var(--text); }

/* -------- COMMENTS POPOVER -------- */
.comments-popover {
  position: absolute; z-index: 100;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 360px; max-height: 480px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.comments-list {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
  max-height: 320px;
}
.comments-empty {
  padding: 24px 16px; text-align: center;
  color: var(--text-2); font-size: 13px;
}
.comment-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-item.resolved { opacity: 0.5; }
.comment-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.comment-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comment-name { font-size: 13px; font-weight: 500; }
.comment-time { font-size: 11px; color: var(--text-3); }
.comment-more {
  margin-left: auto; background: transparent; border: none;
  color: var(--text-2); padding: 0 6px; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.comment-body {
  font-size: 14px; line-height: 1.4;
  margin-left: 30px; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.comment-actions {
  display: flex; gap: 4px;
  margin-left: 30px; margin-top: 6px;
}
.comment-act {
  background: transparent; border: none;
  color: var(--text-2); font-size: 12px;
  padding: 2px 6px; border-radius: 3px; cursor: pointer;
}
.comment-act:hover { background: var(--hover); color: var(--text); }
.comment-replies {
  margin-left: 30px; margin-top: 8px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
}
.comment-reply { margin-bottom: 8px; }
.comments-compose {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}
.comment-input {
  width: 100%; padding: 6px 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px; color: var(--text);
  outline: none; resize: none;
  font-family: inherit;
}
.comment-input:focus { border-color: var(--primary); }
.comments-btns {
  display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px;
}

/* -------- AI PANEL -------- */
.ai-panel {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 100px;
}
.ai-overlay {
  position: absolute; inset: 0;
  background: rgba(15,15,15,0.5); backdrop-filter: blur(4px);
}
.ai-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.06);
  width: 640px; max-width: 95vw;
  max-height: 70vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ai-logo { display: none; }
.ai-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 15px; color: var(--text);
  padding: 6px 4px;
}
.ai-input::placeholder { color: var(--text-3); }
.ai-provider-badge {
  font-size: 11px; padding: 4px 10px; border-radius: 99px;
  background: var(--bg-2); color: var(--text-3);
  border: 1px solid var(--border);
  letter-spacing: 0.3px; flex-shrink: 0;
}
.ai-provider-badge.real {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.ai-config, .ai-close {
  background: transparent; border: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  color: var(--text-3);
  transition: background 0.12s ease, color 0.12s ease;
  flex-shrink: 0; padding: 0;
}
.ai-config:hover, .ai-close:hover {
  background: var(--bg-2); color: var(--text);
}
.ai-config svg, .ai-close svg { width: 14px; height: 14px; }

.ai-quick {
  padding: 12px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ai-action {
  background: var(--bg); border: 1px solid var(--border);
  padding: 7px 12px 7px 10px; border-radius: 999px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  font-weight: 500;
}
.ai-action:hover {
  background: var(--bg-2); color: var(--text);
  border-color: var(--text-3);
  transform: translateY(-1px);
}
.ai-action-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); flex-shrink: 0;
}
.ai-action:hover .ai-action-icon { color: var(--text); }
.ai-action-icon svg { width: 14px; height: 14px; }
.ai-output {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-loading {
  text-align: center; padding: 40px 0;
  color: var(--text-2); font-size: 14px;
}
.ai-loading span::after {
  content: ''; animation: dots 1.4s infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}
.ai-result-head {
  font-size: 12px; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.ai-result-body {
  background: var(--bg-2); border-radius: 6px;
  padding: 14px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap;
  border-left: 3px solid var(--primary);
}
.ai-result-actions { display: flex; gap: 8px; }

/* -------- NOTIFICATIONS DROPDOWN -------- */
.notif-dropdown {
  position: absolute; z-index: 95;
  width: 360px; max-height: 400px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: var(--primary-soft); }
.notif-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 6px;
}
.notif-body { flex: 1; }
.notif-body > div:first-child { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.notif-time { font-size: 11px; color: var(--text-3); }
.btn-link {
  background: transparent; border: none;
  color: var(--primary); font-size: 12px;
  padding: 0; cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* -------- INBOX VIEW -------- */
.inbox-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.inbox-item:hover { background: var(--hover); }
.inbox-item.unread { background: var(--primary-soft); }

/* -------- DATABASE EXTRAS -------- */
.db-header {
  margin-bottom: 6px;
}
.db-name {
  background: transparent; border: none; outline: none;
  font-size: 22px; font-weight: 700; color: var(--text);
  width: 100%; padding: 4px 0;
}

.db-tool-btn {
  background: transparent; border: none;
  padding: 4px 8px; border-radius: 3px;
  color: var(--text-2); font-size: 12.5px;
  cursor: pointer;
}
.db-tool-btn:hover { background: var(--hover); color: var(--text); }
.db-tool-btn.primary { color: var(--primary); font-weight: 500; }

.db-th-head {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.db-th-head:hover { color: var(--text); }
.db-th-icon { color: var(--text-3); font-size: 11px; }
.db-th-add { width: 36px; }
.db-add-col-btn {
  width: 100%; padding: 4px 0;
  background: transparent; border: none;
  color: var(--text-3); cursor: pointer;
  border-radius: 3px;
}
.db-add-col-btn:hover { background: var(--hover); color: var(--text-2); }

.cell-input {
  background: transparent; border: none; outline: none;
  width: 100%; font: inherit; color: inherit;
}
.cell-edit {
  outline: none;
  min-height: 22px;
}
.cell-edit:focus { background: var(--primary-soft); }
.cell-title { font-weight: 500; }

.db-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px;
  font-size: 12px; color: var(--text);
}
.db-status .status-dot { font-size: 8px; }

.db-tags { display: flex; flex-wrap: wrap; gap: 3px; }

.db-people { display: flex; gap: 2px; }
.person-chip {
  width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.db-row-actions {
  text-align: center; cursor: pointer;
  color: var(--text-3); width: 32px;
}
.db-row-actions:hover { color: var(--text); }

.db-calc-bar {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.db-calc-cell {
  flex: 1;
  padding: 4px 8px;
  border-right: 1px solid var(--border);
}
.db-calc-cell:last-child { border-right: none; }

/* Cards general */
.db-board-card .card-title { font-weight: 500; font-size: 14px; }
.card-prop { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.group-count {
  margin-left: auto; color: var(--text-3); font-size: 12px;
}
.db-board-col.drag-over { outline: 2px solid var(--primary); }

.db-empty {
  padding: 24px; text-align: center;
  color: var(--text-2); font-size: 13px;
}

/* List view */
.db-list { display: flex; flex-direction: column; }
.db-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.db-list-item:hover { background: var(--hover); }
.list-title { font-size: 14px; font-weight: 500; flex-shrink: 0; }
.list-props { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.list-prop { font-size: 12px; color: var(--text-2); }

/* Timeline view */
.db-timeline { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.tl-item {
  display: flex; gap: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  border-left: 3px solid var(--primary);
}
.tl-item:hover { background: var(--hover); }
.tl-date {
  width: 70px; flex-shrink: 0;
  font-size: 12px; font-weight: 500;
  color: var(--text-2); text-transform: uppercase;
}
.tl-content { flex: 1; }
.tl-title { font-size: 14px; font-weight: 500; }
.tl-source { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Calendar (in database + standalone) */
.db-calendar, .view-calendar {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 6px;
}
.view-calendar { max-width: 1100px; margin: 0 auto; padding: 40px 64px 200px; }
.cal-page-head { margin-bottom: 12px; }
.cal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.cal-title {
  flex: 1; font-size: 18px; font-weight: 600;
}
.cal-nav {
  background: transparent; border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.cal-nav:hover { background: var(--hover); }
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11px; color: var(--text-2); font-weight: 500;
  padding: 4px 0;
}
.cal-dow > div {
  padding: 4px 6px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}
.cal-grid.big .cal-cell { min-height: 110px; }
.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 80px;
  padding: 4px 6px;
  position: relative;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--hover); }
.cal-cell.empty { background: var(--bg-2); cursor: default; }
.cal-cell.today {
  background: var(--primary-soft);
}
.cal-cell.today .cal-day {
  color: var(--primary); font-weight: 700;
}
.cal-day {
  font-size: 12px; color: var(--text-2);
  font-weight: 500;
}
.cal-event {
  background: var(--bg-blue); color: var(--c-blue);
  border-radius: 3px;
  padding: 2px 6px; font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event:hover { filter: brightness(0.95); }
.cal-upcoming { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }

/* -------- ROW DETAIL MODAL -------- */
.row-detail-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 700px; max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
}
.row-detail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.row-detail-title {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 22px; font-weight: 600; color: var(--text);
}
.row-close {
  background: transparent; border: none;
  color: var(--text-2); font-size: 22px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer;
}
.row-close:hover { background: var(--hover); color: var(--text); }
.row-detail-props {
  padding: 12px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.row-prop {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 12px; align-items: start;
  padding: 4px 0;
}
.prop-label { font-size: 13px; color: var(--text-2); padding-top: 4px; }
.prop-value { font-size: 14px; }
.prop-value td {
  padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  display: block;
  background: var(--bg);
}

/* -------- HISTORY MODAL -------- */
.history-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 92vw; max-width: 1100px;
  height: 80vh; max-height: 700px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.history-head h2 { margin: 0; font-size: 18px; }
.history-list { overflow-y: auto; flex: 1; }
.history-item {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.hi-time { font-size: 14px; font-weight: 500; }
.hi-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; grid-column: 1; }

/* -------- MENTION PICKER (small popup) -------- */
.mention-picker .cm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 3px; cursor: pointer;
  font-size: 13px;
}
.mention-picker .cm-item:hover { background: var(--hover); }

/* -------- COLOR MENU (extra) -------- */
.cm-input {
  width: 100%; padding: 4px 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px;
  outline: none; color: var(--text);
}
.cm-input:focus { border-color: var(--primary); }

/* -------- PRINT -------- */
@media print {
  .sidebar, .topbar, .block-handle, .page-controls, #format-toolbar,
  .block-comment-badge, #ai-panel, #search-modal, #settings-modal,
  #share-modal, #templates-modal, #history-modal, #row-detail-modal,
  #notif-dropdown, #emoji-picker, #cover-picker, #context-menu,
  #slash-menu, #color-menu, #turn-menu, #block-menu, #workspace-menu,
  .sidebar-show {
    display: none !important;
  }
  .main { width: 100% !important; }
  body { overflow: visible !important; }
  .editor-scroll { overflow: visible !important; }
  .page-wrap { padding: 0 32px !important; max-width: none !important; }
}

/* -------- SETTINGS NEW ELEMENTS -------- */
.settings-row .sr-control input[type="text"] {
  min-width: 220px;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 720px) {
  .ai-card { width: 95vw; }
  .auth-card { padding: 24px 20px; }
  .row-detail-card { width: 95vw; }
  .row-prop { grid-template-columns: 1fr; gap: 4px; }
  .prop-label { padding-top: 0; }
  .view-calendar { padding: 16px; }
  .cal-cell { min-height: 60px; }
  .cal-grid.big .cal-cell { min-height: 80px; }
}


/* ============================================
   CHARTS
   ============================================ */
.chart-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  margin: 4px 0;
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.chart-title {
  background: transparent; border: none; outline: none;
  font-size: 16px; font-weight: 600; color: var(--text);
  flex: 1;
}
.chart-settings-btn {
  background: transparent; border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px;
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
.chart-settings-btn:hover { background: var(--hover); color: var(--text); }
.chart-body {
  display: flex; flex-direction: column; gap: 8px;
  align-items: stretch;
}
.chart-svg {
  width: 100%; height: auto;
  display: block;
}
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center;
  font-size: 12.5px; color: var(--text-2);
  padding: 4px;
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
}

@keyframes chart-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes chart-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes chart-fade {
  from { opacity: 0; }
  to   { opacity: 0.95; }
}

/* Chart settings modal */
.chart-settings-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: 95vw; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.chart-settings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.chart-settings-head h2 { margin: 0; font-size: 18px; }
.chart-settings-body {
  padding: 16px 18px; overflow-y: auto;
}
.cs-row {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 10px; align-items: center; margin-bottom: 10px;
}
.cs-row label { font-size: 13px; color: var(--text-2); }
.cs-row input[type="text"], .cs-row select {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 5px 8px; font-size: 13px;
  outline: none; color: var(--text);
}
.cs-help { font-size: 12px; color: var(--text-3); margin: -2px 0 6px; }
.cs-textarea {
  width: 100%; padding: 8px; font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); outline: none;
  resize: vertical;
}
.cs-textarea:focus { border-color: var(--primary); }
.cs-series {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 10px; margin-bottom: 8px;
}
.cs-series-head {
  display: flex; gap: 6px; margin-bottom: 6px;
}
.cs-series-head input[type="text"] {
  flex: 1; padding: 4px 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; outline: none; color: var(--text);
}
.cs-series-head input[type="color"] {
  width: 32px; height: 28px; padding: 0; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; background: transparent;
}

/* ============================================
   MERMAID
   ============================================ */
.mermaid-wrap {
  width: 100%; margin: 4px 0;
}
.mermaid-display {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 16px; cursor: pointer;
  text-align: center;
  min-height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.mermaid-display svg { max-width: 100%; height: auto; }
.mermaid-display:hover { background: var(--hover); }
.mermaid-loading, .mermaid-empty {
  color: var(--text-3); font-style: italic; padding: 16px;
}
.mermaid-error {
  color: var(--danger); font-family: var(--font-mono); font-size: 12px;
  padding: 12px; text-align: left; white-space: pre-wrap;
}
.block-mermaid.editing .mermaid-display { display: none; }
.block-mermaid:not(.editing) .mermaid-edit { display: none; }
.mermaid-edit {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px;
  white-space: pre-wrap;
}

/* ============================================
   AUDIO RECORDER
   ============================================ */
.audio-rec-wrap { width: 100%; }
.audio-recorder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px;
  background: var(--bg-2); border: 1px dashed var(--border-strong);
  border-radius: 6px;
}
.rec-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: #e96b6b; color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s, box-shadow .1s;
}
.rec-btn:hover { transform: scale(1.05); }
.rec-btn.recording {
  background: #d44c47;
  animation: rec-pulse 1.4s infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,76,71,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(212,76,71,0); }
}
.rec-timer {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 500;
  color: var(--text);
}
.rec-status { font-size: 12px; color: var(--text-2); }
.audio-duration {
  font-size: 11px; color: var(--text-2); margin-top: 4px;
}

/* ============================================
   EXPORT MODAL
   ============================================ */
.export-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 600px; max-width: 95vw;
  display: flex; flex-direction: column; overflow: hidden;
}
.export-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.export-head h2 { margin: 0; font-size: 18px; }
.export-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 18px;
}
.export-fmt {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 16px;
  cursor: pointer; text-align: center;
  transition: background .12s, transform .12s;
}
.export-fmt:hover {
  background: var(--hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.ef-icon { font-size: 28px; margin-bottom: 6px; }
.ef-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ef-desc { font-size: 11px; color: var(--text-2); line-height: 1.4; }
.export-options {
  display: flex; gap: 14px; padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 13px;
}
.export-options label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}

/* ============================================
   GOOGLE AUTH OVERLAY
   ============================================ */
.google-auth-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.google-auth-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px; min-width: 320px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.google-auth-card h3 { margin: 0 0 14px; font-size: 16px; }

/* Math display tweaks for KaTeX */
.math-display .katex { font-size: 1.05em; }
.math-display .katex-display { margin: 0; }

/* Print improvements */
@media print {
  .auth-screen { display: none !important; }
  .editor-bottom-space { display: none !important; }
}

/* Status badge for Google config */
.status-pill {
  display: inline-block; padding: 1px 8px;
  border-radius: 999px; font-size: 11px;
}


/* ============================================
   FIX: iframes/embeds blocking page interaction
   ============================================ */
.block-video-wrap, .block-embed-wrap {
  position: relative;
  overflow: hidden;
}
/* When the block is not focused/active, prevent iframe from capturing clicks
   that should reach the block container (for handle, drag, etc) */
.block-video-wrap iframe, .block-embed-wrap iframe {
  pointer-events: auto;
}
/* Allow the user to click on a video by giving the iframe pointer events,
   but the block container has to provide a way to "exit" — we add a small click area */
.block-video, .block-embed {
  position: relative;
}
.block-video::after, .block-embed::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px; height: 8px;
  pointer-events: auto;
  cursor: text;
}

/* Allow text selection in bookmark info areas without triggering navigation
   on the parent <a> until explicit click on title */
.bookmark { display: flex; }

/* ============================================
   PLACEHOLDER REFINEMENTS
   ============================================ */
/* Show subtle hint only on the actively focused empty paragraph */
.block-p .editable[data-empty="true"][data-focused="true"]::before {
  color: var(--text-light);
  opacity: 0.7;
}
/* Headings: lighter placeholder */
.block-h1 .editable[data-empty="true"][data-focused="true"]::before,
.block-h2 .editable[data-empty="true"][data-focused="true"]::before,
.block-h3 .editable[data-empty="true"][data-focused="true"]::before {
  opacity: 0.4;
}


/* ============================================
   GRAPH VIEW (Obsidian-like)
   ============================================ */
.graph-view {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 24px 32px;
}
.graph-head { margin-bottom: 12px; }
.graph-head h1 { margin: 0; font-size: 24px; }
.graph-sub { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }

.graph-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.graph-tool-btn {
  background: transparent; border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.graph-tool-btn:hover { background: var(--hover); }
.graph-tool-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.graph-tool-btn:active { transform: scale(0.96); }
.graph-spacer { flex: 1; }

.graph-controls {
  display: flex; gap: 16px; flex-wrap: wrap;
  align-items: center;
}
.g-slider { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.g-slider label { font-size: 11px; color: var(--text-2); }
.g-slider input[type="range"] {
  width: 110px; accent-color: var(--primary);
}

.graph-stage {
  flex: 1; min-height: 500px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: grab;
}
.graph-stage:active { cursor: grabbing; }
.graph-canvas-2d {
  display: block; width: 100%; height: 100%;
}
.graph-loading {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--text-2); font-size: 14px;
}

/* ============================================
   MERMAID EDITOR
   ============================================ */
.mermaid-editor-card {
  position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 92vw; max-width: 1100px; height: 80vh; max-height: 700px;
  display: flex; flex-direction: column; overflow: hidden;
}
.me-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.me-head h2 { margin: 0; font-size: 18px; }
.me-body {
  display: grid; grid-template-columns: 380px 1fr;
  flex: 1; overflow: hidden; min-height: 0;
}
.me-left {
  border-right: 1px solid var(--border);
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--bg-2);
}
.me-left h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text-2); margin: 14px 0 8px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.me-row {
  display: grid; grid-template-columns: 60px 1fr; gap: 8px;
  align-items: center; margin-bottom: 8px;
}
.me-row label { font-size: 13px; color: var(--text-2); }
.me-row select, .me-row input[type="text"] {
  padding: 5px 8px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; outline: none; color: var(--text);
}
.me-list {
  display: flex; flex-direction: column; gap: 6px;
}
.me-item {
  display: flex; gap: 4px; align-items: center;
  padding: 6px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 4px;
}
.me-item input[type="text"], .me-item select {
  padding: 4px 6px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 3px; color: var(--text); outline: none;
}
.me-del {
  background: transparent; border: none; cursor: pointer;
  color: var(--danger); font-size: 16px; line-height: 1;
  padding: 0 4px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.me-del:hover { background: rgba(235,87,87,0.1); }
.me-add-btn {
  width: 100%; padding: 6px;
  background: transparent; border: 1px dashed var(--border-strong);
  border-radius: 4px; color: var(--text-2); cursor: pointer;
  font-size: 12.5px; margin-top: 6px;
  transition: background 0.12s, color 0.12s;
}
.me-add-btn:hover { background: var(--hover); color: var(--text); }
.me-code {
  width: 100%; min-height: 140px;
  padding: 10px; font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; outline: none; color: var(--text);
  resize: vertical;
}
.me-right {
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow: auto;
}
.me-preview {
  width: 100%; min-height: 300px;
  display: flex; align-items: center; justify-content: center;
}
.me-preview svg { max-width: 100%; height: auto; }
.me-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.mermaid-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 8px;
}
.mermaid-head-title { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ============================================
   ROW DETAIL diff view
   ============================================ */

/* History diff view */
.history-diff {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 20px;
  flex: 1; overflow: auto;
  font-size: 13px; line-height: 1.5;
}
.diff-col {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  overflow: auto;
}
.diff-col h4 {
  margin: 0 0 10px;
  font-size: 13px; color: var(--text-2);
  font-weight: 600;
}
.diff-line { padding: 2px 4px; border-radius: 3px; }
.diff-line.added { background: rgba(72,187,120,0.15); color: #166534; }
.diff-line.removed { background: rgba(235,87,87,0.15); color: #991b1b; text-decoration: line-through; }
.diff-line.modified { background: rgba(213,182,49,0.18); }
[data-theme="dark"] .diff-line.added { color: #86efac; }
[data-theme="dark"] .diff-line.removed { color: #fca5a5; }

/* AI provider badge */
.ai-provider-badge {
  font-size: 10px; padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-2); color: var(--text-2);
  border: 1px solid var(--border);
  text-transform: uppercase; font-weight: 600;
  letter-spacing: 0.04em;
}
.ai-provider-badge.real {
  background: rgba(72,187,120,0.15); color: #166534; border-color: transparent;
}
[data-theme="dark"] .ai-provider-badge.real { color: #86efac; }
.ai-config {
  background: transparent; border: none; color: var(--text-2);
  font-size: 16px; cursor: pointer;
  width: 28px; height: 28px; border-radius: 4px;
}
.ai-config:hover { background: var(--hover); color: var(--text); }


.history-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.history-item:hover { background: var(--hover); }
.history-item.active { background: var(--primary-soft); }


.inline-cal-block {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin: 4px 0;
}
