/* Ordo: interface de páginas, bancos de dados e notas de reunião. */

:root {
  --bg: #ffffff;
  --side: #f8f8f7;
  --panel: #fbfbfa;
  --text: #2f2e2b;
  --muted: #787774;
  --faint: #a5a4a0;
  --line: #e9e9e7;
  --hover: rgba(55, 53, 47, 0.07);
  --active: rgba(55, 53, 47, 0.11);
  --accent: #0c83e1;
  --accent-soft: rgba(12, 131, 225, 0.12);
  --rec: #e03e3e;
  --danger: #d44c47;
  --shadow: 0 0 0 1px rgba(15, 15, 15, 0.05), 0 3px 6px rgba(15, 15, 15, 0.1), 0 9px 24px rgba(15, 15, 15, 0.2);
  --side-w: 260px;
  --radius: 6px;
  color-scheme: light;
  /* Cores das opções */
  --c-default: rgba(227, 226, 224, 0.6); --t-default: #32302c;
  --c-gray: #e3e2e0; --t-gray: #32302c;
  --c-brown: #eee0da; --t-brown: #442a1e;
  --c-orange: #fadec9; --t-orange: #49290e;
  --c-yellow: #fdecc8; --t-yellow: #402c1b;
  --c-green: #dbeddb; --t-green: #1c3829;
  --c-blue: #d3e5ef; --t-blue: #183347;
  --c-purple: #e8deee; --t-purple: #412454;
  --c-pink: #f5e0e9; --t-pink: #4c2337;
  --c-red: #ffe2dd; --t-red: #5d1715;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --side: #202020;
    --panel: #202020;
    --text: #e6e6e4;
    --muted: #9b9b98;
    --faint: #6f6f6c;
    --line: #2f2f2f;
    --hover: rgba(255, 255, 255, 0.055);
    --active: rgba(255, 255, 255, 0.09);
    --accent: #529cca;
    --accent-soft: rgba(82, 156, 202, 0.18);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 3px 6px rgba(0, 0, 0, 0.3), 0 9px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
    --c-default: rgba(255, 255, 255, 0.09); --t-default: #e6e6e4;
    --c-gray: #373737; --t-gray: #d4d4d4;
    --c-brown: #4a3a32; --t-brown: #e8d5cc;
    --c-orange: #5c3b23; --t-orange: #f5d2b5;
    --c-yellow: #564328; --t-yellow: #f6e1b1;
    --c-green: #243d30; --t-green: #c4e3cc;
    --c-blue: #143a4e; --t-blue: #c0dcef;
    --c-purple: #3c2d49; --t-purple: #dccbea;
    --c-pink: #4e2c3c; --t-pink: #f0cddc;
    --c-red: #522e2a; --t-red: #f4c9c4;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.5 "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.resizing { cursor: col-resize; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: 0.45; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
kbd { font: 11px/1 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }
.grow { flex: 1; }
.pad { padding: 12px; }

/* Botões e campos genéricos */
.primary, button.small:not(.link), .danger-btn, .dlg-actions button, .form button, .home-action, .mb-actions button, .mb-head-actions button:not(.icon-btn), .trash-row button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 12px;
  background: var(--bg);
  line-height: 1.4;
  white-space: nowrap;
}
button.primary:not(.link), .primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.small:not(.link) { padding: 3px 10px; font-size: 13px; }
button.small:not(.link):hover, .dlg-actions button:not(.primary):hover, .form button:not(.primary):hover { background: var(--hover); }
.danger-btn { color: var(--danger); }
.danger-btn:hover { background: rgba(212, 76, 71, 0.08); }
.link { color: var(--muted); padding: 2px 4px; border-radius: 4px; }
.link:hover { background: var(--hover); color: var(--text); }
.link.danger, .danger { color: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 4px;
  border-radius: 5px; color: var(--muted); font-size: 15px; line-height: 1;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn.tiny { min-width: 20px; height: 20px; font-size: 13px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 5px 8px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-blue); color: var(--t-blue); font-size: 12px; font-weight: 600;
}
.avatar.sm { width: 18px; height: 18px; font-size: 10px; }
.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Estrutura ---------- */

#app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; }
.main { grid-column: 2; grid-row: 1; position: relative; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.view { flex: 1; overflow: auto; overflow-x: hidden; scroll-behavior: auto; }
.scrim { display: none; }

/* ---------- Barra lateral ---------- */

.sidebar {
  grid-column: 1; grid-row: 1;
  position: relative;
  display: flex; flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  height: 100vh; min-width: 0;
  user-select: none;
  z-index: 20;
}
.side-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px 10px; }
.side-user { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 6px; font-weight: 600; }
.side-user:hover { background: var(--hover); }
.side-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-collapse { opacity: 0; transition: opacity 0.15s; }
.sidebar:hover .side-collapse { opacity: 1; }
.side-nav, .side-foot { padding: 2px 8px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 6px; padding-bottom: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 4px 8px; border-radius: 6px; color: var(--muted); text-align: left; font-size: 14px;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 500; }
.nav-icon { width: 20px; text-align: center; flex: none; font-size: 14px; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-hint { font-size: 11px; color: var(--faint); }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 20px; }
.side-section { margin-top: 10px; min-height: 30px; }
.side-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 8px; font-size: 12px; font-weight: 600; color: var(--faint);
}
.side-section-head .icon-btn { opacity: 0; }
.side-section:hover .side-section-head .icon-btn { opacity: 1; }
.side-empty { margin: 4px 8px; font-size: 12px; color: var(--faint); }
.tree-row {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  height: 28px; padding-right: 4px; border-radius: 6px;
  color: var(--muted); cursor: pointer;
}
.tree-row:hover { background: var(--hover); color: var(--text); }
.tree-row.active { background: var(--active); color: var(--text); font-weight: 500; }
.tree-row.dragging { opacity: 0.4; }
.tree-row.drop-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tree-row.drop-before::before, .tree-row.drop-after::after {
  content: ""; position: absolute; left: 8px; right: 4px; height: 2px; background: var(--accent); border-radius: 2px;
}
.tree-row.drop-before::before { top: -1px; }
.tree-row.drop-after::after { bottom: -1px; }
.caret { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--faint); flex: none; }
.caret span { display: inline-block; transition: transform 0.12s; font-size: 14px; }
.caret.open span { transform: rotate(90deg); }
.caret:hover { background: var(--active); color: var(--text); }
.caret.hidden { visibility: hidden; }
.tree-icon { width: 22px; text-align: center; flex: none; font-size: 14px; }
.tree-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-rename { flex: 1; height: 24px; padding: 2px 6px !important; }
.tree-actions { display: none; gap: 1px; }
.tree-row:hover .tree-actions { display: flex; }
.tree-none { height: 26px; line-height: 26px; font-size: 12px; color: var(--faint); }
.side-resize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 2; }
.side-resize:hover { background: var(--accent-soft); }

/* Barra recolhida: some, e aparece por cima ao encostar o mouse na borda. */
#app.side-collapsed { grid-template-columns: 0 1fr; }
#app.side-collapsed .sidebar {
  position: fixed; left: 0; top: 48px; bottom: 48px; height: auto; width: var(--side-w);
  border-radius: 0 8px 8px 0; box-shadow: var(--shadow); border: 0;
  transform: translateX(calc(-100% - 10px)); transition: transform 0.18s ease;
}
#app.side-collapsed:not(.side-peek) .sidebar { box-shadow: none; }
#app.side-collapsed.side-peek .sidebar { transform: none; }
#app.side-collapsed .side-collapse { transform: rotate(180deg); opacity: 1; }
#app.side-collapsed .side-resize { display: none; }
.menu-toggle { display: none; }
#app.side-collapsed .menu-toggle { display: inline-grid; }

/* ---------- Barra superior ---------- */

.topbar {
  display: flex; align-items: center; gap: 2px;
  height: 44px; padding: 0 10px; flex: none;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  min-width: 0;
}
.crumbs { display: flex; align-items: center; min-width: 0; overflow: hidden; margin-left: 6px; flex: 0 1 auto; }
.crumb {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; color: var(--text);
}
.crumb:hover:not(.static) { background: var(--hover); }
.crumb-title { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.crumb-sep { color: var(--faint); padding: 0 1px; }
.save-state { color: var(--faint); font-size: 12px; margin-right: 8px; white-space: nowrap; }
.save-state.busy { color: var(--muted); }
.topbar .small { margin-right: 2px; }

/* ---------- Página ---------- */

.page {
  --page-pad: clamp(20px, 7vw, 96px);
  max-width: calc(760px + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 36px var(--page-pad) 30vh;
}
.page.is-database { max-width: none; padding-bottom: 60px; }
.page.in-peek { --page-pad: clamp(18px, 4vw, 48px); padding-top: 12px; max-width: none; }
.page-header { margin-bottom: 6px; }
.page-icon-row { display: flex; align-items: flex-end; min-height: 30px; }
.page-icon { font-size: 52px; line-height: 1.1; padding: 4px; border-radius: 8px; margin-left: -4px; }
.page-icon:hover:not(:disabled) { background: var(--hover); }
.add-icon { opacity: 0; font-size: 13px; transition: opacity 0.12s; }
.page-header:hover .add-icon { opacity: 1; }
.page-title {
  display: block; width: 100%;
  border: 0 !important; box-shadow: none !important; outline: none;
  padding: 2px 0 !important; margin: 4px 0;
  font-size: 40px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
  resize: none; overflow: hidden; background: transparent;
}
.in-peek .page-title { font-size: 32px; }
.page-title::placeholder { color: var(--faint); opacity: 0.6; }
.page-body { min-height: 120px; }
.skeleton { padding-top: 10px; }
.sk-line { height: 14px; margin: 12px 0; border-radius: 4px; background: linear-gradient(90deg, var(--hover), var(--active), var(--hover)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.not-found { padding: 40px 0; color: var(--muted); }
.child-list { margin-top: 16px; }

/* Propriedades da linha */
.row-db { margin: -2px 0 6px; font-size: 13px; }
.props-panel { margin: 8px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.prop-row { display: flex; align-items: flex-start; min-height: 34px; gap: 6px; }
.prop-name {
  display: flex; align-items: center; gap: 6px; flex: none;
  width: clamp(110px, 32%, 180px); padding: 6px 6px; color: var(--muted); font-size: 14px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.prop-icon { width: 16px; text-align: center; color: var(--faint); font-size: 12px; flex: none; }
.prop-value { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 4px; min-height: 32px; word-break: break-word; }
.prop-value.editable { cursor: pointer; }
.prop-value.editable:hover { background: var(--hover); }
.prop-value .empty { color: var(--faint); }
.text-value { white-space: pre-wrap; }
.add-prop { margin-top: 6px; font-size: 13px; }

/* Valores */
.chip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 0 6px; border-radius: 3px; font-size: 13px; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--c-default); color: var(--t-default);
}
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.c-default { background: var(--c-default); color: var(--t-default); }
.c-gray { background: var(--c-gray); color: var(--t-gray); }
.c-brown { background: var(--c-brown); color: var(--t-brown); }
.c-orange { background: var(--c-orange); color: var(--t-orange); }
.c-yellow { background: var(--c-yellow); color: var(--t-yellow); }
.c-green { background: var(--c-green); color: var(--t-green); }
.c-blue { background: var(--c-blue); color: var(--t-blue); }
.c-purple { background: var(--c-purple); color: var(--t-purple); }
.c-pink { background: var(--c-pink); color: var(--t-pink); }
.c-red { background: var(--c-red); color: var(--t-red); }
.person { display: inline-flex; align-items: center; gap: 5px; }
.rel-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  border-bottom: 1px solid var(--line); cursor: pointer; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rel-chip:hover { border-color: var(--text); }
.rel-icon { font-size: 12px; }
.checkbox-view {
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  border: 1.5px solid var(--faint); border-radius: 3px; font-size: 11px; color: #fff;
}
.checkbox-view.on { background: var(--accent); border-color: var(--accent); }
.link-value { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.plain { font-size: 13px; }

/* Comentários */
.comments { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 14px; }
.comments h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.comment-new { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.comment-new textarea { flex: 1; resize: vertical; min-height: 34px; }
.act { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 5px 0; font-size: 13px; }
.act-who { font-weight: 600; }
.act.change { color: var(--muted); }
.act.change .act-who { font-weight: 500; }
.act-when { color: var(--faint); font-size: 12px; }

/* ---------- Editor ---------- */

.editor .ProseMirror { outline: none; min-height: 120px; font-size: 16px; line-height: 1.6; word-wrap: break-word; }
.ProseMirror > * { margin: 2px 0; }
.ProseMirror p { margin: 2px 0; min-height: 1.6em; }
.ProseMirror h1 { font-size: 1.875em; margin: 1.1em 0 0.2em; line-height: 1.3; }
.ProseMirror h2 { font-size: 1.5em; margin: 1em 0 0.15em; line-height: 1.3; }
.ProseMirror h3 { font-size: 1.25em; margin: 0.9em 0 0.1em; line-height: 1.3; }
.ProseMirror ul, .ProseMirror ol { padding-left: 1.6em; margin: 2px 0; }
.ProseMirror li > p { margin: 1px 0; }
.ProseMirror blockquote { border-left: 3px solid currentColor; margin: 6px 0; padding: 0 0 0 14px; }
.ProseMirror code { background: var(--hover); color: #eb5757; border-radius: 4px; padding: 0.15em 0.35em; font-size: 0.85em; font-family: ui-monospace, Consolas, monospace; }
.ProseMirror pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; overflow-x: auto; font-size: 0.85em; }
.ProseMirror pre code { background: none; color: inherit; padding: 0; }
.ProseMirror hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.ProseMirror a { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); cursor: pointer; }
.ProseMirror mark { background: var(--c-yellow); color: inherit; border-radius: 2px; padding: 0 1px; }
.ProseMirror img { display: block; max-width: 100%; height: auto; border-radius: 4px; margin: 8px 0; }
.ProseMirror img.ProseMirror-selectednode { outline: 2px solid var(--accent); }
.ProseMirror ul[data-type="taskList"] { list-style: none; padding-left: 2px; }
.ProseMirror ul[data-type="taskList"] li { display: flex; gap: 8px; align-items: flex-start; }
.ProseMirror ul[data-type="taskList"] li > label { margin-top: 0.3em; flex: none; }
.ProseMirror ul[data-type="taskList"] li > label input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ProseMirror ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration: line-through; color: var(--faint); }
.ProseMirror table { border-collapse: collapse; margin: 10px 0; width: 100%; table-layout: fixed; }
.ProseMirror td, .ProseMirror th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; position: relative; }
.ProseMirror th { background: var(--panel); font-weight: 600; text-align: left; }
.ProseMirror .selectedCell::after { content: ""; position: absolute; inset: 0; background: var(--accent-soft); pointer-events: none; }
.ProseMirror p.is-empty::before, .ProseMirror h1.is-empty::before, .ProseMirror h2.is-empty::before, .ProseMirror h3.is-empty::before {
  content: attr(data-placeholder); color: var(--faint); pointer-events: none; float: left; height: 0;
}
.ProseMirror p.is-empty:not(.is-editor-empty)::before { content: none; }
.ProseMirror-focused p.is-empty.has-focus::before, .ProseMirror p.is-editor-empty::before { content: attr(data-placeholder); }
.ProseMirror .ProseMirror-selectednode:not(img) { outline: 2px solid var(--accent-soft); border-radius: 4px; }
.ProseMirror-gapcursor::after { border-top-color: var(--text); }

/* Toggle (details) */
.ProseMirror .toggle, .ProseMirror div[data-type="details"] { display: flex; gap: 4px; margin: 2px 0; }
.ProseMirror div[data-type="details"] > button {
  flex: none; width: 22px; height: 26px; display: grid; place-items: center; border-radius: 4px; color: var(--muted);
}
.ProseMirror div[data-type="details"] > button::before { content: "▸"; transition: transform 0.12s; }
.ProseMirror div[data-type="details"].is-open > button::before { transform: rotate(90deg); }
.ProseMirror div[data-type="details"] > button:hover { background: var(--hover); }
.ProseMirror div[data-type="details"] > div { flex: 1; min-width: 0; }
.ProseMirror div[data-type="details"] summary { list-style: none; font-weight: 500; }
.ProseMirror div[data-type="details"] summary::-webkit-details-marker { display: none; }
.ProseMirror div[data-type="details"]:not(.is-open) div[data-type="detailsContent"] { display: none; }
.ProseMirror details { margin: 0; }

/* Callout */
.callout { display: flex; gap: 10px; padding: 14px 16px 14px 12px; border-radius: 6px; background: var(--hover); margin: 6px 0; }
.callout-emoji { font-size: 20px; line-height: 1.3; width: 28px; height: 28px; border-radius: 4px; flex: none; }
.callout-emoji:hover { background: var(--active); }
.callout-body { flex: 1; min-width: 0; }

/* Bloco de página */
.page-link {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 3px 4px; margin: 1px 0; border-radius: 4px; cursor: pointer; text-align: left;
  font-size: 16px;
}
.page-link:hover { background: var(--hover); }
.page-link-icon { width: 22px; text-align: center; flex: none; }
.page-link-title { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.page-link-title.missing { color: var(--faint); font-weight: 400; }

/* Menu "/" */
.slash-menu {
  position: fixed; z-index: 1000; width: 300px; max-height: 340px; overflow-y: auto;
  background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); padding: 6px;
}
.slash-group { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.03em; }
.slash-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 6px; border-radius: 5px; text-align: left; }
.slash-item.active { background: var(--hover); }
.slash-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 5px; background: var(--bg); font-size: 15px; font-weight: 600; color: var(--muted);
}
.slash-text { display: flex; flex-direction: column; min-width: 0; }
.slash-text strong { font-weight: 500; font-size: 14px; }
.slash-text span { font-size: 12px; color: var(--muted); }
.slash-empty { padding: 8px; color: var(--muted); }

/* Barra de formatação */
.format-bar {
  position: fixed; z-index: 1000; display: flex; align-items: center; gap: 1px;
  background: var(--bg); border-radius: 6px; box-shadow: var(--shadow); padding: 3px;
}
.format-bar button { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 4px; font-weight: 600; }
.format-bar button:hover { background: var(--hover); }
.format-bar button.on { color: var(--accent); }
.format-bar .turn-into { border: 0; height: 28px; padding: 0 4px; background: transparent; box-shadow: none; }

/* ---------- Popups, menus e diálogos ---------- */

.popup {
  position: fixed; z-index: 1100;
  background: var(--bg); border-radius: 8px; box-shadow: var(--shadow);
  max-height: min(420px, calc(100vh - 16px)); overflow-y: auto;
}
.menu { padding: 5px; min-width: 210px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 5px; text-align: left; white-space: nowrap; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.mi-icon { width: 18px; text-align: center; color: var(--muted); flex: none; }
.menu-item.danger .mi-icon { color: var(--danger); }
.mi-hint { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--faint); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop-edit { display: flex; flex-direction: column; gap: 6px; padding: 8px; min-width: 260px; }
.pop-edit textarea { min-height: 80px; resize: vertical; }
.pop-hint { font-size: 11px; color: var(--faint); }
.pop-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.pop-input { width: 100%; }
.pop-pick { width: 280px; padding: 6px; }
.pop-pick.wide { width: 340px; }
.pick-list { display: flex; flex-direction: column; margin-top: 6px; max-height: 300px; overflow-y: auto; }
.pick-label { padding: 6px 6px 2px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; text-align: left; min-height: 30px; cursor: pointer; }
.pick-row:hover, .pick-row.active { background: var(--hover); }
.pick-row .check { width: 14px; color: var(--accent); flex: none; }
.pick-row .check.right { margin-left: auto; }
.pick-row.create { color: var(--muted); }
.pick-empty { margin: 8px 6px; font-size: 13px; color: var(--muted); }
.emoji-pop { padding: 8px; width: 300px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-bottom: 8px; }
.emoji { font-size: 20px; height: 32px; border-radius: 4px; }
.emoji:hover { background: var(--hover); }
.filter-edit { min-width: 240px; }

.dialog {
  border: 0; border-radius: 10px; padding: 18px 20px; width: min(480px, calc(100vw - 32px));
  background: var(--bg); color: var(--text); box-shadow: var(--shadow);
  max-height: calc(100vh - 48px);
}
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(15, 15, 15, 0.45); }
.dialog h3 { margin: 0 0 12px; font-size: 16px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.confirm-text { margin: 4px 0 8px; }
.dialog.search { padding: 0; width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.dialog.search h3 { padding: 14px 16px 0; margin: 0; }
.search-input { width: 100%; border: 0 !important; box-shadow: none !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 16px !important; font-size: 17px; }
.search-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.search-label { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: 6px; text-align: left; }
.search-item.active, .search-item:hover { background: var(--hover); }
.search-icon { width: 22px; text-align: center; flex: none; }
.search-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-path { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.search-empty { padding: 12px 10px; color: var(--muted); margin: 0; }
.search-foot { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.trash-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.trash-row button { padding: 2px 10px; font-size: 13px; }
.trash-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.trash-head h3 { margin: 0; }
.trash-head button { padding: 2px 10px; font-size: 13px; }
/* Compartilhar (popover, como no Notion) */
.share-popup { width: min(460px, calc(100vw - 24px)); padding: 0; }
.share-pop { display: flex; flex-direction: column; }
.share-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.share-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.share-invite { display: flex; align-items: center; gap: 6px; padding: 10px 14px 6px; }
.share-chips {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  min-height: 32px; padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.share-chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.share-input { flex: 1; min-width: 120px; border: 0 !important; box-shadow: none !important; background: transparent; padding: 3px 2px; }
.share-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 2px 1px 3px; border-radius: 4px; background: var(--c-blue); color: var(--t-blue); font-size: 13px; }
.share-role-btn { display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.share-role-btn:hover { background: var(--hover); color: var(--text); }
.share-invite .primary { padding: 5px 12px; }
.share-invite .primary:disabled { opacity: 0.5; cursor: default; }
.share-suggest { margin: 0 14px 4px; border: 1px solid var(--line); border-radius: var(--radius); max-height: 230px; overflow-y: auto; padding: 4px; }
.share-suggest[hidden] { display: none; }
.share-sugg { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 5px; text-align: left; }
.share-sugg:hover, .share-sugg.on { background: var(--hover); }
.share-hint { margin: 4px 6px; }
.share-people { padding: 6px 14px 8px; max-height: 320px; overflow-y: auto; }
.share-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 6px 0 2px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.share-who { min-width: 0; }
.share-who > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-space { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--hover); font-size: 16px; flex: none; }
.share-space img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; }
.share-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel); border-radius: 0 0 8px 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 4px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bg); }
.avatar-stack .avatar + .avatar { margin-left: -5px; }
.role-opt { display: flex; flex-direction: column; line-height: 1.3; }
.role-opt strong { font-weight: 500; }
.menu-gap { display: inline-block; width: 14px; }

/* Ajustar imagem (ícone e foto de perfil) */
.adjust-dialog { width: min(640px, calc(100vw - 32px)); }
.adjust { display: flex; gap: 20px; flex-wrap: wrap; }
.adjust-left { display: flex; flex-direction: column; gap: 10px; }
.adjust-stage {
  border-radius: 8px; cursor: grab; touch-action: none; outline: none;
  background: repeating-conic-gradient(var(--hover) 0 25%, transparent 0 50%) 0 0 / 16px 16px, var(--panel);
}
.adjust-stage.dragging { cursor: grabbing; }
.adjust-zoom-row { display: flex; align-items: center; gap: 6px; }
.adjust-zoom { flex: 1; accent-color: var(--accent); }
.adjust-right { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.adjust-previews { display: flex; flex-direction: column; gap: 8px; }
.pv-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); color: var(--text); }
.pv-card.dark { background: #191919; color: #e6e6e4; border-color: #2f2f2f; }
.pv-caption { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.pv-card.dark .pv-caption { color: #9b9b98; }
.pv-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pv-link span { text-decoration: underline; text-decoration-color: var(--faint); font-weight: 500; }
.pv-title { display: flex; flex-direction: column; gap: 6px; font-size: 22px; font-weight: 700; }
.pv { display: block; flex: none; border-radius: 3px; }
.pv-big { border-radius: 6px; }
.pv.round { border-radius: 50%; }
.picker-paste-hint { display: flex; align-items: center; gap: 4px; padding: 6px 12px 8px; border-top: 1px solid var(--line); }
.picker-drop { width: 100%; }

/* Fotos de perfil */
.avatar.has-img { background: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar.md { width: 28px; height: 28px; font-size: 13px; }
.avatar.xl { width: 88px; height: 88px; font-size: 36px; }
.profile { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.profile-side { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 140px; }
.profile-photo { position: relative; border-radius: 50%; cursor: pointer; outline: none; }
.profile-photo:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-photo-edit {
  position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg); box-shadow: var(--shadow); color: var(--muted);
}
.profile-photo:hover .profile-photo-edit { color: var(--text); }
.profile-tip { text-align: center; margin: 0; }
.profile-form { flex: 1; min-width: 280px; max-width: 560px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.profile-pass summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.profile-pass[open] summary { margin-bottom: 8px; }

/* ---------- Bancos de dados ---------- */

.db { margin-top: 10px; }
.db-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.db-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.db-tab { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; color: var(--muted); white-space: nowrap; font-size: 14px; position: relative; }
.db-tab:hover { background: var(--hover); }
.db-tab.active { color: var(--text); font-weight: 500; }
.db-tab.active::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; height: 2px; background: var(--text); border-radius: 1px; }
.db-tab-icon { font-size: 13px; }
.db-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.db-tools .tool { padding: 4px 8px; border-radius: 5px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.db-tools .tool:hover { background: var(--hover); color: var(--text); }
.db-tools .tool.on { color: var(--accent); }
.db-search { width: 130px; height: 28px; padding: 2px 8px !important; border-color: transparent !important; background: var(--hover) !important; }
.db-search:focus { width: 180px; }
.db-tools .primary { margin-left: 6px; }
.db-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--accent); color: var(--accent); border-radius: 14px; padding: 0 4px 0 6px; font-size: 13px; }
.filter-chip .link { color: var(--accent); }
.db-view { margin-top: 10px; }
.db-empty { padding: 30px 0; color: var(--muted); }
.db-loading { padding: 30px 0; color: var(--muted); }

/* Board */
.board { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; padding-bottom: 16px; min-height: 240px; }
.board-col { flex: 0 0 272px; display: flex; flex-direction: column; gap: 6px; border-radius: 8px; padding: 4px; min-height: 120px; }
.board-col.over { background: var(--accent-soft); }
.board-col-head { display: flex; align-items: center; gap: 6px; padding: 4px 2px 6px; position: sticky; top: 0; }
.board-col-head .count { color: var(--faint); font-size: 13px; }
.board-col-head .icon-btn { opacity: 0; }
.board-col:hover .board-col-head .icon-btn { opacity: 1; }
.board-cards { display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.card {
  background: var(--bg); border-radius: 6px; padding: 8px 10px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 15, 15, 0.06);
  display: flex; flex-direction: column; gap: 6px;
}
.card:hover { background: var(--panel); }
.card.dragging { opacity: 0.35; }
.card-title { font-weight: 500; line-height: 1.35; word-break: break-word; display: flex; gap: 6px; }
.card-icon { flex: none; }
.card-props { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.card-props:empty { display: none; }
.card-prop { min-width: 0; overflow: hidden; }
.card.new { gap: 4px; }
.inline-new { width: 100%; border: 0 !important; box-shadow: none !important; padding: 0 !important; font-weight: 500; background: transparent !important; }
.drop-marker { height: 3px; border-radius: 2px; background: var(--accent); margin: -1px 0; }
.board-add { color: var(--faint); text-align: left; padding: 5px 8px; border-radius: 5px; font-size: 14px; }
.board-add:hover { background: var(--hover); color: var(--text); }
.board-hidden { flex: 0 0 200px; display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.hidden-group { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; border-radius: 5px; }
.hidden-group:hover { background: var(--hover); }

/* Tabela */
.table-scroll { overflow-x: auto; padding-bottom: 8px; }
.dtable { display: table; min-width: 100%; border-collapse: collapse; }
.trow { display: table-row; }
.tcell { white-space: nowrap; display: table-cell; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 8px; min-height: 34px; height: 34px; vertical-align: top; font-size: 14px; max-width: 360px; overflow: hidden; }
.tcell:last-child { border-right: 0; }
.thead .tcell { color: var(--muted); font-size: 13px; padding: 0; white-space: nowrap; border-top: 1px solid var(--line); }
.thead-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; text-align: left; }
.thead-btn:hover { background: var(--hover); }
.tcell-title { min-width: 260px; width: 280px; position: relative; font-weight: 500; cursor: text; }
.tcell-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 60px; }
.open-btn {
  position: absolute; right: 6px; top: 6px; display: none;
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg);
}
.trow:hover .open-btn { display: block; }
.open-btn:hover { background: var(--hover); }
.tcell-input { width: 100%; border: 0 !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; font-weight: 500; }
.tcell.editable { cursor: pointer; }
.tcell.editable:hover { background: var(--hover); }
.trow:not(.thead):hover .tcell-title { background: var(--hover); }
.tcell-add { width: 36px; }
.tnew .card.new { box-shadow: none; padding: 6px 8px; }

/* Lista */
.dlist { display: flex; flex-direction: column; }
.dlist-row { display: flex; align-items: center; gap: 12px; padding: 6px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 4px; }
.dlist-row:hover { background: var(--hover); }
.dlist-title { flex: 1; min-width: 0; display: flex; gap: 8px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dlist-props { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }

/* Calendário */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-month { font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-wd { padding: 4px 8px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; }
.cal-day { min-height: 110px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--panel); color: var(--faint); }
.cal-day.over { background: var(--accent-soft); }
.cal-num { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 13px; padding: 0 4px; }
.cal-day.today .cal-num { color: var(--rec); font-weight: 700; }
.cal-add { opacity: 0; margin-right: auto; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-item {
  font-size: 12px; padding: 3px 6px; border-radius: 4px; background: var(--bg); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 15, 15, 0.06);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-item:hover { background: var(--panel); }

/* Peek (linha aberta ao lado) */
.peek {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 30;
  width: min(680px, 100%); background: var(--bg); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.18s ease;
}
.peek.open { transform: none; }
.peek-bar { display: flex; align-items: center; gap: 2px; padding: 8px 10px; flex: none; }
.peek-body { flex: 1; overflow-y: auto; }

/* Configurações do banco */
.dialog.dbs { padding: 0; display: flex; flex-direction: column; height: min(720px, calc(100vh - 48px)); }
.dbs-head { padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.dbs-head h3 { margin-bottom: 8px; }
.dbs-tabs { display: flex; gap: 2px; }
.dbs-tab { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.dbs-tab.active { color: var(--text); border-color: var(--text); font-weight: 500; }
.dbs-content { flex: 1; overflow-y: auto; padding: 14px 20px; }
.dialog.dbs .dlg-actions { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); }
.dbs-list { display: flex; flex-direction: column; gap: 10px; }
.prop-card, .auto-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.auto-card.off { opacity: 0.6; }
.prop-card-head { display: flex; align-items: center; gap: 6px; }
.prop-name-input { flex: 1; font-weight: 500; }
.options { display: flex; flex-direction: column; gap: 4px; padding-left: 22px; }
.option-row { display: flex; align-items: center; gap: 6px; }
.option-row input { flex: 1; }
.color-sel { width: 90px; }
.dbs-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-left: 22px; flex-wrap: wrap; }
.dbs-field select, .dbs-field input { color: var(--text); }
.dbs-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding-left: 22px; }
.rel-editor { display: flex; flex-direction: column; gap: 8px; }
.sync { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.sync-title { font-size: 13px; font-weight: 600; }
.sync-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.sync-actions { display: flex; gap: 8px; }
.dbs-add { display: flex; gap: 6px; margin-top: 12px; }
.dbs-add input { flex: 1; }
.auto-when { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.auto-actions { display: flex; flex-direction: column; gap: 8px; }
.action-row { border-left: 3px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.action-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.assign { display: flex; flex-direction: column; gap: 4px; }
.assign-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.assign-name { min-width: 120px; }
.assign-add { align-self: flex-start; font-size: 13px; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.template-editor { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-height: 260px; }

/* ---------- Bloco de transcrição ---------- */

.meeting-block {
  border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 12px 14px;
  background: var(--bg); font-size: 14px; line-height: 1.5; user-select: text;
}
.meeting-block.live { border-color: rgba(224, 62, 62, 0.45); box-shadow: 0 0 0 3px rgba(224, 62, 62, 0.08); }
.meeting-block.live.paused { border-color: var(--line); box-shadow: none; }
.mb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-icon { font-size: 20px; }
.live .mb-icon { animation: pulse 1.4s ease-in-out infinite; }
.live.paused .mb-icon { animation: none; opacity: 0.5; }
@keyframes pulse { 50% { opacity: 0.35; } }
.mb-title { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.mb-sub { font-size: 12px; color: var(--muted); }
.mb-head-actions { display: flex; align-items: center; gap: 6px; }
.mb-head-actions .stop { background: var(--rec); border-color: var(--rec); color: #fff; }
.mb-clock { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 4px; }
.mb-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rec-btn { background: var(--rec) !important; border-color: var(--rec) !important; }
.mb-levels { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lvl { display: flex; align-items: center; gap: 6px; }
.lvl-track { width: 70px; height: 5px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.lvl-bar { display: block; height: 100%; width: 0; background: #4dab6f; transition: width 0.1s; }
.mb-body { margin-top: 10px; }
.mb-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.mb-tab { padding: 4px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mb-tab.active { color: var(--text); border-color: var(--text); font-weight: 500; }
.mb-panel { padding-top: 10px; }
.mb-summary h1, .mb-summary h2, .mb-summary h3 { font-size: 15px; margin: 12px 0 4px; }
.mb-summary ul { padding-left: 20px; margin: 4px 0; }
.mb-summary p { margin: 4px 0; }
.mb-notes { width: 100%; min-height: 90px; resize: none; border: 0 !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; line-height: 1.6; }
.mb-transcript { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.seg { display: grid; grid-template-columns: 48px 56px 1fr; gap: 8px; font-size: 13px; }
.seg-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.seg-who { font-weight: 600; color: var(--muted); }
.seg.mic .seg-who { color: var(--accent); }
.mb-note { background: var(--hover); border-radius: 6px; padding: 8px 12px; margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-note p { margin: 0; flex: 1; }
.mb-ask { margin-top: 12px; }
.ask { display: flex; gap: 6px; }
.ask input { flex: 1; }
.ask button { border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 12px; }
.ask button:hover { background: var(--hover); }
.mb-answer, .answer { margin-top: 10px; padding: 10px 14px; border-radius: 8px; background: var(--hover); }
.answer ul, .mb-answer ul { padding-left: 20px; }

/* ---------- Início e configurações ---------- */

.home, .settings { max-width: 900px; margin: 0 auto; padding: 48px clamp(20px, 6vw, 72px) 80px; }
.home-hello { font-size: 32px; margin: 0 0 20px; }
.home h2, .settings h2 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 32px 0 10px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-action { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px !important; }
.home-action:hover { background: var(--hover); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.home-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; min-height: 104px;
  border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 15, 15, 0.05);
}
.home-card:hover { background: var(--panel); }
.home-card-icon { font-size: 22px; }
.home-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.home-card-meta { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: auto; }
.home-empty { margin-top: 24px; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; }
.settings h1 { font-size: 30px; margin: 0 0 8px; }
.settings section { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.form { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form label input, .form label select { color: var(--text); }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 14px; }
.form label.check input { margin-top: 3px; }
.form .row { display: flex; align-items: center; gap: 10px; }
.shortcuts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.shortcuts li { display: flex; gap: 10px; align-items: center; font-size: 13px; }

/* Importação */
.import-steps { padding-left: 20px; margin: 0 0 14px; line-height: 1.7; }
.progress { height: 6px; border-radius: 3px; background: var(--hover); margin: 14px 0 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.import-log { max-height: 200px; overflow-y: auto; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.import-done { margin: 8px 0; }

/* ---------- Entrar ---------- */

#auth { height: 100vh; overflow: auto; }
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(380px, 100%); }
.auth-logo { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; }
.auth-logo img { border-radius: 14px; box-shadow: 0 6px 18px rgba(19, 30, 53, 0.25); }
.auth-box > .muted { margin: 4px 0 20px; }
.auth-tabs { display: flex; gap: 4px; background: var(--hover); padding: 3px; border-radius: 8px; }
.auth-tab { flex: 1; padding: 6px; border-radius: 6px; color: var(--muted); }
.auth-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); font-weight: 500; }
.auth .form { max-width: none; }
.wide { width: 100%; padding: 8px !important; }
.auth-adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.auth-adv label { margin-top: 8px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; }
.auth .error:empty { display: none; }
.auth-info { margin: 0; }
.auth .link-btn { background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px 0 !important; color: var(--accent); cursor: pointer; }
.auth .link-btn:hover { text-decoration: underline; }

/* ---------- Avisos ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2000;
  background: #2f2e2b; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px;
  box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px));
}
.offline-badge {
  display: none; position: fixed; left: 50%; top: 8px; transform: translateX(-50%); z-index: 1500;
  background: var(--c-yellow); color: var(--t-yellow); padding: 4px 12px; border-radius: 14px; font-size: 13px;
}
body.offline .offline-badge { display: block; }
.update-bar {
  position: fixed; right: 16px; bottom: 16px; z-index: 1800; display: flex; align-items: center; gap: 10px;
  background: var(--bg); color: var(--text); border-radius: 8px; padding: 8px 8px 8px 12px; font-size: 14px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.update-bar[hidden] { display: none; }
.update-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.update-section .row-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- Telas estreitas ---------- */

@media (max-width: 760px) {
  #app, #app.side-collapsed { grid-template-columns: 0 1fr; }
  .sidebar, #app.side-collapsed .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: min(300px, 86vw);
    border-radius: 0; transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow);
  }
  #app:not(.side-open) .sidebar { box-shadow: none; }
  #app.side-open .sidebar { transform: none; }
  #app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 15, 15, 0.35); z-index: 19; }
  .menu-toggle { display: inline-grid !important; }
  .side-resize, .side-collapse { display: none; }
  .crumb-title { max-width: 110px; }
  .save-state { display: none; }
  .page { padding-top: 20px; }
  .page-title { font-size: 30px; }
  .page-icon { font-size: 40px; }
  .prop-row { flex-direction: column; gap: 0; }
  .prop-name { width: 100%; padding-bottom: 0; }
  .db-tools { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .db-search { flex: 1; }
  .board-col { flex-basis: 240px; }
  .peek { width: 100%; }
  .cal-day { min-height: 70px; }
  .cal-item { font-size: 11px; padding: 1px 4px; }
  .seg { grid-template-columns: 42px 1fr; }
  .seg-who { display: none; }
  .home-hello { font-size: 26px; }
}
@media (max-width: 480px) {
  .topbar .small { display: none; }
  .crumbs .crumb:not(:last-child), .crumbs .crumb-sep { display: none; }
}

/* ---------- v0.4: ícones, capas, ambientes, IA, caixa de entrada, administração ---------- */

.svg-icon { display: inline-block; flex: none; vertical-align: -0.18em; }
.nav-icon { display: flex; align-items: center; justify-content: center; }
.icon-btn .svg-icon { vertical-align: middle; }
.pg-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; vertical-align: -0.12em; }
.pg-icon-img { width: 1.1em; height: 1.1em; object-fit: cover; border-radius: 3px; vertical-align: -0.15em; }
.pg-icon-svg .svg-icon { width: 1.05em; height: 1.05em; }
.page-icon .pg-icon-img { width: 78px; height: 78px; border-radius: 8px; }
.page-icon .pg-icon-svg .svg-icon { width: 64px; height: 64px; }
.tree-icon .pg-icon-img, .search-icon .pg-icon-img, .crumb-icon .pg-icon-img { width: 18px; height: 18px; }
.nav-count { margin-left: auto; min-width: 18px; padding: 0 6px; height: 18px; border-radius: 9px; background: var(--rec); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.side-section-head { cursor: pointer; gap: 4px; justify-content: flex-start; border-radius: 6px; }
.side-section-head:hover { background: var(--hover); }
.side-section-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-section.is-space .side-section-head { color: var(--muted); font-size: 12.5px; }
.side-space-icon { display: inline-flex; font-size: 14px; }
.grow { flex: 1; }

/* Capa e cabeçalho da página */
.page.has-cover { padding-top: 0; }
.page-cover { position: relative; height: 210px; margin: 0 calc(-1 * var(--page-pad)) 8px; background-size: cover; }
.in-peek .page-cover { height: 140px; }
.cover-actions { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.page-cover:hover .cover-actions { opacity: 1; }
.cover-actions button { background: rgba(255, 255, 255, 0.92) !important; color: #37352f !important; }
.page.has-cover .page-icon-row { margin-top: -42px; position: relative; }
.page-add-row { display: flex; gap: 4px; align-items: center; }
.page-add-row .add-icon { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); padding: 3px 6px; border-radius: 5px; }
.page-add-row .add-icon:hover { background: var(--hover); color: var(--muted); }
.page.full-width { max-width: none; }
.page.small-text .ProseMirror { font-size: 14px; }
.page.font-serif .ProseMirror, .page.font-serif .page-title { font-family: Lyon-Text, Georgia, "Times New Roman", serif; }
.page.font-mono .ProseMirror, .page.font-mono .page-title { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; }
.locked-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 2px 6px; border-radius: 4px; background: var(--hover); }
.icon-btn.on { color: #e5a00d; }
.ws-crumb { color: var(--muted); }

/* Seletores de ícone e capa */
.picker-pop { padding: 0; }
.picker { width: 380px; max-width: calc(100vw - 32px); }
.picker-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 6px 8px 0; margin-bottom: 8px; }
.list-view .picker-tabs, .ws-body + .picker-tabs, .dialog .picker-tabs { padding-left: 0; }
.picker-tab { padding: 6px 8px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 4px 4px 0 0; }
.picker-tab:hover { color: var(--text); background: var(--hover); }
.picker-tab.on { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.picker .pop-input { margin: 0 10px 8px; width: calc(100% - 20px); }
.picker-body { max-height: 330px; overflow-y: auto; padding: 0 10px 10px; }
.picker-group { margin-bottom: 6px; }
.picker-label { font-size: 11px; color: var(--faint); font-weight: 600; margin: 6px 0 4px; }
.picker .emoji-grid { grid-template-columns: repeat(10, 1fr); margin-bottom: 0; }
.picker .emoji { font-size: 20px; height: 32px; }
.color-row { display: flex; gap: 6px; margin: 4px 0 10px; }
.color-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.color-dot.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.icon-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.icon-cell { height: 36px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.icon-cell:hover { background: var(--hover); }
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.cover-cell { height: 54px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.cover-cell:hover { outline: 2px solid var(--accent); }
.picker-upload { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 8px 0; }
.picker-upload .pop-input { margin: 0; width: 100%; }

/* Menções */
.mention { border-radius: 4px; padding: 0 3px; font-weight: 500; cursor: default; white-space: nowrap; }
.mention-user { color: var(--accent); background: var(--accent-soft); }
.mention-page { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; cursor: pointer; }
.mention-page:hover { background: var(--hover); }
.mention-date, .mention-reminder { color: var(--muted); }
.mention-reminder { color: #c4554d; }

/* IA */
.fb-ai { color: #8a52d6 !important; font-weight: 600; }
.ai-pop { padding: 4px; }
.ai-menu { width: 300px; }
.ai-prompt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: #8a52d6; }
.ai-prompt .pop-input { flex: 1; margin: 0; }
.ai-prompt.wide { width: min(560px, calc(100vw - 40px)); }
.ai-pop.result { width: min(620px, calc(100vw - 40px)); }
.ai-result { padding: 10px 12px; }
.ai-out { max-height: 360px; overflow-y: auto; font-size: 14px; line-height: 1.55; }
.ai-out :first-child { margin-top: 0; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.spinner { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ask-view { max-width: 820px; margin: 0 auto; padding: 48px clamp(20px, 6vw, 72px) 80px; }
.ask-view h1 { display: flex; align-items: center; gap: 10px; font-size: 30px; margin: 0 0 6px; }
.ask-view h1 .svg-icon { color: #8a52d6; }
.ask-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 18px 0 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.ask-input { width: 100%; border: 0 !important; box-shadow: none !important; resize: vertical; font-size: 15px; background: transparent; }
.ask-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ask-item { margin-bottom: 26px; }
.ask-q { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 8px 12px; background: var(--hover); border-radius: 8px; display: inline-block; }
.ask-answer { line-height: 1.6; }
.ask-answer .ordo-link { color: var(--accent); }
.ask-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ask-sources .chip { cursor: pointer; }
.task-preview { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 6px; border: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* Comentários */
.comments-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comments-head h4 { margin: 0; display: flex; gap: 6px; align-items: center; }
.count { background: var(--hover); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.comment { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.comment.resolved { opacity: 0.6; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .icon-btn { opacity: 0; }
.comment:hover .comment-head .icon-btn { opacity: 1; }
.comment-text { white-space: pre-wrap; font-size: 14px; margin-top: 2px; }
.history { margin-top: 10px; }

/* Telas de lista: caixa de entrada, minhas tarefas, administração */
.list-view { max-width: 860px; margin: 0 auto; padding: 44px clamp(20px, 6vw, 72px) 80px; }
.list-view.wide { max-width: 1180px; }
.list-view h1 { display: flex; align-items: center; gap: 10px; font-size: 30px; margin: 0 0 14px; }
.list-view h3 { font-size: 14px; color: var(--muted); margin: 28px 0 10px; }
.inbox-item { position: relative; display: flex; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 8px; cursor: pointer; }
.inbox-item:hover { background: var(--hover); }
.inbox-item.unread .inbox-text { font-weight: 500; }
.inbox-kind { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }
.inbox-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-page { font-size: 13px; color: var(--muted); }
.inbox-actions { display: flex; gap: 2px; opacity: 0; }
.inbox-item:hover .inbox-actions { opacity: 1; }
.unread-dot { position: absolute; left: 3px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.inbox-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.inbox-empty-icon { display: flex; justify-content: center; color: var(--faint); margin-bottom: 10px; }
.tasks-group { margin-bottom: 22px; }
.tasks-db { font-weight: 600; font-size: 14px; padding: 4px 6px; border-radius: 5px; margin-bottom: 4px; }
.tasks-db:hover { background: var(--hover); }
.task-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; border-bottom: 1px solid var(--line); }
.task-item:hover { background: var(--hover); }
.task-item.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-code { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 52px; }
.task-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.task-due.late { color: var(--danger); font-weight: 600; }
.task-due.today { color: #d9730d; font-weight: 600; }
.task-when { min-width: 70px; text-align: right; }
.admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table tr.blocked td { opacity: 0.55; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.matrix th { min-width: 130px; }
.access-sel.has { font-weight: 500; color: var(--accent); }
.space-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.space-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.space-card.archived { opacity: 0.6; }
.space-card-head { display: flex; align-items: center; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-tile { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.billing { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #448361; }
.chart-box { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--hover); }
.chart-tip { position: absolute; top: 6px; width: 180px; background: var(--bg); box-shadow: var(--shadow); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; }
.people-pick { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin: 8px 0; }
.person-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; }
.person-row:hover { background: var(--hover); }
.ws-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ws-name-row input { flex: 1; font-size: 16px; }
.ws-icon-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); font-size: 22px; display: flex; align-items: center; justify-content: center; }
.ws-icon-btn .pg-icon-svg .svg-icon { width: 22px; height: 22px; }
.ws-add { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ws-members { margin-bottom: 10px; }
.ws-title { display: flex; align-items: center; gap: 6px; }
.role-help { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.reminder-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.reminder-row { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.versions { display: grid; grid-template-columns: 220px 1fr; gap: 12px; height: min(520px, 60vh); }
.versions-list { overflow-y: auto; border-right: 1px solid var(--line); padding-right: 8px; display: flex; flex-direction: column; gap: 2px; }
.version-item { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 8px; border-radius: 6px; text-align: left; }
.version-item:hover { background: var(--hover); }
.version-item.on { background: var(--active); }
.version-preview { overflow-y: auto; padding: 0 8px; }
.dialog.versions-dialog { width: min(960px, calc(100vw - 32px)); }

/* Importação */
.import-dialog .import-body { max-height: min(70vh, 640px); overflow-y: auto; }
.import-summary { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.import-summary p { margin: 0 0 6px; }
.import-dbs { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.import-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.import-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.import-row select { max-width: 260px; }
.import-check { display: flex; gap: 6px; align-items: flex-start; margin: 14px 0 6px; font-size: 13px; }
.dialog h4 { font-size: 13px; color: var(--muted); margin: 18px 0 6px; }

/* ---------- v0.4.2: banco embutido na página ---------- */
.dbv { margin: 14px 0 18px; position: relative; }
.dbv.ProseMirror-selectednode { outline: 2px solid var(--accent-soft); border-radius: 6px; }
.dbv-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dbv-title { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; padding: 2px 6px 2px 2px; border-radius: 6px; background: none; border: 0; color: var(--text); }
.dbv-title:hover { background: var(--hover); }
.dbv-icon { display: inline-flex; font-size: 20px; }
.dbv-body .db { margin-top: 4px; }
.dbv-body .board { max-height: 640px; }
.share-chip-list { display: contents; }

/* Conversa por voz no Perguntar ao Ordo */
.ask-buttons { display: flex; gap: 6px; }
.voice-start { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 12px; }
.voice-start:hover { background: var(--hover); }
.voice-panel { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: -8px 0 24px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.voice-main { display: flex; align-items: center; gap: 18px; }
.voice-info { min-width: 0; }
.voice-status { font-size: 15px; font-weight: 500; }
.voice-error { color: var(--danger); }
.voice-error:empty { display: none; }
.voice-orb { --lvl: 0; flex: none; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #b98ae8, #8a52d6 60%, #5b2fa3);
  transform: scale(calc(0.85 + var(--lvl) * 0.35)); transition: transform 0.1s linear, opacity 0.2s; box-shadow: 0 0 calc(var(--lvl) * 28px) rgba(138, 82, 214, 0.55); }
.voice-panel[data-state="starting"] .voice-orb, .voice-panel.muted .voice-orb { opacity: 0.35; }
.voice-panel[data-state="transcribing"] .voice-orb, .voice-panel[data-state="thinking"] .voice-orb { animation: voice-think 1.2s ease-in-out infinite; }
.voice-panel[data-state="speaking"] .voice-orb { animation: voice-speak 0.9s ease-in-out infinite; }
@keyframes voice-think { 50% { transform: scale(0.75); opacity: 0.7; } }
@keyframes voice-speak { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .voice-orb { animation: none !important; transition: none; } }
.voice-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-actions button { display: inline-flex; align-items: center; gap: 4px; }
.voice-panel:not([data-state="hearing"]) .voice-actions button:nth-child(2) { display: none; }
.voice-panel:not([data-state="thinking"]):not([data-state="speaking"]) .voice-actions button:nth-child(3) { display: none; }
.voice-option { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ask-q .svg-icon { vertical-align: -2px; color: #8a52d6; }

/* ---------- Edição simultânea ---------- */
.presence { display: inline-flex; align-items: center; margin-right: 8px; }
.presence .avatar + .avatar { margin-left: -4px; }
.presence-more { font-size: 11px; color: var(--muted); margin-left: 4px; }
.collab-caret {
  position: relative; margin-left: -1px; margin-right: -1px; border-left: 2px solid; border-right: 0;
  word-break: normal; pointer-events: none;
}
.collab-caret-label {
  position: absolute; top: -1.35em; left: -2px; padding: 1px 6px; border-radius: 4px 4px 4px 0;
  color: #fff; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; user-select: none;
  font-style: normal; text-decoration: none;
}
.collab-selection { border-radius: 2px; }

/* Equipe e organograma (como o do Teams) */
.avatar.md { width: 32px; height: 32px; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.team-toolbar { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.team-toolbar .picker-tabs { border-bottom: 0; margin-bottom: 0; flex: 1; }
.team-search { width: min(320px, 100%); margin-bottom: 6px; }
.team-nohit { padding: 8px 10px; margin: 0; }
.team-person { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .team-person { grid-template-columns: minmax(0, 1fr); } }
.org-chart { display: flex; flex-direction: column; align-items: center; padding: 8px 0 24px; min-width: 0; }
.org-chain { display: flex; flex-direction: column; align-items: center; }
.org-step { display: flex; flex-direction: column; align-items: center; }
.org-step::after { content: ""; width: 1px; height: 18px; background: var(--faint); }
.org-step.focus::after { display: none; }
.org-chart:has(.org-reports) .org-step.focus::after { display: block; }
.org-card {
  position: relative; display: flex; align-items: center; gap: 10px; width: 240px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.06);
}
.org-card:hover { background: var(--hover); border-color: var(--faint); }
.org-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.org-card.compact { width: 210px; padding: 7px 10px; }
.org-card.big { width: 300px; padding: 14px 16px; border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); cursor: default; }
.org-card.big strong { font-size: 16px; }
.org-card.dragging { opacity: 0.45; }
.org-card.drop, .org-topdrop.drop { border-color: var(--accent); background: var(--accent-soft); }
.org-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.org-card-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-dep { display: inline-block; align-self: flex-start; padding: 0 6px; border-radius: 3px; background: var(--c-blue); color: var(--t-blue); font-size: 12px; line-height: 18px; margin-top: 2px; }
.org-count { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--side); border: 1px solid var(--line); font-size: 11px; display: grid; place-items: center; color: var(--muted); }
.org-label { margin: 0 0 10px; }
.org-reports { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--faint); max-width: 100%; }
.org-reports.loose { justify-content: flex-start; border-top: 0; padding-top: 4px; }
.org-hint { margin-top: 18px; }
.org-topdrop { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; text-align: center; margin-bottom: 14px; }
.team-details { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); position: sticky; top: 12px; }
.team-details h2 { margin: 8px 0 0; font-size: 20px; }
.team-lines { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; width: 100%; }
.team-line { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.team-line > span { overflow: hidden; text-overflow: ellipsis; }
.team-line .svg-icon { color: var(--muted); flex: none; }
.team-bio { font-size: 13px; white-space: pre-wrap; margin: 4px 0; }
.team-peers { width: 100%; }
.team-peers h4 { margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.team-peer, .team-row { width: 100%; text-align: left; }
.team-group h3 { margin-top: 20px; }
/* Organograma completo: árvore de cima para baixo com linhas */
.org-full-wrap { overflow-x: auto; padding: 10px 10px 16px; }
.org-full { display: inline-block; min-width: 100%; }
.org-full ul { display: flex; justify-content: center; padding: 18px 0 0; margin: 0; position: relative; list-style: none; }
.org-full > ul { padding-top: 0; }
.org-full li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 18px 8px 0; }
.org-full li::before, .org-full li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 18px; border-top: 1px solid var(--faint); }
.org-full li::after { right: auto; left: 50%; border-left: 1px solid var(--faint); }
.org-full li:only-child::before, .org-full li:only-child::after { display: none; }
.org-full li:only-child { padding-top: 0; }
.org-full li:first-child::before, .org-full li:last-child::after { border: 0; }
.org-full li:last-child::before { border-right: 1px solid var(--faint); }
.org-full ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; border-left: 1px solid var(--faint); }
.org-full > ul > li { padding-top: 0; }
.org-full > ul > li::before, .org-full > ul > li::after { display: none; }
.org-reports:not(.loose) { width: fit-content; }
.org-reports:not(.loose) > .org-card::before { content: ""; position: absolute; top: -15px; left: 50%; height: 14px; border-left: 1px solid var(--faint); }

/* Publicar na web (seção do Compartilhar) */
.publish { padding: 4px 14px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.publish-status { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.publish-status > svg { flex: none; color: var(--muted); }
.publish-status.on > svg { color: var(--accent); }
.publish-link { display: flex; align-items: center; gap: 6px; }
.publish-link input { min-width: 0; font-size: 13px; padding: 4px 8px; color: var(--muted); }
.publish-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; padding: 2px 0; }
.publish-opt input { margin-top: 3px; accent-color: var(--accent); }
.publish-actions { display: flex; justify-content: flex-end; }
.share-btn .published-dot { color: var(--accent); display: inline-flex; }
.online-list { display: flex; flex-wrap: wrap; gap: 6px; }
.online-list .chip { gap: 4px; }
.admin-table td .chip.small { margin-left: 6px; font-size: 11px; line-height: 16px; }

/* Conteúdo de um ambiente ou página sem acesso (como no Notion) */
.rel-chip.locked { color: var(--faint); cursor: not-allowed; border-style: dashed; }
.rel-chip.locked:hover { border-color: var(--line); }
.page-link.locked { cursor: not-allowed; }
.page-link.locked:hover { background: none; }
.mention-page.locked { color: var(--faint); text-decoration: none; cursor: not-allowed; }
.mention-page.locked:hover { background: none; }
.dbv-title.locked { color: var(--faint); cursor: not-allowed; }
.dbv-locked { padding: 10px 2px; font-size: 13px; }

/* ---------- v0.7: tarefas da reunião e versão web/celular ---------- */

.mb-tasks { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.mb-tasks.done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 12px; color: var(--muted); }
.mb-tasks .task-preview { max-height: 280px; margin: 8px 0; }
.mb-tasks-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mb-tasks-actions select { flex: 1; min-width: 180px; }
.mb-tasks .check { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
/* App instalado no celular (PWA): respeita o entalhe e a barra de gestos. */
@supports (padding: env(safe-area-inset-top)) {
  body.web .topbar { padding-top: max(var(--topbar-pad, 0px), env(safe-area-inset-top)); }
  body.web .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.web .view { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 760px) {
  body.web input, body.web select, body.web textarea { font-size: 16px; } /* o iPhone não dá zoom ao focar */
}
.mb-bot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.mb-bot p { margin: 0; }
.rec-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e03e3e; animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: 0.3; } }
.bot-section .bot-cmd { display: block; margin: 8px 0; padding: 10px; border-radius: 6px; background: var(--hover, rgba(127,127,127,0.12)); font-size: 12px; word-break: break-all; user-select: all; }
