:root {
  --bg: #1a1a1a;
  --bg-side: #141414;
  --bg-elev: #202020;
  --bg-hover: #262626;
  --bg-active: #2e2e2e;
  --text: #e4e4e3;
  --text-soft: #b4b4b1;
  --muted: #6f6f6c;
  --border: #2c2c2c;
  --border-soft: #242424;
  --accent: #7aa2f7;
  --accent-dim: rgba(122, 162, 247, 0.14);
  --danger: #e06c75;
  --ok: #98c379;
  --radius: 8px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --fs: 15.5px;
  --lh: 1.65;
}
html[data-theme="light"] {
  --bg: #ffffff; --bg-side: #f7f7f5; --bg-elev: #ffffff; --bg-hover: #efefee; --bg-active: #e6e6e4;
  --text: #37352f; --text-soft: #5f5e5a; --muted: #9b9a97; --border: #e3e3e1; --border-soft: #ececea;
  --shadow: 0 12px 40px rgba(0,0,0,.14);
}
html[data-density="compact"] { --fs: 14px; --lh: 1.45; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);
  color: var(--text); background: var(--bg); font-size: var(--fs); -webkit-font-smoothing: antialiased;
}
body[data-font="serif"] { --font-ui: Georgia, "Times New Roman", serif; }
body[data-font="mono"] { --font-ui: "JetBrains Mono", ui-monospace, Consolas, monospace; }
button { font-family: inherit; cursor: pointer; color: inherit; }
.hidden { display: none !important; }
svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico { width: 17px; height: 17px; flex-shrink: 0; }
::selection { background: var(--accent-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }

#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
#sidebar { width: var(--side-w, 268px); flex-shrink: 0; background: var(--bg-side); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; transition: margin-left .22s cubic-bezier(.4,0,.2,1); position: relative; }
#sidebar.collapsed { margin-left: calc(-1 * var(--side-w, 268px)); }
#sideResize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: ew-resize; z-index: 10; }
#sideResize:hover, #sideResize.dragging { background: var(--accent-dim, rgba(122,162,247,.2)); }
body.side-resizing #sidebar { transition: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.logo { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.logo .mark { width: 18px; height: 18px; color: var(--accent); }
.side-actions { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.side-btn { background: var(--accent); color: #0d1626; border: none; padding: 8px 12px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: filter .15s, transform .05s; }
.side-btn:hover { filter: brightness(1.08); }
.side-btn:active { transform: translateY(1px); }
.market-side-btn { background: var(--accent); color: #0d1626; border: 1px solid var(--accent); }
.market-side-btn:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); color: #08111f; filter: none; }
#newPage { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.82); }
#newPage:hover { background: #fff; color: #111; filter: none; }
html[data-theme="light"] #newPage { color: #111; border-color: rgba(0,0,0,.35); }
html[data-theme="light"] #newPage:hover { background: #111; color: #fff; }
.storage-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.storage-readout { display: grid; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.storage-meter { width: min(100%, 520px); height: 9px; background: var(--bg-active); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.storage-meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; min-width: 2px; }
.storage-numbers b { color: var(--text); }
.tree { flex: 1; overflow-y: auto; padding: 4px 6px 24px; }
.tree-section { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 10px 4px; font-weight: 600; }
.side-foot { border-top: 1px solid var(--border-soft); padding: 6px; display: flex; flex-direction: column; }
.side-link { background: none; border: none; text-align: left; padding: 7px 10px; border-radius: var(--radius); color: var(--text-soft); font-size: 13.5px; display: flex; align-items: center; gap: 9px; transition: background .12s; }
.side-link:hover { background: var(--bg-hover); color: var(--text); }
.side-link .ico { color: var(--muted); }
.account-link.connected { color: var(--text); }
.account-link.connected .ico { color: var(--accent); }
.account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 12px; }
.auth-tabs .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-card { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; display: grid; gap: 4px; background: var(--bg-soft); }
.auth-kicker { margin: 0; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.auth-note { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 8px 0 12px; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.auth-form input { width: 100%; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: var(--radius); padding: 9px 10px; font-weight: 650; cursor: pointer; }
.google-btn:hover { background: var(--bg-hover); }
.google-btn span { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: #fff; color: #1f1f1f; font-weight: 800; }
.auth-actions { margin-top: 2px; }

/* Tree nodes */
.node { user-select: none; }
.node-row { display: flex; align-items: center; gap: 3px; padding: 4px 6px; border-radius: var(--radius); cursor: pointer; font-size: 13.8px; color: var(--text-soft); position: relative; transition: background .1s; }
.node-row:hover { background: var(--bg-hover); color: var(--text); }
.node-row.active { background: var(--bg-active); color: var(--text); }
.node-row.drop-into { box-shadow: inset 0 0 0 1.5px var(--accent); }
.node-row.drop-before::before, .node-row.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--accent); border-radius: 2px; }
.node-row.drop-before::before { top: -1px; }
.node-row.drop-after::after { bottom: -1px; }
.node-arrow { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; border-radius: 4px; }
.node-arrow:hover { background: var(--bg-active); color: var(--text); }
.node-arrow svg { width: 11px; height: 11px; stroke-width: 2.2; transition: transform .15s; }
.node-arrow.open svg { transform: rotate(90deg); }
.node-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted); font-size: 15px; }
.node-icon .ico { width: 15px; height: 15px; }
.node-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.node-btn { opacity: 0; color: var(--muted); padding: 3px; border: none; background: none; border-radius: 4px; display: flex; }
.node-btn .ico { width: 14px; height: 14px; }
.node-btn:hover { background: var(--bg-active); color: var(--text); }
.node-row:hover .node-btn { opacity: 1; }
.node-row .node-btn.fav-on { opacity: 1; color: var(--accent); }
.node-children { margin-left: 16px; border-left: 1px solid var(--border-soft); padding-left: 2px; }
.node-category .category-row { color: var(--text); font-weight: 650; background: color-mix(in srgb, var(--bg-elev) 72%, transparent); }
.node-category .category-row .node-btn { opacity: 1; }
.node-category .node-title { letter-spacing: 0; }
.editor-share-btn { position: absolute; top: 14px; right: 18px; z-index: 55; border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow-soft); }
.editor-share-btn .ico { width: 17px; height: 17px; }

/* Topbar */
.icon-btn { background: none; border: none; color: var(--muted); padding: 6px; border-radius: var(--radius); display: inline-flex; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.on { color: var(--accent); background: var(--accent-dim); }
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
#topbar { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border-soft); }
#showSide { display: none; }
#sidebar.collapsed ~ #main #showSide { display: inline-flex; } /* r??ouverture quand la sidebar est repli??e */
#breadcrumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; overflow: hidden; }
#breadcrumb .crumb { white-space: nowrap; cursor: pointer; }
#breadcrumb .crumb:hover { color: var(--text); }
.top-nav-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border-soft); }
@media (max-width: 940px) { .top-nav-tools { display: none; } }
.spacer { flex: 1; }
.ghost-btn { background: none; border: 1px solid var(--border); padding: 6px 11px; border-radius: var(--radius); font-size: 12.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; transition: background .12s; }
.ghost-btn:hover { background: var(--bg-hover); color: var(--text); }
.kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--bg-elev); }

/* Reader mode */
body.reader #sidebar, body.reader #topbar > *:not(#readerBtn):not(.spacer), body.reader #ai-panel { display: none !important; }
body.reader #topbar { border: none; justify-content: flex-end; }
body.reader .page { max-width: 660px; font-size: 1.06em; }
body.reader .block .handle, body.reader .backlinks, body.reader .tag-row .tag-add { display: none !important; }

/* Panneau de progression d'upload */
.up-panel { position: fixed; bottom: 18px; right: 18px; z-index: 300; background: var(--bg-elev, #222); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; width: 300px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.up-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.up-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .15s ease; }
.up-info { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Editor */
#editor-wrap { flex: 1; overflow-y: auto; position: relative; }
.booky-view { position: absolute; inset: 0; animation: fade .25s ease; }
.booky-view iframe { width: 100%; height: 100%; border: 0; background: #0a0a0c; }
.page { max-width: 800px; margin: 0 auto; padding: 32px 60px 240px; animation: fade .25s ease; line-height: var(--lh); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.banner { height: 140px; border-radius: 12px; margin-bottom: 18px; }
.empty { max-width: 540px; margin: 14vh auto; text-align: center; color: var(--muted); animation: fade .3s ease; }
.empty h1 { color: var(--text); font-weight: 700; font-size: 30px; }
.page-icon { font-size: 60px; background: none; border: none; line-height: 1; padding: 4px; border-radius: 10px; color: var(--muted); display: inline-flex; transition: background .12s; }
.page-icon:hover { background: var(--bg-hover); }
.page-icon .ico { width: 46px; height: 46px; stroke-width: 1.3; }
.page-title { width: 100%; border: none; outline: none; font-size: 40px; font-weight: 700; padding: 6px 0 4px; color: var(--text); background: none; letter-spacing: -.4px; font-family: inherit; }
.page-title::placeholder { color: var(--bg-active); }
.page-meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 14px; border-bottom: 1px solid var(--border-soft); padding-bottom: 12px; align-items: center; }
.status-chip { border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: var(--bg-elev); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; align-items: center; }
.tag { background: var(--accent-dim); color: var(--accent); border-radius: 20px; padding: 2.5px 11px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.tag button { background: none; border: none; color: inherit; padding: 0; opacity: .6; font-size: 13px; line-height: 1; }
.tag button:hover { opacity: 1; }
.tag-add { background: none; border: 1px dashed var(--border); color: var(--muted); border-radius: 20px; padding: 2.5px 11px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.tag-add:hover { color: var(--text); border-color: var(--muted); }
.tag-add.ai { border-style: solid; }
.tag-input { background: var(--bg-elev); border: 1px solid var(--accent); color: var(--text); border-radius: 20px; padding: 2px 10px; font-size: 12px; outline: none; width: 110px; }

/* TOC */
.toc { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-size: 13.5px; background: var(--bg-elev); }
.toc a { color: var(--text-soft); text-decoration: none; display: block; padding: 2px 0; cursor: pointer; }
.toc a:hover { color: var(--accent); }
.toc .t2 { padding-left: 16px; }
.toc .t3 { padding-left: 32px; }

/* Blocks */
.blocks { display: flex; flex-direction: column; }
.block { position: relative; padding: 2px 0; }
.block[data-align="center"] .ce { text-align: center; }
.block[data-align="right"] .ce { text-align: right; }
.block[data-align="justify"] .ce { text-align: justify; }
.block .handle { position: absolute; left: -28px; top: 3px; opacity: 0; cursor: pointer; color: var(--muted); padding: 3px; border-radius: 4px; display: flex; transition: opacity .12s; }
.block .handle .ico { width: 15px; height: 15px; }
.block:hover .handle { opacity: 1; }
.block .handle:hover { background: var(--bg-hover); color: var(--text); }
.block-voice { position: absolute; left: -54px; top: 3px; opacity: 0; border: none; background: none; color: var(--muted); padding: 3px; border-radius: 4px; display: flex; transition: opacity .12s, background .12s, color .12s; }
.block:hover .block-voice, .block:focus-within .block-voice, .block-voice.on { opacity: 1; }
.block-voice:hover, .block-voice.on { background: var(--accent-dim); color: var(--accent); }
.block-voice .ico { width: 15px; height: 15px; }
.block .cbadge { position: absolute; right: -26px; top: 5px; font-size: 11px; color: var(--accent); cursor: pointer; opacity: .85; }
.ce { outline: none; min-height: 1.5em; line-height: var(--lh); white-space: pre-wrap; word-break: break-word; }
.ce:empty::before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
.b-h1 .ce { font-size: 28px; font-weight: 700; letter-spacing: -.3px; margin-top: 8px; }
.b-h2 .ce { font-size: 22px; font-weight: 600; margin-top: 6px; }
.b-h3 .ce { font-size: 18px; font-weight: 600; }
.b-quote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-soft); font-style: italic; }
.b-code { background: #0f0f0f; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 13.5px; color: #cdd6f4; }
html[data-theme="light"] .b-code { background: #f6f6f4; color: #37352f; }
.b-code .ce { white-space: pre; overflow-x: auto; }
.b-divider hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.b-bullet, .b-numbered, .b-todo { display: flex; gap: 9px; align-items: flex-start; }
.b-bullet .ce, .b-numbered .ce, .b-todo .ce { flex: 1; }
.b-marker { color: var(--muted); flex-shrink: 0; min-width: 16px; padding-top: 1px; }
.b-todo input { margin-top: 6px; accent-color: var(--accent); }
.b-todo.done .ce { text-decoration: line-through; color: var(--muted); }
.b-image img { max-width: 100%; border-radius: 10px; display: block; border: 1px solid var(--border-soft); }
.b-image .cap { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; outline: none; }
.b-callout { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; gap: 11px; }
.b-callout .b-marker { color: var(--accent); }
.b-file a { color: var(--text-soft); text-decoration: none; display: inline-flex; gap: 9px; align-items: center; border: 1px solid var(--border); padding: 9px 13px; border-radius: 8px; background: var(--bg-elev); }
.b-file a:hover { border-color: var(--accent); color: var(--text); }

/* Nouveaux blocs */
.b-table { overflow-x: auto; }
.b-table table { border-collapse: collapse; width: 100%; font-size: 13.8px; }
.b-table td, .b-table th { border: 1px solid var(--border); padding: 7px 11px; min-width: 80px; outline: none; }
.b-table tr:first-child td { background: var(--bg-elev); font-weight: 600; cursor: pointer; }
.b-table .tbl-bar { display: flex; gap: 6px; margin-top: 6px; opacity: 0; transition: opacity .12s; align-items: center; }
.b-table:hover .tbl-bar { opacity: 1; }
.b-table .tbl-filter { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 3px 8px; font-size: 12px; outline: none; width: 140px; }
.b-toggle { border-radius: 8px; }
.b-toggle .tg-head { display: flex; gap: 7px; align-items: flex-start; cursor: pointer; }
.b-toggle .tg-arrow { color: var(--muted); padding-top: 3px; transition: transform .15s; }
.b-toggle.open .tg-arrow { transform: rotate(90deg); }
.b-toggle .tg-body { margin: 4px 0 4px 24px; padding-left: 12px; border-left: 1px solid var(--border); color: var(--text-soft); }
.b-video iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 10px; background: #000; }
.b-audio audio { width: 100%; }
.b-embed iframe { width: 100%; height: 360px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); }
.b-embed.b-app iframe { height: 78vh; } /* app web embarqu??e : quasi plein ??cran */
/* Page app : le site prend tout l'espace, habillage masqu?? */
.page.app-page { max-width: none; padding: 0; }
.page.app-page .page-icon-row, .page.app-page .page-title, .page.app-page .tag-row,
.page.app-page .page-meta, .page.app-page .toc, .page.app-page .backlinks,
.page.app-page .props-panel, .page.app-page .pinned-panel, .page.app-page .banner,
.page.app-page .db-panel, .page.app-page .block .handle { display: none !important; }
.page.app-page .blocks, .page.app-page .block { margin: 0; padding: 0; }
.page.app-page .b-embed.b-app iframe { height: calc(100vh - 54px); border: 0; border-radius: 0; display: block; }
.b-gallery .g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.b-gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-soft); cursor: pointer; }
.b-cols { display: flex; gap: 18px; }
.b-cols .col { flex: 1; border: 1px dashed var(--border-soft); border-radius: 8px; padding: 10px; min-height: 50px; }
.b-spoiler .sp-body { filter: blur(5px); cursor: pointer; transition: filter .2s; user-select: none; }
.b-spoiler.revealed .sp-body { filter: none; user-select: auto; cursor: text; }
.b-spoiler .sp-tag { font-size: 11px; color: var(--muted); }
.b-progress { display: flex; align-items: center; gap: 10px; }
.b-progress .bar { flex: 1; height: 8px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.b-progress .fill { height: 100%; background: var(--accent); transition: width .2s; }
.b-progress input[type=range] { width: 90px; accent-color: var(--accent); }

mark { padding: 0 2px; border-radius: 3px; color: #1a1a1a; }
.ce a { color: var(--accent); text-underline-offset: 2px; }
.ce a.mention { background: var(--accent-dim); border-radius: 4px; padding: 0 4px; text-decoration: none; font-weight: 500; }
.ce code { background: rgba(127,127,127,.13); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-family: ui-monospace, monospace; font-size: .9em; }
sup, sub { font-size: .75em; }

.media-missing-box { border: 1px dashed color-mix(in srgb, var(--danger) 45%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--danger) 8%, var(--bg-elev)); color: var(--text); padding: 12px; display: grid; gap: 7px; max-width: 520px; }
.media-missing-box strong { font-size: 13px; }
.media-missing-box span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.media-missing-box .mini { justify-self: start; }
/* Backlinks */
.backlinks { margin-top: 40px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.backlinks h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.backlink-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 11px; margin: 0 6px 6px 0; font-size: 13px; cursor: pointer; color: var(--text-soft); }
.backlink-item:hover { border-color: var(--accent); color: var(--text); }

/* Slash / mention / block menus */
.slash, .fmtbar { position: absolute; z-index: 100; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.slash { width: 290px; max-height: 330px; overflow-y: auto; padding: 6px; }
#slash { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px)); padding: 10px; }
.slash-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.slash-group { min-width: 0; }
.slash-grid { display: grid; gap: 4px; }
.slash-head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 8px 4px; }
#slash .slash-head { padding: 0 2px 5px; }
.slash-item { display: flex; gap: 11px; align-items: center; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
#slash .slash-item { min-height: 44px; padding: 6px 7px; }
.slash-item.sel, .slash-item:hover { background: var(--bg-hover); }
.slash-ico { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-soft); background: var(--bg); flex-shrink: 0; }
#slash .slash-ico { width: 30px; height: 30px; }
.slash-ico .ico { width: 16px; height: 16px; }
.slash-t { font-size: 13.5px; color: var(--text); }
.slash-d { font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { #slash { width: calc(100vw - 24px); } .slash-groups { grid-template-columns: 1fr; } }
.fmtbar { display: flex; padding: 4px; gap: 1px; align-items: center; flex-wrap: wrap; max-width: 480px; }
.fmtbar button { background: none; border: none; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; color: var(--text-soft); display: inline-flex; align-items: center; min-width: 28px; justify-content: center; }
.fmtbar button:hover { background: var(--bg-hover); color: var(--text); }
.fmtbar .sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 3px; }
.fmtbar .sw { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); padding: 0; min-width: 0; }
.fmtbar .sw:hover { transform: scale(1.12); }

/* AI panel */
#ai-panel { width: 400px; flex-shrink: 0; border-left: 1px solid var(--border-soft); display: flex; flex-direction: column; background: var(--bg-side); }
.ai-head { display: flex; align-items: center; gap: 4px; padding: 12px 12px 10px 16px; font-weight: 600; font-size: 14px; }
.ai-title { display: flex; align-items: center; gap: 8px; flex: 1; letter-spacing: -.01em; font-size: 15px; }
.ai-title .ico { color: var(--accent); }

/* Barre mod??le + donn??es ??? pills fa??on Apple */
.ai-toolbar { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
.ai-model-pill { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ai-model-pill:hover { border-color: var(--accent); }
.ai-model-pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ai-model-pill .ico { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.ai-model-pill .chev { width: 12px; height: 12px; }
.ai-model { appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 12.5px; font-weight: 500; outline: none; cursor: pointer; text-overflow: ellipsis; }
.ai-switch { display: flex; align-items: center; gap: 7px; cursor: pointer; flex-shrink: 0; font-size: 12px; color: var(--muted); user-select: none; }
.ai-switch input { display: none; }
.ai-switch .knob { width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; }
.ai-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s cubic-bezier(.4,0,.2,1); }
.ai-switch input:checked + .knob { background: #34c759; }
.ai-switch input:checked + .knob::after { transform: translateX(14px); }
.ai-status { margin: -2px 14px 10px; align-self: flex-start; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev); color: var(--muted); padding: 4px 10px; font-size: 11.5px; cursor: pointer; }
.ai-status.ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); color: var(--ok); }
.ai-status.bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.ai-status:hover { background: var(--bg-hover); }
/* Chips d'actions ??? d??filement horizontal */
.ai-quick { display: flex; gap: 6px; padding: 0 14px 12px; overflow-x: auto; scrollbar-width: none; }
.ai-quick::-webkit-scrollbar { display: none; }
.ai-quick .chip { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.ai-quick .chip:hover { background: var(--bg-elev); border-color: var(--accent); }

/* ??tat nouveau chat ??? h??ro centr??, input remont?? ; il glisse en bas au 1er message */
.ai-hero { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; animation: fade .3s ease; }
#ai-panel.fresh .ai-hero { display: flex; flex: 1; }
#ai-panel.fresh .ai-messages { display: none; }
.ai-spacer { flex: 0 1 0; transition: flex-grow .35s cubic-bezier(.4,0,.2,1); }
#ai-panel.fresh .ai-spacer { flex-grow: 1; }
.ai-hero-orb { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; color: #fff; background: linear-gradient(135deg, var(--accent), #a855f7); box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 40%, transparent); }
.ai-hero-orb .ico { width: 26px; height: 26px; }
.ai-hero h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.ai-hero p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.ai-suggest { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 280px; }
.ai-suggest button { padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 13px; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.ai-suggest button:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* Conversation */
.ai-messages { flex: 1; overflow-y: auto; padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.ai-msg { padding: 10px 14px; border-radius: 18px; font-size: 13.8px; line-height: 1.55; white-space: pre-wrap; animation: msgin .25s cubic-bezier(.2,.8,.3,1); }
@keyframes msgin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.ai-msg.user { background: var(--accent); color: #fff; align-self: flex-end; max-width: 82%; font-weight: 450; border-bottom-right-radius: 6px; }
.ai-msg.bot { background: var(--bg-elev); border: 1px solid var(--border-soft); align-self: flex-start; max-width: 94%; border-bottom-left-radius: 6px; }
.ai-msg .msg-act { display: block; margin-top: 8px; }

/* Input capsule */
.ai-input { padding: 8px 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.ai-attach-name { font-size: 11px; color: var(--muted); padding-left: 8px; }
.ai-attach-name:empty { display: none; }
.ai-capsule { display: flex; align-items: flex-end; gap: 6px; padding: 6px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-elev); transition: border-color .15s, box-shadow .15s; }
.ai-capsule:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ai-capsule textarea { flex: 1; resize: none; border: 0; background: transparent; padding: 7px 4px; font-family: inherit; font-size: 13.8px; line-height: 1.45; color: var(--text); outline: none; max-height: 140px; }
.cap-btn { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.cap-btn:hover { background: var(--border-soft); color: var(--text); }
.cap-btn.send { background: var(--accent); color: #fff; }
.cap-btn.send:hover { filter: brightness(1.1); }
.cap-btn.send:active { transform: scale(.92); }
.cap-btn .ico { width: 16px; height: 16px; }

/* Modal & palette */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 200; animation: fade .15s ease; }
.modal-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 22px; width: 500px; max-width: 92vw; max-height: 82vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-card h3 { margin-top: 0; font-weight: 600; }
.modal-card p { color: var(--text-soft); }
.modal-card input[type=text], .modal-card input[type=password], .modal-card textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 7px; margin: 8px 0; font-size: 14px; background: var(--bg); color: var(--text); outline: none; font-family: inherit; }
.modal-card input:focus, .modal-card textarea:focus { border-color: var(--accent); }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 10px; }
.emoji-grid button { font-size: 22px; border: none; background: none; padding: 7px; border-radius: 7px; }
.emoji-grid button:hover { background: var(--bg-hover); }
.trash-item { display: flex; align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13.8px; }
.trash-item .exp { font-size: 11.5px; color: var(--danger); margin-left: auto; white-space: nowrap; }
.market-list { display: flex; flex-direction: column; gap: 8px; }
.market-card { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.market-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.market-main strong, .market-main span, .market-main small { overflow: hidden; text-overflow: ellipsis; }
.market-main span { color: var(--text-soft); font-size: 12.5px; }
.market-main small { color: var(--muted); font-size: 11.5px; }
.market-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .market-card { align-items: stretch; flex-direction: column; } .market-actions { justify-content: flex-start; } }
.mini { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text-soft); transition: background .12s; }
.mini:hover { background: var(--bg-hover); color: var(--text); }
.mini.on { border-color: var(--accent); color: var(--accent); }
.swatch-row { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); }

.palette { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 250; animation: fade .12s ease; }
.palette-box { width: 580px; max-width: 92vw; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.palette-box input { width: 100%; border: none; border-bottom: 1px solid var(--border); padding: 15px 18px; font-size: 16px; background: none; color: var(--text); outline: none; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-soft); }
.palette-item .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.palette-item .snip { color: var(--muted); font-size: 12px; display: block; }
.palette-item.sel, .palette-item:hover { background: var(--bg-hover); color: var(--text); }
.palette-item .ico, .palette-item .pico { width: 18px; text-align: center; color: var(--muted); flex-shrink: 0; }
.palette-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 14px; }

/* Accueil */
.home { max-width: 1000px; margin: 0 auto; padding: 36px 40px 120px; animation: fade .25s ease; }
.home-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.home-head h1 { font-size: 28px; margin: 0; }
.home-controls { display: flex; gap: 8px; align-items: center; }
.view-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.vbtn { background: none; border: none; padding: 6px 10px; color: var(--muted); display: flex; }
.vbtn.on { background: var(--bg-active); color: var(--text); }
.home-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.home-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 14px; }
.home-overview > div { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 12px; }
.home-overview span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.home-overview strong { display: block; font-size: 24px; line-height: 1; }
.home-block { margin-top: 18px; }
.home-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.home-block-head h2 { margin: 0; font-size: 16px; }
.home-block-head span { color: var(--muted); font-size: 12px; }
.home-section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.home-recent-list, .home-list { display: grid; gap: 7px; }
.home-row { width: 100%; border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text); border-radius: 8px; padding: 10px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; text-align: left; }
.home-row:hover { border-color: var(--accent); background: var(--bg-hover); }
.home-row .pc-title { margin: 0; min-width: 0; }
.home-row .pc-sub { grid-column: 1 / -1; }
.home-status { display: inline-flex; align-items: center; gap: 5px; }
.home-status.muted { color: var(--muted); }
.home-empty { border: 1px dashed var(--border); border-radius: 8px; padding: 30px; text-align: center; color: var(--muted); background: var(--bg-elev); }
.home-empty h2 { margin: 0 0 6px; color: var(--text); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 16px; }
.pcard { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 14px; cursor: pointer; transition: border-color .12s, transform .12s; background: var(--bg-elev); color: var(--text); position: relative; overflow: hidden; text-align: left; }
.pcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.pcard .pc-color { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.pcard .pc-title { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pcard .pc-sub { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }



.kanban { display: flex; gap: 14px; margin-top: 16px; overflow-x: auto; align-items: flex-start; }
.kcol { min-width: 230px; flex: 1; background: var(--bg-side); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px; }
.kcol h4 { margin: 2px 6px 10px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 7px; }
.kcard { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 13.5px; }
.kcard:hover { border-color: var(--accent); }

.share-label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.share-row { display: flex; gap: 8px; margin-bottom: 6px; }
.share-row input { flex: 1; min-width: 0; }
/* Graphe */
.graph-view { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; padding: 18px 22px 20px; background: var(--bg); animation: fade .2s ease; }
.graph-view.hidden { display: none; }
.graph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.graph-head h1 { margin: 0 0 4px; font-size: 25px; letter-spacing: 0; }
.graph-head p { margin: 0; color: var(--muted); font-size: 13px; }
.graph-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; font-size: 12px; color: var(--text-soft); }
.graph-stats span { border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; background: var(--bg-elev); }
.graph-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#graphCanvas { width: 100%; height: 100%; display: block; background: var(--bg); }
.graph-info, .graph-legend { position: absolute; right: 12px; z-index: 1; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg-elev) 92%, transparent); box-shadow: var(--shadow); }
.graph-info { top: 12px; max-width: 320px; padding: 8px 10px; font-size: 12.5px; color: var(--text-soft); }
.graph-legend { bottom: 12px; display: flex; gap: 12px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 22px; border-top: 2px solid var(--accent); display: inline-block; }
.graph-legend .solid { border-top-style: solid; border-color: var(--border); }
.graph-legend .dash { border-top-style: dashed; }

/* Impression / export PDF */
@media print {
  #sidebar, #topbar, #ai-panel, .backlinks, .block .handle, .block .cbadge, .tag-add { display: none !important; }
  body { background: #fff; color: #111; }
  .page { max-width: 100%; padding: 0; }
  #editor-wrap { overflow: visible; }
}

/* ===== v3 ===== */
html[data-theme="nord"] { --bg:#2e3440; --bg-side:#272c36; --bg-elev:#3b4252; --bg-hover:#434c5e; --bg-active:#4c566a; --text:#eceff4; --text-soft:#d8dee9; --muted:#7b88a1; --border:#434c5e; --border-soft:#3b4252; }
html[data-theme="dracula"] { --bg:#282a36; --bg-side:#21222c; --bg-elev:#313241; --bg-hover:#3a3c4e; --bg-active:#44475a; --text:#f8f8f2; --text-soft:#d8d8d2; --muted:#6272a4; --border:#44475a; --border-soft:#34364a; }
html[data-theme="sepia"] { --bg:#f4ecd8; --bg-side:#ece1c8; --bg-elev:#faf4e4; --bg-hover:#e6dac0; --bg-active:#ddd0b2; --text:#433422; --text-soft:#5f4d35; --muted:#9c8a6e; --border:#d8cbae; --border-soft:#e2d6bc; --shadow:0 12px 40px rgba(80,60,20,.18); }
html[data-theme="amoled"] { --bg:#000; --bg-side:#050505; --bg-elev:#101010; --bg-hover:#181818; --bg-active:#222; --text:#e8e8e8; --text-soft:#b5b5b5; --muted:#666; --border:#232323; --border-soft:#161616; }
html[data-motion="off"] *, html[data-motion="off"] *::before { animation: none !important; transition: none !important; }
.page[data-width="narrow"] { max-width: 620px; }
.page[data-width="full"] { max-width: none; padding-left: 40px; padding-right: 40px; }

/* PIN lock */
.pin-lock { position: fixed; inset: 0; background: var(--bg); z-index: 999; display: flex; align-items: center; justify-content: center; }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--muted); }
.pin-box input { font-size: 22px; text-align: center; letter-spacing: 8px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 12px; width: 200px; outline: none; }

/* Onglets */
.tabbar { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; max-width: 180px; }
.tab.on { background: var(--bg-elev); border-color: var(--border-soft); color: var(--text); }
.tab .x { opacity: .5; padding: 0 2px; border: none; background: none; }
.tab .x:hover { opacity: 1; }

/* Find bar / multi-s??lection */
.findbar, .msel-bar { display: flex; gap: 8px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elev); }
.findbar input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 5px 9px; font-size: 13px; outline: none; }
mark.findhit { background: var(--accent); color: #0d1626; }
.msel-bar { font-size: 13px; color: var(--text-soft); }
.block.msel { background: var(--accent-dim); border-radius: 6px; }

/* Split view */
.main-split { flex: 1; display: flex; overflow: hidden; }
.main-split #editor-wrap { flex: 1; }
.split-pane { width: 44%; border-left: 1px solid var(--border-soft); display: flex; flex-direction: column; background: var(--bg-side); }
.split-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); font-weight: 600; font-size: 13.5px; }
.split-body { flex: 1; overflow-y: auto; padding: 20px 26px; font-size: 14px; line-height: 1.6; }

/* Minimap */
.minimap { position: absolute; right: 8px; top: 120px; display: flex; flex-direction: column; gap: 7px; z-index: 30; }
.minimap .mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; }
.minimap .mdot:hover, .minimap .mdot.h1 { background: var(--accent); }
.minimap .mdot.h2 { width: 6px; height: 6px; }

/* Propri??t??s */
.props-panel { border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.prop-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.prop-row .pname { color: var(--muted); min-width: 120px; display: flex; gap: 6px; align-items: center; }
.prop-row input, .prop-row select { background: var(--bg-elev); border: 1px solid transparent; color: var(--text); border-radius: 5px; padding: 3px 7px; font-size: 13px; outline: none; flex: 1; max-width: 280px; }
.prop-row input:focus, .prop-row select:focus { border-color: var(--accent); }
.prop-rel { background: var(--accent-dim); color: var(--accent); border-radius: 5px; padding: 2px 8px; cursor: pointer; font-size: 12px; }

/* Blocs ??pingl??s */
.pinned-panel { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; background: var(--accent-dim); }
.pinned-panel .pp-item { padding: 2px 0; cursor: pointer; }

/* Base de donn??es (sous-pages) */
.db-panel { margin-top: 30px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.db-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.db-head h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.db-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.db-table th, .db-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; position: relative; }
.db-table th { background: var(--bg-elev); font-weight: 600; font-size: 12.5px; color: var(--text-soft); cursor: pointer; user-select: none; }
.db-table td input, .db-table td select { background: none; border: none; color: var(--text); width: 100%; font-size: 13.5px; outline: none; font-family: inherit; }
.db-table .db-title { color: var(--accent); cursor: pointer; font-weight: 500; }
.db-table tfoot td { color: var(--muted); font-size: 12px; background: var(--bg-elev); cursor: pointer; }
.col-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.db-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.db-cal .cal-cell { border: 1px solid var(--border-soft); border-radius: 7px; min-height: 74px; padding: 4px 6px; font-size: 11.5px; }
.db-cal .cal-cell .cd { color: var(--muted); }
.db-cal .cal-cell.today { border-color: var(--accent); }
.db-cal .cal-pg { background: var(--accent-dim); color: var(--accent); border-radius: 4px; padding: 1px 5px; margin-top: 3px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.db-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.db-gal .gcard { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-elev); }
.db-gal .gcard:hover { border-color: var(--accent); }
.db-gal .gimg { height: 95px; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.db-gal .gimg img { width: 100%; height: 100%; object-fit: cover; }
.db-gal .gtit { padding: 8px 10px; font-size: 13px; font-weight: 500; }
.db-tl { position: relative; }
.db-tl .tl-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.db-tl .tl-label { width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--text-soft); }
.db-tl .tl-track { flex: 1; height: 18px; position: relative; background: var(--bg-elev); border-radius: 5px; }
.db-tl .tl-bar { position: absolute; top: 3px; bottom: 3px; background: var(--accent); border-radius: 4px; min-width: 8px; opacity: .85; }
.filter-chip { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 2px 9px; font-size: 11.5px; color: var(--text-soft); display: inline-flex; gap: 5px; align-items: center; }

/* Blocs v3 */
.b-code { position: relative; }
.b-code .code-bar { position: absolute; top: 6px; right: 8px; display: flex; gap: 5px; opacity: 0; transition: opacity .12s; }
.b-code:hover .code-bar { opacity: 1; }
.b-code select { background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted); font-size: 11px; border-radius: 5px; }
.tok-k { color: #c678dd; } .tok-s { color: #98c379; } .tok-c { color: #5c6370; font-style: italic; } .tok-n { color: #d19a66; } .tok-f { color: #61afef; }
.b-secret, .b-cred { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.b-secret .sec-row { display: flex; gap: 8px; align-items: center; }
.b-secret input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 7px 10px; font-family: ui-monospace, monospace; outline: none; }
.strength { height: 4px; border-radius: 3px; margin-top: 8px; background: var(--bg-hover); overflow: hidden; }
.strength > div { height: 100%; transition: width .2s; }
.b-cred .cr-grid { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.b-cred .cr-grid label { color: var(--muted); font-size: 12px; }
.b-cred .cr-grid input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 5px 9px; font-size: 13px; outline: none; }
.b-math { text-align: center; padding: 8px; }
.b-math .math-src { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--muted); outline: none; }
.b-math .math-view { font-size: 19px; font-family: Georgia, serif; font-style: italic; padding: 6px; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .85em; }
.frac .fn { border-bottom: 1px solid currentColor; padding: 0 3px; }
.b-draw canvas { border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: crosshair; touch-action: none; max-width: 100%; }
.b-draw .draw-bar { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.b-mindmap .mm-node { margin-left: 22px; padding: 2px 0; border-left: 1px solid var(--border); padding-left: 12px; }
.b-mindmap .mm-root { font-weight: 700; font-size: 15px; }
.b-mindmap .mm-t { outline: none; display: inline-block; min-width: 40px; padding: 1px 6px; border-radius: 5px; }
.b-mindmap .mm-t:hover { background: var(--bg-hover); }
.b-mindmap .mm-add { opacity: .4; border: none; background: none; color: var(--accent); font-size: 12px; }
.b-mindmap .mm-add:hover { opacity: 1; }
.b-bookmark a { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text); background: var(--bg-elev); }
.b-bookmark a:hover { border-color: var(--accent); }
.b-bookmark .bk-txt { flex: 1; padding: 11px 14px; min-width: 0; }
.b-bookmark .bk-t { font-weight: 600; font-size: 13.5px; }
.b-bookmark .bk-d { font-size: 12px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-bookmark .bk-u { font-size: 11px; color: var(--accent); margin-top: 4px; }
.b-bookmark .bk-img { width: 130px; flex-shrink: 0; object-fit: cover; }
.b-goal { display: flex; align-items: center; gap: 10px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.b-goal .ce { flex: 0 1 auto; min-width: 80px; }
.b-goal .g-nums { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.b-goal .g-nums button { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 5px; width: 22px; height: 22px; font-size: 13px; line-height: 1; }
.b-quote .q-author { font-size: 12.5px; color: var(--muted); font-style: normal; outline: none; margin-top: 4px; }
.b-quote .q-author::before { content: "- "; }
.b-image { position: relative; }
.b-image.fl-left { float: left; margin: 4px 18px 8px 0; max-width: 50%; }
.b-image.fl-right { float: right; margin: 4px 0 8px 18px; max-width: 50%; }
.b-image .img-resize { position: absolute; right: 2px; bottom: 22px; width: 16px; height: 16px; cursor: nwse-resize; background: var(--accent); border-radius: 4px 0 8px 0; opacity: 0; }
.b-image:hover .img-resize { opacity: .8; }
.todo-due { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; background: var(--bg-elev); padding: 1px 4px; margin-top: 5px; opacity: 0; font-family: inherit; }
.b-todo:hover .todo-due, .todo-due.set { opacity: 1; }
.todo-due.late { color: var(--danger); border-color: var(--danger); }
.block.pinned-b { border-left: 2px solid var(--accent); padding-left: 8px; }
.blocks .drop-line { height: 2px; background: var(--accent); border-radius: 2px; margin: 2px 0; }
.wgoal { display:inline-flex; align-items:center; gap:6px; }
.wgoal .wbar { width: 70px; height: 5px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.wgoal .wfill { height: 100%; background: var(--accent); }

/* Typewriter */
body.typewriter #editor-wrap { padding-top: 35vh; padding-bottom: 45vh; }
body.typewriter .block:not(:focus-within) { opacity: .35; }

/* Widgets accueil */
.home-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 16px 0 4px; }
.widget { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg-elev); font-size: 13px; }
.widget h5 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.widget .w-item { width: 100%; border: 0; background: none; padding: 4px 0; cursor: pointer; color: var(--text-soft); display: flex; gap: 7px; align-items: center; text-align: left; }
.widget .w-item:hover { color: var(--text); }
.widget .big { font-size: 26px; font-weight: 700; color: var(--text); }
.widget .w-empty { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

/* Aper??u mention */
.mention-preview { position: absolute; z-index: 150; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 14px; width: 300px; font-size: 12.5px; color: var(--text-soft); pointer-events: none; }
.mention-preview b { color: var(--text); display: block; margin-bottom: 5px; }

/* Mobile */
@media (max-width: 760px) {
  .home-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-pane { display: none; }
  .minimap { display: none; }
  .home-widgets { grid-template-columns: 1fr; }
  #sidebar { position: absolute; z-index: 50; height: 100%; box-shadow: 2px 0 24px rgba(0,0,0,.5); }
  #sidebar.collapsed { margin-left: calc(-1 * var(--side-w, 268px)); }
  #showSide { display: inline-flex; }
  .page { padding: 20px 18px 180px; }
  .page-title { font-size: 30px; }
  .home { padding: 24px 16px 120px; }
  #ai-panel { position: absolute; right: 0; z-index: 60; height: 100%; width: 100%; max-width: 420px; }
  .b-cols { flex-direction: column; }
  .pom-widget { bottom: 70px; left: 50%; transform: translateX(-50%); right: auto; }
}

/* ============================================================
   BLOC PDF INLINE
   ============================================================ */
.b-pdf-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.b-pdf-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--bg-elev); font-size: 13px; border-bottom: 1px solid var(--border); }
.b-pdf-frame { width: 100%; height: 600px; border: none; display: block; }

/* ============================================================
   BLOC MOD??LE 3D
   ============================================================ */
.model3d-wrap { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: #141414; min-height: 380px; }
.model3d-wrap canvas { display: block; width: 100% !important; }
.model3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.model3d-hint { position: absolute; top: 8px; left: 8px; font-size: 11px; color: rgba(255,255,255,.35); pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s; }
.model3d-hint.visible { opacity: 1; }

/* ============================================================
   POMODORO WIDGET
   ============================================================ */
.pom-widget { position: fixed; bottom: 24px; right: 24px; z-index: 200; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 130px; }
.pom-label { font-size: 12px; color: var(--muted); }
.pom-time { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: 2px; }
.pom-actions { display: flex; gap: 6px; }

/* ============================================================
   QUICK CAPTURE OVERLAY
   ============================================================ */
.capture-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.capture-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; width: 100%; max-width: 520px; box-shadow: var(--shadow); }
.capture-box h3 kbd { font-size: 11px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.capture-box input, .capture-box textarea { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 14px; outline: none; box-sizing: border-box; }
.capture-box input:focus, .capture-box textarea:focus { border-color: var(--accent); }

/* ============================================================
   HABIT TRACKER
   ============================================================ */
.habit-row { display: flex; flex-direction: column; gap: 5px; }
.habit-meta { display: flex; align-items: center; gap: 8px; }
.habit-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.habit-name { font-size: 13.5px; font-weight: 500; flex: 1; }
.habit-streak { font-size: 12px; color: var(--muted); }
.habit-grid { display: flex; gap: 3px; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0; }
.hcell { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; background: var(--bg-hover); border: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.hcell:hover { border-color: var(--hc, var(--accent)); }
.hcell.done { background: var(--hc, var(--accent)); border-color: var(--hc, var(--accent)); }
.hcell.today { box-shadow: 0 0 0 2px var(--accent); }

/* ============================================================
   RSS READER
   ============================================================ */
.rss-item { flex-direction: column; align-items: flex-start; gap: 3px; }
.rss-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: normal; line-height: 1.4; }

/* ============================================================
   TOAST (confirmation d'annulation Ctrl+Z)
   ============================================================ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); background: var(--bg-elev, var(--bg)); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 16px; font-size: 13px; box-shadow: 0 6px 22px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9999; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Marketplace page */
.marketplace-view { position: absolute; inset: 0; overflow-y: auto; background: var(--bg); animation: fade .2s ease; }
.marketplace-view.hidden { display: none; }
.market-page { max-width: 1240px; margin: 0 auto; padding: 28px 34px 120px; }
.market-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.market-kicker { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.market-topbar h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.market-controlbar { display: grid; grid-template-columns: minmax(280px, 1fr) 210px; gap: 10px; align-items: center; margin-bottom: 12px; }
.market-search { position: relative; display: flex; align-items: center; }
.market-search .ico { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); }
.market-search input, .market-controlbar select { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev); color: var(--text); outline: none; }
.market-search input { padding: 0 12px 0 38px; font-size: 13px; }
.market-controlbar select { padding: 0 10px; font-size: 12.5px; }
.market-search input:focus, .market-controlbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.market-source-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin: 8px 0 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.market-tab, .market-cat { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.market-tab { height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.market-tab strong, .market-cat strong { color: var(--muted); font-size: 11px; font-weight: 600; }
.market-tab.active, .market-cat.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.market-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.market-filter-panel { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.market-panel-title { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.market-category-list { display: flex; flex-direction: row; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.market-cat { width: auto; min-height: 32px; padding: 7px 10px; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; font-size: 12.5px; flex: 0 0 auto; white-space: nowrap; }
.market-results { min-width: 0; }
.market-statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-bottom: 10px; }
.market-stat { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 9px 10px; min-width: 0; }
.market-stat span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.market-stat strong { display: block; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-meta { color: var(--muted); font-size: 12.5px; margin: 4px 0 12px; }
.market-grid { display: block; columns: 320px; column-gap: 14px; }
.market-card { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 16px; display: inline-flex; width: 100%; flex-direction: column; align-items: stretch; gap: 12px; text-align: left; break-inside: avoid; margin: 0 0 14px; box-shadow: 0 1px 0 rgba(255,255,255,.02); }
.market-card:hover { border-color: color-mix(in srgb, var(--accent) 32%, var(--border-soft)); background: color-mix(in srgb, var(--bg-elev) 94%, var(--accent) 6%); }
.market-card-main { display: grid; gap: 10px; min-width: 0; }
.market-card-head { display: flex; gap: 12px; align-items: flex-start; justify-content: flex-start; min-width: 0; }
.market-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-dim); color: var(--accent); flex: 0 0 auto; font-weight: 700; font-size: 16px; }
.market-icon[data-source="account"] { background: rgba(97,175,239,.14); color: #61afef; }
.market-icon[data-source="native"] { background: rgba(229,192,123,.16); color: #e5c07b; }
.market-title-block { min-width: 0; display: grid; gap: 2px; align-content: start; }
.market-title-block h3 { margin: 0; font-size: 16px; line-height: 1.22; overflow-wrap: anywhere; }
.market-title-block span, .market-title-block small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-desc { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.48; }
.market-card-meta { display: flex; align-items: center; justify-content: flex-start; gap: 8px 14px; flex-wrap: wrap; border-top: 1px solid var(--border-soft); padding-top: 11px; }
.market-updated { color: var(--muted); font-size: 11.5px; }
.market-tags { display: flex; flex-wrap: wrap; justify-content: flex-start; align-content: flex-start; gap: 5px; }
.market-tags span { border: 1px solid var(--border); border-radius: 7px; padding: 3px 7px; font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; justify-content: flex-start; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.market-empty { border: 1px dashed var(--border); border-radius: 8px; padding: 28px; color: var(--muted); text-align: center; column-span: all; }
@media (max-width: 980px) { .market-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .home-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .market-page { padding: 22px 14px 100px; } .market-controlbar, .market-statbar { grid-template-columns: 1fr; } .market-topbar { align-items: stretch; flex-direction: column; } .market-actions { justify-content: flex-start; } }

/* Full-page tools and marketplace shell */
body.marketplace-mode #sidebar { display: none; }
body.marketplace-mode #main { flex-basis: 100%; }
body.marketplace-mode #showSide { display: none !important; }
body.marketplace-mode #tabbar { display: none !important; }
.market-top-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.market-create-btn { min-width: 92px; }
.tool-view { position: absolute; inset: 0; overflow-y: auto; background: var(--bg); animation: fade .2s ease; }
.tool-view.hidden { display: none; }
.tool-page { max-width: 1220px; margin: 0 auto; padding: 28px 34px 120px; }
.tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border-soft); padding-bottom: 16px; margin-bottom: 16px; }
.tool-kicker { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.tool-head h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.tool-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tool-head-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tool-grid { display: grid; gap: 12px; }
.tool-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-panel { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 14px; min-width: 0; }
.tool-panel h2 { margin: 0 0 10px; font-size: 15px; }
.account-shell { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(320px, 1fr); gap: 14px; align-items: stretch; }
.account-overview { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.account-overview h2 { margin: 0; font-size: 24px; }
.account-overview p { margin: 0; color: var(--text-soft); line-height: 1.55; }
.account-benefits { display: grid; gap: 8px; }
.account-benefits span { border: 1px solid var(--border-soft); background: var(--bg); border-radius: 8px; padding: 9px 10px; color: var(--text-soft); font-size: 13px; }
.account-page .auth-tabs { display: inline-flex; gap: 6px; border: 1px solid var(--border-soft); background: var(--bg); border-radius: 8px; padding: 4px; margin-bottom: 12px; }
.account-page .auth-form { gap: 12px; }
.account-page .auth-form label { font-weight: 700; color: var(--text-soft); }
.settings-grid .tool-panel { display: grid; align-content: start; gap: 12px; }
.settings-grid .tool-panel h2 { margin: 0; font-size: 14px; }
.settings-grid .tool-button-row { justify-content: flex-start; }
.settings-grid .tool-note { margin: 0; line-height: 1.45; }
@media (max-width: 820px) { .account-shell { grid-template-columns: 1fr; } }
.tool-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tool-panel-head h2 { margin: 0; }
.feature-list { display: grid; gap: 8px; }
.feature-row { border: 1px solid var(--border-soft); background: var(--bg); color: var(--text); border-radius: 8px; padding: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; min-width: 0; }
.feature-row.unread { border-color: color-mix(in srgb, var(--accent) 48%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.feature-row > div { min-width: 0; display: grid; gap: 3px; }
.feature-row strong, .feature-row p, .feature-row small { overflow: hidden; text-overflow: ellipsis; }
.feature-row p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.4; }
.feature-row small { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.feature-row .tool-button-row { justify-content: flex-end; flex-shrink: 0; }
.modal-feature-list { max-height: 46vh; overflow: auto; margin-top: 10px; }
.review-compose { display: grid; gap: 8px; margin: 10px 0; }
.review-compose textarea, .review-compose input, .review-compose select, .auth-form textarea, .auth-form select { width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 7px; padding: 9px 10px; font: inherit; outline: none; }
.review-compose textarea:focus, .review-compose input:focus, .review-compose select:focus, .auth-form textarea:focus, .auth-form select:focus { border-color: var(--accent); }
.market-rating { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.market-rating small { color: var(--muted); font-size: 11.5px; }
.stars { display: inline-flex; gap: 1px; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.stars span.on { color: var(--accent); }
.creator-profile-card h2 { margin: 0 0 6px; }
.creator-profile-card p { margin: 0 0 4px; color: var(--text-soft); }
.creator-profile-card small { color: var(--muted); }.tool-button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tool-label { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.tool-label input { flex: 1; min-width: 140px; }
.tool-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.tool-stats-grid > div { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 12px; }
.tool-stats-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.tool-stats-grid strong { display: block; font-size: 24px; line-height: 1; }
.tool-chart { height: 86px; display: flex; align-items: end; gap: 3px; border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.tool-chart i { flex: 1; min-width: 3px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .82; }
.tool-list { display: grid; gap: 6px; }
.tool-list-row { width: 100%; border: 1px solid var(--border-soft); background: var(--bg); color: var(--text); border-radius: 8px; padding: 9px 10px; display: flex; align-items: center; gap: 10px; text-align: left; }
.tool-list-row:not(.static) { cursor: pointer; }
.tool-list-row:hover { border-color: var(--accent); }
.tool-list-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-list-row small { color: var(--muted); white-space: nowrap; }
.tool-empty { border: 1px dashed var(--border); color: var(--muted); border-radius: 8px; padding: 28px; text-align: center; }
.tool-empty.compact { padding: 14px; text-align: left; }
.tool-preview { max-height: 360px; overflow: auto; white-space: pre-wrap; color: var(--text-soft); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.mini.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.share-popover { position: fixed; z-index: 260; width: min(458px, calc(100vw - 12px)); max-height: calc(100vh - 14px); display: none; border: 1px solid color-mix(in srgb, var(--border) 82%, #686868); border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--bg-elev) 86%, #303030); color: var(--text); box-shadow: 0 18px 60px rgba(0,0,0,.52); }
.share-popover.open { display: block; }
.share-sheet { display: grid; gap: 0; color: var(--text); }
.share-tabs { height: 39px; display: flex; align-items: end; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg-elev) 78%, #303030); }
.share-tabs button { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 0 9px; cursor: pointer; }
.share-tabs button.active { color: var(--text); border-bottom: 2px solid var(--text); }
.share-close { width: 24px; height: 24px; margin: 0 0 7px auto; padding: 0 !important; display: grid; place-items: center; border-radius: 5px !important; font-size: 18px !important; line-height: 1; color: var(--muted) !important; }
.share-close:hover { color: var(--text) !important; background: var(--bg-hover); }
.share-tab-panel { min-width: 0; }
.share-invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 16px 16px 8px; }
.share-invite-row input { min-width: 0; height: 34px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--bg) 82%, #1e1e1e); color: var(--text); border-radius: 7px; padding: 0 9px; outline: none; font: inherit; }
.share-invite-row input::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.share-invite-row .side-btn { height: 34px; border-radius: 7px; padding: 0 14px; font-weight: 750; }
.share-owner-row, .share-access-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 16px; }
.share-avatar, .share-lock { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bg-active) 84%, #555); color: var(--text); font-weight: 800; font-size: 12px; }
.share-lock { border-radius: 8px; }
.share-lock .ico { width: 16px; height: 16px; }
.share-owner-copy { min-width: 0; display: grid; gap: 2px; }
.share-owner-copy strong, .share-owner-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-owner-copy small, .share-section-label, .share-help, .share-result small, .publish-panel p { color: var(--muted); font-size: 12px; }
.share-owner-row select, .share-access-row select { max-width: 190px; border: 0; background: none; color: var(--text-soft); font: inherit; font-size: 13px; outline: none; cursor: pointer; }
.share-owner-row select:hover, .share-access-row select:hover { color: var(--text); }
.share-section-label { padding: 8px 16px 4px; display: block; font-weight: 650; }
.share-access-row { grid-template-columns: 36px minmax(0, 1fr); padding-top: 2px; }
.share-access-row select { max-width: none; justify-self: start; font-weight: 700; color: var(--text); }
.share-result.compact { margin: 4px 16px 0; display: grid; gap: 6px; }
.share-status { border: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg) 86%, #262626); border-radius: 8px; padding: 9px 10px; font-size: 12.5px; color: var(--text-soft); }
.share-link-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.share-link-result input { width: 100%; min-width: 0; height: 32px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 7px; padding: 0 9px; }
.share-sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--border-soft); margin-top: 12px; padding: 10px 12px 12px 16px; }
.share-copy-main { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; font-weight: 750; }
.publish-panel { padding: 16px; display: grid; gap: 10px; }
.publish-panel h3 { margin: 0; font-size: 17px; }
.publish-panel p { margin: 0; line-height: 1.45; }
.publish-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.publish-panel input { width: 100%; height: 34px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 7px; padding: 0 9px; outline: none; }
.publish-panel input:focus { border-color: var(--accent); }
.publish-badge { justify-self: start; border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border)); color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.publish-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.ok-text { color: var(--ok); }
.danger-text { color: var(--danger); }
.friends-tool-page { max-width: none; height: calc(100vh - 48px); margin: 0; padding: 0; }
.friends-tool-page .tool-head { display: none; }
.friends-discord { height: 100%; min-height: 620px; display: grid; grid-template-columns: 72px 292px minmax(0, 1fr) 252px; overflow: hidden; background: var(--bg); border-top: 1px solid var(--border-soft); }
.friends-rail { background: color-mix(in srgb, var(--bg-side) 88%, #06070a); padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-right: 1px solid var(--border-soft); }
.friends-server { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; border: 0; background: var(--bg-active); color: var(--text); font-weight: 850; cursor: pointer; transition: border-radius .14s, background .14s, color .14s; }
.friends-server .ico { width: 18px; height: 18px; }
.friends-server:hover, .friends-server.active { border-radius: 13px; background: var(--accent); color: #0d1626; }
.friends-server.ghost { background: var(--bg-hover); color: var(--text-soft); }
.friends-server.small { width: 36px; height: 36px; border-radius: 50%; color: var(--ok); font-size: 22px; }
.friends-rail-sep { width: 32px; height: 1px; background: var(--border); }
.friends-sidebar { min-width: 0; background: var(--bg-side); border-right: 1px solid var(--border-soft); padding: 12px; display: grid; grid-template-rows: auto auto auto auto auto minmax(0, 1fr); gap: 10px; }
.friends-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.friends-sidebar-head strong { font-size: 14px; }
.friends-search input, .friends-add input { width: 100%; height: 34px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 7px; padding: 0 10px; outline: none; }
.friends-search input:focus, .friends-add input:focus, .discord-composer textarea:focus { border-color: var(--accent); }
.friends-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.friends-nav-list { display: grid; gap: 4px; }
.friends-nav { width: 100%; border: 0; border-radius: 6px; background: var(--bg-hover); color: var(--text); display: flex; align-items: center; gap: 8px; padding: 8px 9px; font-weight: 700; text-align: left; }
.friends-nav small { margin-left: auto; color: var(--muted); }
.friends-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.discord-list { display: flex; flex-direction: column; gap: 3px; overflow: auto; min-height: 0; }
.discord-dm { width: 100%; border: 0; background: none; color: var(--text-soft); border-radius: 6px; padding: 7px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; align-items: center; text-align: left; cursor: pointer; }
.discord-dm:hover, .discord-dm.active { background: var(--bg-hover); color: var(--text); }
.discord-dm span:last-child { min-width: 0; display: grid; gap: 1px; }
.discord-dm strong, .discord-dm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-dm small, .discord-muted, .discord-hint { color: var(--muted); font-size: 12px; }
.discord-avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 30%, var(--bg-active)); color: var(--text); font-weight: 850; font-size: 11px; }
.discord-avatar i { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--bg-side); }
.discord-avatar.large { width: 72px; height: 72px; font-size: 22px; margin-bottom: 10px; }
.discord-avatar.large i { width: 14px; height: 14px; border-width: 3px; }
.friends-main { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: color-mix(in srgb, var(--bg) 94%, #101114); }
.friends-appbar { min-height: 54px; border-bottom: 1px solid var(--border-soft); padding: 9px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: color-mix(in srgb, var(--bg) 94%, #111); }
.friends-channel-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.discord-channel-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-hover); color: var(--muted); font-weight: 900; }
.friends-channel-title div { min-width: 0; display: grid; gap: 2px; }
.friends-channel-title strong, .friends-channel-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends-channel-title small { color: var(--muted); font-size: 12px; }
.friends-channel-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.discord-messages { padding: 16px 10px 16px 16px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.discord-intro { display: grid; justify-items: start; gap: 3px; padding: 12px 8px 18px; border-bottom: 1px solid var(--border-soft); margin-bottom: 8px; }
.discord-intro h2 { margin: 0; font-size: 24px; }
.discord-intro p { margin: 0; color: var(--text-soft); font-size: 13px; }
.discord-intro small { color: var(--muted); }
.discord-message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 7px; }
.discord-message:hover, .discord-message.mine { background: color-mix(in srgb, var(--bg-hover) 72%, transparent); }
.discord-message-body { min-width: 0; display: grid; gap: 4px; }
.discord-message-meta { display: flex; align-items: baseline; gap: 8px; }
.discord-message-meta small { color: var(--muted); font-size: 11px; }
.discord-message p { margin: 0; color: var(--text-soft); line-height: 1.45; overflow-wrap: anywhere; }
.discord-share-card { max-width: 420px; border: 1px solid var(--border); border-radius: 7px; padding: 9px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; color: var(--text); text-decoration: none; background: var(--bg-elev); }
.discord-share-card:hover { border-color: var(--accent); }
.discord-share-card span { display: grid; gap: 2px; min-width: 0; }
.discord-share-card small { color: var(--muted); }
.discord-composer { border-top: 1px solid var(--border-soft); padding: 12px 14px; display: grid; gap: 8px; background: color-mix(in srgb, var(--bg) 94%, #111); }
.discord-composer textarea { width: 100%; min-height: 48px; max-height: 140px; resize: vertical; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 8px; padding: 11px 12px; font: inherit; outline: none; }
.discord-composer textarea:disabled { opacity: .55; cursor: not-allowed; }
.friend-compose-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.discord-hint { margin-right: auto; }
.discord-empty { margin: auto; max-width: 360px; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 8px; padding: 20px; }
.discord-empty.compact { margin: 8px 0; text-align: left; padding: 12px; }
.friends-member-panel { background: var(--bg-side); border-left: 1px solid var(--border-soft); padding: 22px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.friends-member-panel h2 { margin: 0 0 4px; font-size: 17px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends-member-panel p { margin: 0; color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-stat { width: 100%; margin-top: 16px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; display: grid; gap: 2px; }
.member-stat strong { font-size: 22px; line-height: 1; }
.member-stat span { color: var(--muted); font-size: 12px; }
.member-actions { margin-top: 16px; display: grid; gap: 8px; width: 100%; }
@media (max-width: 1180px) { .friends-discord { grid-template-columns: 68px 280px minmax(0, 1fr); } .friends-member-panel { display: none; } }
@media (max-width: 780px) { .share-owner-row { grid-template-columns: 36px minmax(0, 1fr); } .share-owner-row select { grid-column: 2; justify-self: start; } .share-sheet-foot, .publish-actions { align-items: stretch; flex-direction: column; } .friends-tool-page { height: auto; min-height: calc(100vh - 48px); } .friends-discord { grid-template-columns: 1fr; min-height: auto; } .friends-rail { display: none; } .friends-sidebar { max-height: 270px; border-right: 0; border-bottom: 1px solid var(--border-soft); } .friends-main { min-height: 560px; } .friends-appbar { align-items: stretch; flex-direction: column; } .friends-channel-actions { justify-content: flex-start; } }
.rss-full-list { display: grid; gap: 12px; }
.rss-row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.rss-row strong { font-size: 13.5px; }
.rss-row span { color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.rss-row small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 900px) { .tool-grid.two, .tool-stats-grid, .task-stats { grid-template-columns: 1fr 1fr; } .task-compose { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .tool-page { padding: 22px 14px 100px; } .tool-head, .tool-panel-head, .task-tools { align-items: stretch; flex-direction: column; } .tool-stats-grid, .task-stats { grid-template-columns: 1fr; } .task-row { grid-template-columns: 30px minmax(0, 1fr); } .task-due { grid-column: 2; justify-self: start; } }
.creator-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.creator-badges span { border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); color: var(--text-soft); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 999px; padding: 3px 7px; font-size: 11px; }
.security-pill { font-weight: 700; }
.security-clean { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)) !important; color: var(--ok) !important; }
.security-review { border-color: #d9a441 !important; color: #d9a441 !important; }
.security-blocked { border-color: var(--danger) !important; color: var(--danger) !important; }
.security-unscanned { border-color: var(--border) !important; color: var(--muted) !important; }
.security-summary-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: grid; gap: 4px; background: var(--bg-soft); margin-bottom: 10px; }
.security-summary-card strong { font-size: 16px; }
.security-summary-card small { color: var(--muted); }
.security-summary-card.security-clean { background: color-mix(in srgb, var(--ok) 8%, var(--bg-soft)); }
.security-summary-card.security-review { background: color-mix(in srgb, #d9a441 9%, var(--bg-soft)); }
.security-summary-card.security-blocked { background: color-mix(in srgb, var(--danger) 9%, var(--bg-soft)); }
.security-modal-tags { margin: 8px 0; }
.security-hash { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.security-hash code { color: var(--text-soft); }
.share-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 14px 0; }
.share-options-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11.5px; }
.share-options-grid input { min-width: 0; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); border-radius: 7px; padding: 8px 9px; font: inherit; font-size: 12px; }
.friend-suggestions { display: grid; gap: 4px; border: 1px solid var(--border-soft); background: var(--bg); border-radius: 8px; padding: 6px; max-height: 190px; overflow: auto; }
.friend-suggestions button { width: 100%; border: 0; background: transparent; color: var(--text-soft); border-radius: 6px; padding: 7px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; text-align: left; cursor: pointer; }
.friend-suggestions button:hover { background: var(--bg-hover); color: var(--text); }
.friend-suggestions span:last-child { min-width: 0; display: grid; gap: 1px; }
.friend-suggestions strong, .friend-suggestions small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends-main.drop-ready, .discord-messages.drop-ready, .discord-composer.drop-ready { outline: 2px solid var(--accent); outline-offset: -4px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.friends-add.hidden, .friend-suggestions.hidden { display: none; }
.friends-groups { display: grid; gap: 6px; margin: 6px 0 10px; }
.friend-group-row { border: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg-soft) 78%, transparent); border-radius: 8px; padding: 8px; display: grid; gap: 7px; }
.friend-group-row strong { display: block; font-size: 13px; }
.friend-group-row small { color: var(--muted); }
.friend-group-row .tool-button-row { justify-content: flex-start; gap: 5px; }
.app-detail-hero { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 16px; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 12px; }
.app-detail-hero h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.1; }
.app-detail-hero p { margin: 0 0 10px; color: var(--text-soft); line-height: 1.45; }
.app-detail-actions { margin: 0 0 12px; }
.data-map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.data-map-card { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 12px; display: grid; gap: 10px; align-content: start; }
.data-map-card strong { display: block; margin-bottom: 4px; }
.data-map-card p { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.data-pill { justify-self: start; border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 11px; font-weight: 750; }
.data-pill.local { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); color: var(--ok); }
.data-pill.cloud { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--accent); }
.data-pill.public { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.workspace-switcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.workspace-card { border: 1px solid var(--border-soft); background: var(--bg); color: var(--text); border-radius: 8px; padding: 11px; display: grid; gap: 4px; text-align: left; cursor: pointer; }
.workspace-card.active, .workspace-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.workspace-card span { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .app-detail-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .share-options-grid { grid-template-columns: 1fr; } }
.classification-grid, .relation-compose, .goal-compose { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.classification-grid label, .relation-compose label, .goal-compose label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.classification-grid input, .classification-grid textarea, .classification-grid select, .relation-compose input, .relation-compose textarea, .relation-compose select, .goal-compose input, .goal-compose select { width: 100%; min-width: 0; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 9px 10px; font: inherit; }
.relation-compose textarea { grid-column: 1 / -2; min-height: 72px; resize: vertical; }
.brain-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.brain-cloud button { border: 1px solid var(--border-soft); background: var(--bg); color: var(--text); border-radius: 8px; padding: 8px 10px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.brain-cloud button:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.brain-cloud span { color: var(--muted); font-size: 12px; }
.premium-reader { max-width: 820px; margin: 0 auto; border: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg-elev) 82%, transparent); border-radius: 8px; padding: clamp(24px, 5vw, 56px); color: var(--text); }
.premium-reader header { border-bottom: 1px solid var(--border-soft); padding-bottom: 18px; margin-bottom: 22px; }
.premium-reader header span { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.premium-reader h1 { margin: 6px 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: 0; }
.premium-reader h2, .premium-reader h3, .premium-reader h4 { margin: 24px 0 8px; line-height: 1.18; }
.premium-reader p, .premium-reader li { color: var(--text-soft); font-size: 17px; line-height: 1.75; }
.premium-reader blockquote { border-left: 3px solid var(--accent); margin: 18px 0; padding: 8px 0 8px 18px; color: var(--text); }
.premium-reader pre { border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow: auto; background: var(--bg); }
.premium-reader table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.premium-reader td { border: 1px solid var(--border); padding: 8px 10px; }
.premium-reader img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border-soft); }
.goal-row { border: 1px solid var(--border-soft); background: var(--bg); border-radius: 8px; padding: 11px; display: grid; gap: 10px; }
.goal-row strong { display: block; margin-bottom: 3px; }
.goal-row p, .goal-row small { margin: 0; color: var(--muted); }
.goal-progress { height: 8px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.goal-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.presentation-shell { height: calc(100vh - 130px); min-height: 520px; display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.presentation-toolbar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
#presentationStage { min-height: 0; border: 1px solid var(--border-soft); background: #101114; border-radius: 8px; overflow: auto; }
.presentation-slide { min-height: 100%; padding: clamp(28px, 7vw, 86px); display: grid; align-content: center; gap: 18px; }
.presentation-slide > span { color: var(--muted); font-size: 12px; }
.presentation-slide h1 { margin: 0; max-width: 980px; font-size: clamp(38px, 7vw, 82px); line-height: 1.02; letter-spacing: 0; }
.presentation-slide p, .presentation-slide li { max-width: 900px; color: var(--text-soft); font-size: clamp(18px, 2.2vw, 30px); line-height: 1.45; }
.presentation-slide img { max-width: min(900px, 90%); max-height: 58vh; border-radius: 8px; }
@media (max-width: 720px) { .relation-compose textarea { grid-column: 1 / -1; } .presentation-shell { min-height: 440px; } }
/* Page templates */
.template-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.template-summary > div { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 10px 11px; display: grid; gap: 4px; }
.template-summary span { color: var(--muted); font-size: 11.5px; }
.template-summary strong { font-size: 22px; line-height: 1; }
.template-sample-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.template-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 160px 150px auto auto auto auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.template-toolbar input, .template-toolbar select { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 0 10px; font: inherit; outline: none; }
.template-toolbar input:focus, .template-toolbar select:focus { border-color: var(--accent); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; align-items: start; }
.template-card { border: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 8px; padding: 12px; display: grid; gap: 11px; min-width: 0; }
.template-card:hover { border-color: color-mix(in srgb, var(--accent) 46%, var(--border)); }
.template-card-top { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: start; }
.template-icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent); overflow: hidden; }
.template-icon .ico { width: 20px; height: 20px; }
.template-card h2 { margin: 0 0 3px; font-size: 16px; line-height: 1.2; }
.template-card p { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.4; }
.template-meta, .template-vars { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.template-meta span, .template-vars span { border: 1px solid var(--border-soft); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 3px 7px; font-size: 11px; }
.template-vars.muted { color: var(--muted); font-size: 12px; }
.template-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-start; }
.template-builder { margin-top: 14px; display: grid; gap: 12px; }
.template-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.template-form-grid label, .template-wide, .template-use-vars label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.template-form-grid input, .template-form-grid select, .template-wide textarea, .template-use-vars input { width: 100%; min-width: 0; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 9px 10px; font: inherit; outline: none; }
.template-wide textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.45; }
.template-form-grid input:focus, .template-form-grid select:focus, .template-wide textarea:focus, .template-use-vars input:focus { border-color: var(--accent); }
.template-preview { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; color: var(--text-soft); display: grid; gap: 4px; min-height: 42px; }
.template-preview strong { color: var(--text); }
.template-preview span, .template-preview small { overflow-wrap: anywhere; }
.template-use-vars { display: grid; gap: 9px; margin: 10px 0 14px; }
@media (max-width: 900px) { .template-toolbar, .template-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .template-toolbar, .template-summary, .template-grid { grid-template-columns: 1fr; } }
/* ============================================================
   MOBILE APP SHELL PASS
   ============================================================ */
.mobile-nav { display: none; }

@media (max-width: 760px) {
  :root { --mobile-nav-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html, body, #app { height: 100dvh; }
  body { overflow: hidden; overscroll-behavior-y: none; }
  #app { width: 100vw; height: 100dvh; overflow: hidden; }
  #main { width: 100%; min-width: 0; }
  .main-split { min-height: 0; }

  #topbar { min-height: 56px; flex-shrink: 0; gap: 2px; padding: 8px; overflow: hidden; background: var(--bg); position: relative; z-index: 40; }
  #topbar .spacer, .top-nav-tools, #readerBtn, #pomodoroBtn, #ambientBtn, #popoutBtn, #importBtn, #themeBtn, #findBtn { display: none !important; }
  #breadcrumb { flex: 1; min-width: 0; padding: 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  #breadcrumb .crumb:not(:last-child), #breadcrumb > span:not(.crumb) { display: none; }
  .icon-btn { width: 38px; min-width: 38px; height: 38px; min-height: 38px; justify-content: center; }
  #aiToggle { width: 40px; min-width: 40px; height: 38px; padding: 0; justify-content: center; font-size: 0; }
  #aiToggle .ico { margin: 0; }

  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 180; width: min(86vw, 340px); max-width: 340px; height: 100dvh; margin-left: 0; transform: translateX(0); transition: transform .22s cubic-bezier(.4,0,.2,1); box-shadow: 12px 0 42px rgba(0,0,0,.46); }
  #sidebar.collapsed { margin-left: 0; transform: translateX(-104%); }
  #showSide { display: inline-flex !important; }
  #sideResize { display: none; }
  .side-head { min-height: 56px; }
  .side-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }

  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--mobile-nav-h); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg-elev) 92%, transparent); box-shadow: 0 -12px 34px rgba(0,0,0,.32); backdrop-filter: blur(14px); }
  .mobile-nav button { min-width: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; font: inherit; font-size: 10.5px; font-weight: 750; cursor: pointer; }
  .mobile-nav button .ico { width: 21px; height: 21px; }
  .mobile-nav button.primary { color: var(--accent); background: var(--accent-dim); }
  .mobile-nav button:active { background: var(--bg-hover); color: var(--text); }
  body.marketplace-mode .mobile-nav, body.friends-mode .mobile-nav, body.graph-mode .mobile-nav, body.reader .mobile-nav { display: none !important; }

  #editor-wrap { height: calc(100dvh - 56px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--mobile-nav-h); }
  #tabbar { display: none !important; }
  .findbar, .msel-bar { flex-wrap: wrap; gap: 6px; padding: 8px; max-height: 40dvh; overflow: auto; }
  .findbar input { flex: 1 1 132px; min-width: 0; }
  .findbar button, .msel-bar button, .mini, .side-btn, .ghost-btn { min-height: 36px; }

  .page { max-width: none; margin: 0; padding: 18px 16px calc(var(--mobile-nav-h) + 72px); }
  .page-icon-row { min-height: 50px; }
  .page-icon { font-size: 44px; }
  .page-title { font-size: clamp(28px, 8.5vw, 34px); line-height: 1.12; letter-spacing: 0; padding: 4px 0 6px; }
  .page-meta, .tag-row { gap: 6px 8px; overflow-wrap: anywhere; }
  .block { max-width: 100%; }
  .block .handle, .block-voice { display: none !important; }
  .block .cbadge { right: 0; }
  .ce { font-size: 16px; line-height: 1.55; }
  .b-code, .b-table-wrap, .db-panel, .props-panel, .pinned-panel, .toc, .backlinks, .b-pdf-wrap, .model3d-wrap { max-width: 100%; overflow-x: auto; }
  .b-pdf-frame { height: min(65dvh, 520px); }
  .b-cols { flex-direction: column; }
  .editor-share-btn { top: 64px; right: 12px; }

  .home { padding: 18px 14px calc(var(--mobile-nav-h) + 50px); }
  .home-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .home-head h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
  .home-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .home-controls select { min-width: 0; }
  .home-widgets, .home-grid, .home-section-grid, .tool-grid, .tool-grid.two, .data-map-grid, .workspace-switcher, .classification-grid, .goal-compose, .template-form-grid { grid-template-columns: 1fr !important; }
  .home-overview { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .home-card, .widget, .tool-panel, .market-card, .template-card { border-radius: 8px; }

  .marketplace-view, .tool-view { inset: 0; }
  .market-page, .tool-page { max-width: none; min-width: 0; padding: 18px 14px calc(var(--mobile-nav-h) + 50px); }
  body.marketplace-mode .market-page, body.friends-mode .tool-page { padding-bottom: 18px; }
  .market-topbar, .tool-head, .tool-panel-head, .task-tools { align-items: stretch; flex-direction: column; gap: 12px; }
  .market-top-actions, .tool-head-actions, .tool-button-row, .template-actions { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
  .market-top-actions button, .tool-head-actions button, .tool-button-row button, .template-actions button { flex: 0 0 auto; }
  .market-controlbar, .market-statbar, .template-toolbar, .template-summary { grid-template-columns: 1fr !important; }
  .market-source-tabs, .market-category-list { padding-bottom: 6px; }
  .market-grid { columns: 1 !important; column-gap: 0; }
  .market-card { padding: 13px; gap: 10px; margin-bottom: 10px; }
  .market-card-head { gap: 10px; }
  .market-icon { width: 42px; height: 42px; }
  .market-card-meta { gap: 6px 10px; padding-top: 9px; }
  .market-actions { padding-top: 9px; }
  .market-actions .mini, .market-actions .side-btn { min-height: 36px; }

  .modal { align-items: flex-end; justify-content: center; padding: 0; }
  .modal-card { width: 100%; max-width: none; max-height: 88dvh; border-radius: 16px 16px 0 0; border-bottom: 0; padding: 18px; }
  .palette { align-items: flex-start; padding: max(10px, env(safe-area-inset-top, 0px)) 10px 10px; }
  .palette-box { width: 100%; max-width: none; border-radius: 14px; }
  .share-popover { left: 6px !important; right: 6px !important; top: auto !important; bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important; width: auto !important; max-height: 86dvh; border-radius: 14px; }
  .share-invite-row { grid-template-columns: 1fr; padding: 14px; }
  .share-invite-row .side-btn { width: 100%; }
  .share-link-result { grid-template-columns: 1fr; }
  .share-owner-row, .share-access-row { grid-template-columns: 36px minmax(0, 1fr); }
  .share-owner-row select { grid-column: 2; justify-self: start; }
  .share-sheet-foot, .publish-actions { align-items: stretch; flex-direction: column; }

  #ai-panel { position: fixed; inset: 0; z-index: 220; width: 100%; max-width: none; height: 100dvh; border-left: 0; }
  .ai-input { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  .friends-tool-page { height: 100dvh !important; min-height: 0 !important; padding: 0 !important; }
  .friends-discord { height: 100dvh; min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .friends-rail, .friends-member-panel { display: none !important; }
  .friends-sidebar { max-height: 34dvh; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border-soft); padding: 10px; grid-template-rows: auto auto auto auto minmax(0, 1fr); }
  .friends-add { grid-template-columns: 1fr; }
  .friends-main { min-height: 0; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
  .friends-appbar { min-height: auto; align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .friends-channel-actions { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .discord-messages { padding: 12px 8px; }
  .discord-message { grid-template-columns: 34px minmax(0, 1fr); padding: 7px 4px; }
  .discord-composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .friend-compose-actions { justify-content: stretch; }
  .friend-compose-actions .side-btn, .friend-compose-actions .mini { flex: 1; }

  .capture-overlay { align-items: flex-end; padding: 0; }
  .capture-box { max-width: none; border-radius: 16px 16px 0 0; }
  .presentation-shell { height: auto; min-height: 420px; }
  input, select, textarea { font-size: 16px !important; }
  .mini, .side-btn, .icon-btn, .ghost-btn, .mobile-nav button { touch-action: manipulation; }
}

@media (max-width: 380px) {
  .home-overview { grid-template-columns: 1fr !important; }
  .mobile-nav button span { font-size: 10px; }
}

@media (min-width: 761px) {
  .mobile-nav { display: none !important; }
}
/* ============================================================
   OBSIDIAN GRAPH PASS
   ============================================================ */
.graph-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; }
.graph-head-pro { align-items: center; padding-bottom: 10px; }
.graph-title-block { min-width: 0; }
.graph-kicker { display: block; color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.graph-head-pro h1 { font-size: 28px; line-height: 1.05; }
.graph-head-pro p { max-width: 680px; line-height: 1.45; }
.graph-stats-pro span { display: inline-flex; align-items: baseline; gap: 5px; }
.graph-stats-pro strong { color: var(--text); font-size: 15px; }
.graph-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 170px auto auto auto; gap: 8px; align-items: center; }
.graph-search { position: relative; display: flex; align-items: center; min-width: 0; }
.graph-search .ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); }
.graph-search input, .graph-toolbar select { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev); color: var(--text); outline: none; font: inherit; font-size: 13px; }
.graph-search input { padding: 0 11px 0 36px; }
.graph-toolbar select { padding: 0 10px; }
.graph-search input:focus, .graph-toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.graph-toolbar .mini.on { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); color: var(--accent); background: var(--accent-dim); }
.obsidian-graph-stage { border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg); box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
#graphCanvas { background: var(--bg); cursor: grab; }
#graphCanvas:active { cursor: grabbing; }
.graph-canvas-hint { position: absolute; left: 12px; top: 12px; z-index: 2; max-width: 310px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 7px 9px; background: color-mix(in srgb, var(--bg-elev) 84%, transparent); color: var(--muted); font-size: 11.5px; pointer-events: none; }
.graph-info-pro { left: 12px; right: auto; top: auto; bottom: 12px; max-width: min(340px, calc(100% - 330px)); }
.graph-legend-pro { left: 12px; right: auto; bottom: 48px; flex-wrap: wrap; max-width: min(420px, calc(100% - 340px)); }
.graph-legend .mention { border-color: var(--accent); border-top-style: dashed; }
.graph-legend .category { border-color: #c678dd; }
.graph-legend .tag { border-color: #98c379; border-top-style: solid; }
.graph-details { position: absolute; right: 12px; top: 12px; z-index: 3; width: min(304px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg-elev) 94%, transparent); box-shadow: var(--shadow); padding: 13px; display: grid; gap: 8px; color: var(--text-soft); }
.graph-details strong { color: var(--text); font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.graph-details p { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.graph-details small, .graph-muted { color: var(--muted); font-size: 11.5px; }
.graph-detail-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.graph-detail-tags span { border: 1px solid var(--border-soft); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 3px 7px; font-size: 11px; }
.graph-detail-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.graph-related { display: grid; gap: 5px; border-top: 1px solid var(--border-soft); padding-top: 8px; }
.graph-related > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.graph-related button { width: 100%; border: 0; border-radius: 7px; background: var(--bg-hover); color: var(--text); padding: 7px 8px; display: grid; gap: 1px; text-align: left; cursor: pointer; }
.graph-related button:hover { background: color-mix(in srgb, var(--accent) 10%, var(--bg-hover)); }
.graph-related b, .graph-related small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-related small { color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .graph-view { padding: 12px 10px 14px; }
  .graph-shell { gap: 8px; }
  .graph-head-pro { align-items: stretch; flex-direction: column; gap: 9px; }
  .graph-head-pro h1 { font-size: 25px; }
  .graph-head-pro p { font-size: 12.5px; }
  .graph-stats-pro { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .graph-stats-pro span { flex: 0 0 auto; }
  .graph-toolbar { grid-template-columns: 1fr 1fr; gap: 7px; }
  .graph-search { grid-column: 1 / -1; }
  .graph-toolbar .mini { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .obsidian-graph-stage { min-height: 520px; }
  .graph-canvas-hint { display: none; }
  .graph-details { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 34%; padding: 11px; }
  .graph-info-pro { left: 8px; right: 8px; bottom: calc(34% + 16px); max-width: none; }
  .graph-legend-pro { display: none; }
}