/* =========================================================
   DreamDoc - Design System
   Tailwind-compatible custom CSS variables
   Po portu do Laravelu: prenest do resources/css/app.css
   + tailwind.config.js (theme extend)
   ========================================================= */

:root {
  /* === Brand === */
  --c-brand-50:  #eef2ff;
  --c-brand-100: #e0e7ff;
  --c-brand-200: #c7d2fe;
  --c-brand-300: #a5b4fc;
  --c-brand-400: #818cf8;
  --c-brand-500: #6366f1;
  --c-brand-600: #4f46e5;   /* primary */
  --c-brand-700: #4338ca;
  --c-brand-800: #3730a3;
  --c-brand-900: #312e81;

  --c-violet-500: #8b5cf6;
  --c-violet-600: #7c3aed;  /* gradient end */

  /* === Semantic === */
  --c-bg:        #ffffff;
  --c-bg-soft:   #f9fafb;
  --c-bg-mute:   #f3f4f6;
  --c-bg-code:   #0d1117;   /* dark code blocks (DreamDoc signature) */

  --c-border:        #e5e7eb;
  --c-border-strong: #d1d5db;

  --c-text:        #111827;
  --c-text-soft:   #4b5563;
  --c-text-mute:   #9ca3af;
  --c-text-invert: #f9fafb;

  --c-link:       var(--c-brand-600);
  --c-link-hover: var(--c-brand-700);

  /* === Section pastels (DreamDoc signature) === */
  --c-team-bg:    #fef3c7; --c-team-fg:    #92400e;  /* amber */
  --c-spec-bg:    #dbeafe; --c-spec-fg:    #1e3a8a;  /* blue */
  --c-arch-bg:    #ede9fe; --c-arch-fg:    #5b21b6;  /* violet */
  --c-api-bg:     #cffafe; --c-api-fg:     #155e75;  /* cyan */
  --c-deploy-bg:  #d1fae5; --c-deploy-fg:  #065f46;  /* emerald */
  --c-meet-bg:    #ffedd5; --c-meet-fg:    #9a3412;  /* orange */
  --c-crisis-bg: #fee2e2; --c-crisis-fg:  #991b1b;  /* red */
  --c-diary-bg:   #fce7f3; --c-diary-fg:   #9d174d;  /* pink (AI) */
  --c-backup-bg:  #f3e8ff; --c-backup-fg:  #6b21a8;  /* purple (AI) */
  --c-public-bg:  #ecfccb; --c-public-fg:  #3f6212;  /* lime */

  /* === States === */
  --c-success: #16a34a;
  --c-warning: #f59e0b;
  --c-danger:  #dc2626;
  --c-info:    var(--c-brand-600);

  /* === Layout === */
  --w-sidebar: 280px;
  --w-meta:    320px;
  --h-header:  56px;

  /* === Typo === */
  --f-sans: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* === Radii === */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* === Shadows (decentni, Redoc pristup) === */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);

  /* === Transitions === */
  --t-fast: 0.12s ease;
  --t-base: 0.18s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; }

a { color: var(--c-link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-link-hover); }

button { font: inherit; cursor: pointer; border: 0; background: transparent; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--c-brand-100); color: var(--c-brand-900); }

/* === Utility === */
.dd-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.dd-row { display: flex; }
.dd-col { display: flex; flex-direction: column; }
.dd-spacer { flex: 1; }

/* === Header === */
.dd-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: var(--h-header);
  padding: 0 20px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.dd-header__logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--c-text);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.dd-header__logo-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c-brand-600), var(--c-violet-600));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.dd-header__logo-mark svg { width: 16px; height: 16px; }

.dd-header__nav { display: flex; gap: 4px; }
.dd-header__nav a {
  padding: 6px 12px; border-radius: var(--r-sm);
  color: var(--c-text-soft); font-weight: 500;
}
.dd-header__nav a:hover { background: var(--c-bg-soft); color: var(--c-text); }
.dd-header__nav a.is-active { background: var(--c-brand-50); color: var(--c-brand-700); }

.dd-cmd-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-mute);
  font-size: 13px;
  min-width: 240px;
  transition: all var(--t-fast);
}
.dd-cmd-trigger:hover { background: var(--c-bg-mute); border-color: var(--c-border-strong); }
.dd-cmd-trigger kbd {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-text-soft);
}

.dd-icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  color: var(--c-text-soft);
  transition: all var(--t-fast);
}
.dd-icon-btn:hover { background: var(--c-bg-soft); color: var(--c-text); }
.dd-icon-btn.has-badge::after {
  content: ''; position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-danger);
  top: 6px; right: 6px;
  border: 2px solid var(--c-bg);
}

.dd-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-brand-600), var(--c-violet-600));
  color: #fff;
  font-weight: 600; font-size: 12px;
  cursor: pointer;
}

/* === App layout === */
.dd-app {
  display: grid;
  grid-template-columns: var(--w-sidebar) 1fr var(--w-meta);
  min-height: calc(100vh - var(--h-header));
}
.dd-app--no-meta { grid-template-columns: var(--w-sidebar) 1fr; }

/* === Sidebar (page tree) === */
.dd-sidebar {
  border-right: 1px solid var(--c-border);
  padding: 12px 0 80px;
  overflow-y: auto;
  position: sticky; top: var(--h-header);
  height: calc(100vh - var(--h-header));
  background: var(--c-bg);
  /* Scrollbar uplne schovan (macOS "Always show" override) — user scrolluje koleckem/touchpadem/klavesami */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* Edge legacy */
}
.dd-sidebar::-webkit-scrollbar { display: none; }  /* Chrome/Safari/Webkit */

.dd-workspace-pill {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dd-workspace-pill:hover { background: var(--c-bg-mute); }
.dd-workspace-pill__avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--c-brand-100);
  color: var(--c-brand-700);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.dd-workspace-pill__name { flex: 1; font-weight: 600; font-size: 13px; }
.dd-workspace-pill__chev { color: var(--c-text-mute); font-size: 11px; }

/* Tree */
.dd-tree { list-style: none; margin: 0; padding: 0 0 8px; }
.dd-tree__row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 14px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  border-left: 2px solid transparent;
  position: relative;
  transition: background var(--t-fast);
}
.dd-tree__row:hover { background: var(--c-bg-soft); }
.dd-tree__row.is-active {
  background: var(--c-brand-50);
  color: var(--c-brand-800);
  font-weight: 600;
  border-left-color: var(--c-brand-600);
}
.dd-tree__chev {
  width: 14px; flex-shrink: 0;
  color: var(--c-text-mute);
  font-size: 9px;
  display: grid; place-items: center;
  transition: transform var(--t-fast);
}
.dd-tree__row.is-open > .dd-tree__chev { transform: rotate(90deg); }
.dd-tree__icon {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.dd-tree__label {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-tree__count {
  font-size: 11px;
  color: var(--c-text-mute);
  font-weight: 500;
  background: var(--c-bg-mute);
  padding: 1px 6px;
  border-radius: 8px;
}
.dd-tree__row.is-active .dd-tree__count { background: var(--c-brand-100); color: var(--c-brand-700); }

.dd-tree--nested {
  list-style: none; margin: 0;
  padding-left: 24px;
  border-left: 1px dashed var(--c-border);
  margin-left: 22px;
}
.dd-tree--nested .dd-tree__row { padding-left: 8px; }

/* Sidebar section heading */
.dd-side-heading {
  padding: 10px 16px 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-text-mute);
}

/* === Main content === */
.dd-main {
  padding: 32px 48px 80px;
  max-width: 920px; width: 100%;
  position: relative;
}

/* Section accent strip - DreamDoc signature */
.dd-main::before {
  content: '';
  position: absolute;
  left: 0; top: 32px; bottom: 80px;
  width: 3px;
  background: var(--accent, var(--c-brand-600));
  border-radius: 2px;
}

.dd-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--c-text-soft);
  margin-bottom: 12px;
}
.dd-breadcrumb a { color: var(--c-text-soft); }
.dd-breadcrumb a:hover { color: var(--c-text); }
.dd-breadcrumb .sep { color: var(--c-text-mute); }

.dd-page-title {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
  color: var(--c-text);
  line-height: 1.2;
}

.dd-page-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--c-text-soft);
}
.dd-page-meta .sep { color: var(--c-text-mute); }

.dd-prose h2 {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}
.dd-prose h2:first-child { border-top: 0; padding-top: 0; }
.dd-prose h3 {
  font-size: 16px; font-weight: 600;
  margin: 20px 0 8px;
}
.dd-prose p { margin: 8px 0; }
.dd-prose ul, .dd-prose ol { margin: 8px 0 8px 24px; }
.dd-prose code:not(pre code) {
  background: var(--c-bg-mute);
  padding: 2px 6px; border-radius: 4px;
  font-family: var(--f-mono); font-size: 12.5px;
  color: var(--c-brand-700);
}

/* === Pastel chips (sekce) === */
.dd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.dd-chip--ghost { background: var(--c-bg-soft); color: var(--c-text-soft); border: 1px solid var(--c-border); }
.dd-chip--team   { background: var(--c-team-bg);   color: var(--c-team-fg); }
.dd-chip--spec   { background: var(--c-spec-bg);   color: var(--c-spec-fg); }
.dd-chip--arch   { background: var(--c-arch-bg);   color: var(--c-arch-fg); }
.dd-chip--api    { background: var(--c-api-bg);    color: var(--c-api-fg); }
.dd-chip--deploy { background: var(--c-deploy-bg); color: var(--c-deploy-fg); }
.dd-chip--meet   { background: var(--c-meet-bg);   color: var(--c-meet-fg); }
.dd-chip--crisis { background: var(--c-crisis-bg); color: var(--c-crisis-fg); }
.dd-chip--diary  { background: var(--c-diary-bg);  color: var(--c-diary-fg); }
.dd-chip--backup { background: var(--c-backup-bg); color: var(--c-backup-fg); }
.dd-chip--public { background: var(--c-public-bg); color: var(--c-public-fg); }
.dd-chip--ai     { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #9d174d; }

/* === Cards === */
.dd-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: all var(--t-fast);
}
.dd-card:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-sm); }
.dd-card__title {
  font-weight: 600;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.dd-card__sub { font-size: 12px; color: var(--c-text-soft); }

/* === Code block (DreamDoc signature - dark) === */
.dd-code {
  margin: 16px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-bg-code);
  border: 1px solid #1e2632;
}
.dd-code__head {
  display: flex; align-items: center;
  padding: 8px 14px;
  background: #161c25;
  border-bottom: 1px solid #1e2632;
  font-family: var(--f-mono); font-size: 11.5px;
  color: #8b949e;
}
.dd-code__head .copy {
  margin-left: auto;
  color: #8b949e; font-family: var(--f-sans);
  font-size: 11px;
  padding: 3px 8px; border-radius: 4px;
  cursor: pointer;
}
.dd-code__head .copy:hover { background: #1e2632; color: #c9d1d9; }
.dd-code pre {
  margin: 0;
  padding: 16px;
  font-family: var(--f-mono);
  font-size: 12.5px; line-height: 1.7;
  color: #c9d1d9;
  overflow-x: auto;
}
.tok-key { color: #ff7b72; }
.tok-str { color: #a5d6ff; }
.tok-num { color: #79c0ff; }
.tok-com { color: #8b949e; font-style: italic; }
.tok-fn  { color: #d2a8ff; }
.tok-var { color: #ffa657; }

/* === Block editor (TipTap-like) preview === */
.dd-editor {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px 32px;
  min-height: 400px;
  background: var(--c-bg);
}
.dd-editor__toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--c-bg-soft);
  margin-top: 16px;
}
.dd-editor__toolbar + .dd-editor { border-radius: 0 0 var(--r-lg) var(--r-lg); margin-top: 0; }
.dd-tool-btn {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--c-text-soft);
  font-size: 12px; font-weight: 600;
  font-family: var(--f-mono);
  transition: all var(--t-fast);
}
.dd-tool-btn:hover { background: var(--c-bg-mute); color: var(--c-text); }
.dd-tool-btn.is-active { background: var(--c-brand-100); color: var(--c-brand-700); }
.dd-tool-sep { width: 1px; background: var(--c-border); margin: 4px 6px; }

/* === Block (in editor) === */
.dd-block {
  position: relative;
  padding: 6px 0;
}
.dd-block:hover { background: var(--c-bg-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 4px; }

/* === Mermaid placeholder === */
.dd-mermaid {
  margin: 16px 0;
  padding: 20px;
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-bg-soft);
  text-align: center;
  color: var(--c-text-soft);
  font-family: var(--f-mono); font-size: 13px;
}
.dd-mermaid svg { margin: 0 auto; }

/* === Meta panel (right column) === */
.dd-meta {
  border-left: 1px solid var(--c-border);
  padding: 24px 20px 80px;
  position: sticky; top: var(--h-header);
  height: calc(100vh - var(--h-header));
  overflow-y: auto;
  font-size: 13px;
}
.dd-meta__block { margin-bottom: 28px; }
.dd-meta__title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-text-mute);
  margin-bottom: 10px;
}
.dd-meta__list { list-style: none; margin: 0; padding: 0; }
.dd-meta__list li {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--c-border);
}
.dd-meta__list li:last-child { border-bottom: 0; }
.dd-meta__list li > span:last-child { color: var(--c-text-soft); }

/* === Activity feed === */
.dd-activity__item {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
}
.dd-activity__item:last-child { border-bottom: 0; }
.dd-activity__avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-weight: 700; font-size: 11px;
  color: #fff;
}
.dd-activity__avatar--ai { background: linear-gradient(135deg, #ec4899, #db2777); }
.dd-activity__avatar--human { background: linear-gradient(135deg, var(--c-brand-600), var(--c-violet-600)); }
.dd-activity__text { flex: 1; line-height: 1.45; font-size: 12.5px; }
.dd-activity__text time { display: block; color: var(--c-text-mute); font-size: 11px; margin-top: 2px; }

/* === Comments === */
.dd-comment {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--c-bg-soft);
  margin-bottom: 8px;
}
.dd-comment__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.dd-comment__author { font-weight: 600; font-size: 12px; }
.dd-comment__time { color: var(--c-text-mute); font-size: 11px; }
.dd-comment__body { font-size: 13px; color: var(--c-text); }
.dd-comment__actions {
  display: flex; gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--c-text-soft);
}
.dd-comment__actions button { color: var(--c-text-soft); padding: 2px 4px; }
.dd-comment__actions button:hover { color: var(--c-link); }

/* === Cmd+K palette === */
.dd-palette-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.dd-palette-overlay.is-open { display: flex; }
.dd-palette {
  width: 640px; max-width: 90vw;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dd-palette__input {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 16px;
  outline: 0;
  font-family: var(--f-sans);
}
.dd-palette__list { padding: 8px; max-height: 60vh; overflow-y: auto; }
.dd-palette__group {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-text-mute);
  padding: 12px 12px 4px;
}
.dd-palette__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
}
.dd-palette__item:hover, .dd-palette__item.is-active { background: var(--c-brand-50); color: var(--c-brand-800); }
.dd-palette__item kbd {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--c-bg-mute);
  border-radius: 4px;
  font-family: var(--f-mono); font-size: 11px;
  color: var(--c-text-soft);
}

/* === Public landing === */
.dd-hero {
  text-align: center;
  padding: 80px 20px 40px;
  max-width: 1100px;             /* zvetseno z 720 - aby se vesel nadpis na 1 radku */
  margin: 0 auto;
}
.dd-hero__title {
  font-size: clamp(22px, 3.8vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  padding: 8px 6px;
  background: linear-gradient(135deg, var(--c-brand-700), var(--c-violet-600));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  overflow: visible;
  display: inline-block;          /* dovoli text presahnout pripadne hero box */
}
.dd-hero__sub {
  font-size: 18px;
  color: var(--c-text-soft);
  max-width: 540px;
  margin: 0 auto 32px;
}

.dd-search-big {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  font-size: 16px;
  color: var(--c-text-mute);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dd-search-big:hover { border-color: var(--c-brand-300); }
.dd-search-big input {
  flex: 1; border: 0; outline: 0; font: inherit;
  color: var(--c-text); background: transparent;
}

.dd-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 40px 0;
}

/* === Buttons === */
.dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 13px;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.dd-btn--primary {
  background: var(--c-brand-600);
  color: #fff;
}
.dd-btn--primary:hover { background: var(--c-brand-700); box-shadow: var(--shadow-sm); }
.dd-btn--ghost {
  background: var(--c-bg-soft);
  border-color: var(--c-border);
  color: var(--c-text);
}
.dd-btn--ghost:hover { background: var(--c-bg-mute); }
.dd-btn--danger { background: var(--c-danger); color: #fff; }

/* =========================================================
   NOTION-STYLE EDITOR
   - hover na blok ukaze "+ ⋮⋮" vlevo
   - / otevre slash menu
   - bubble toolbar pri oznaceni textu
   ========================================================= */

.nt-doc {
  position: relative;
  padding: 8px 0 200px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  max-width: 760px;
  margin: 0 auto;
}

.nt-block {
  position: relative;
  padding: 4px 0;
  margin: 2px -8px;
  border-radius: 4px;
  transition: background var(--t-fast);
}
.nt-block:hover { background: var(--c-bg-soft); }
.nt-block.is-focused { background: var(--c-brand-50); }
.nt-block > .nt-content { padding: 0 8px; }

.nt-handles {
  position: absolute;
  left: -50px;
  top: 6px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.nt-block:hover > .nt-handles,
.nt-block.is-focused > .nt-handles { opacity: 1; }

.nt-handle {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--c-text-mute);
  cursor: pointer; font-size: 14px;
  transition: all var(--t-fast);
  background: transparent;
}
.nt-handle:hover { background: var(--c-bg-mute); color: var(--c-text); }
.nt-handle--drag { cursor: grab; font-size: 16px; }
.nt-handle--drag:active { cursor: grabbing; }

/* Block types */
.nt-h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin: 24px 0 6px; padding: 0 8px; }
.nt-h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 20px 0 4px; padding: 0 8px; }
.nt-h3 { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 16px 0 4px; padding: 0 8px; }
.nt-p  { padding: 0 8px; }
.nt-ul, .nt-ol { padding-left: 32px; margin: 0; }
.nt-li { margin: 2px 0; }
.nt-todo {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0 8px;
}
.nt-todo input[type=checkbox] { margin-top: 6px; flex-shrink: 0; accent-color: var(--c-brand-600); }
.nt-todo span { flex: 1; }
.nt-todo.is-done span { color: var(--c-text-mute); text-decoration: line-through; }
.nt-quote {
  border-left: 3px solid var(--c-brand-500);
  padding: 4px 16px;
  color: var(--c-text-soft);
  font-style: italic;
  margin: 0;
}
.nt-divider {
  border: 0; border-top: 1px solid var(--c-border);
  margin: 16px 0;
}
.nt-callout {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--c-spec-bg);
  margin: 0 8px;
}
.nt-callout__icon { font-size: 20px; flex-shrink: 0; }
.nt-callout__body { flex: 1; font-size: 14.5px; }

.nt-empty {
  color: var(--c-text-mute);
  font-style: italic;
  padding: 0 8px;
}
.nt-cursor {
  display: inline-block;
  width: 1.5px; height: 1em;
  background: var(--c-text);
  vertical-align: text-top;
  animation: nt-blink 1s step-end infinite;
  margin-right: 1px;
}
@keyframes nt-blink { 50% { opacity: 0; } }

/* Slash menu */
.nt-slash {
  position: absolute;
  width: 340px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  font-size: 14px;
}
.nt-slash__head {
  padding: 10px 14px 6px;
  font-size: 11px; font-weight: 700;
  color: var(--c-text-mute);
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 1px solid var(--c-border);
  display: flex; justify-content: space-between;
}
.nt-slash__list { max-height: 380px; overflow-y: auto; padding: 4px; }
.nt-slash__group {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 700;
  color: var(--c-text-mute);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.nt-slash__item {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin: 1px 4px;
}
.nt-slash__item:hover, .nt-slash__item.is-active {
  background: var(--c-brand-50);
}
.nt-slash__icon {
  width: 38px; height: 38px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--c-bg-mute);
  font-size: 18px;
  flex-shrink: 0;
}
.nt-slash__title { font-weight: 600; font-size: 13.5px; }
.nt-slash__desc { font-size: 11.5px; color: var(--c-text-mute); margin-top: 1px; }
.nt-slash__hint {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--c-bg-mute);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--c-text-soft);
}

/* Bubble toolbar */
.nt-bubble {
  position: absolute;
  display: inline-flex;
  align-items: center; gap: 1px;
  padding: 4px;
  background: #1f2937;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.nt-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  border-bottom: 0;
}
.nt-bubble__btn {
  padding: 6px 8px;
  color: #d1d5db;
  font-size: 13px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  display: grid; place-items: center;
  min-width: 28px;
}
.nt-bubble__btn:hover { background: #374151; color: #fff; }
.nt-bubble__btn.is-active { background: var(--c-brand-600); color: #fff; }
.nt-bubble__sep {
  width: 1px; height: 20px;
  background: #374151;
  margin: 0 4px;
}

.nt-selected {
  background: rgba(99,102,241,0.25);
  border-radius: 2px;
  padding: 0 1px;
}

/* Edit mode banner */
.nt-edit-bar {
  position: sticky; top: var(--h-header); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(to right, var(--c-brand-50), var(--c-bg));
  border-bottom: 1px solid var(--c-brand-200);
  font-size: 13px;
  color: var(--c-brand-800);
}
.nt-edit-bar__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-brand-600);
  animation: nt-pulse 1.5s ease-in-out infinite;
}
@keyframes nt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Responsive (basic) === */
@media (max-width: 1280px) {
  :root { --w-sidebar: 240px; --w-meta: 280px; }
  .dd-main { padding: 24px 32px 80px; }
}
@media (max-width: 980px) {
  .dd-app { grid-template-columns: var(--w-sidebar) 1fr; }
  .dd-meta { display: none; }
}
@media (max-width: 720px) {
  .dd-app { grid-template-columns: 1fr; }
  .dd-sidebar { display: none; }
  .dd-main { padding: 16px; }
  .dd-hero__title { font-size: 32px; }
}
