.sm-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--lakom-topbar-h, 56px));
    min-height: 520px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #f7f7f5;
}
html[data-theme="dark"] .sm-page { background: #12161c; }
.sm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--lakom-border, #e6e7e9);
    background: var(--lakom-surface, #fff);
    z-index: 3;
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    width: 100%;
    box-sizing: border-box;
}
.sm-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.sm-chrome-tab {
    display: none;
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 130;
    width: 56px;
    height: 11px;
    margin: 0;
    padding: 0;
    border: 1px solid #cfc8be;
    border-top: 0;
    border-radius: 0 0 9px 9px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.14);
    cursor: pointer;
    transform: translateX(-50%);
}
.sm-chrome-tab::after {
    content: "";
    display: block;
    width: 22px;
    height: 3px;
    margin: 4px auto 0;
    border-radius: 99px;
    background: #8a8580;
}
html[data-theme="dark"] .sm-chrome-tab {
    background: #1a222c;
    border-color: #3a4654;
}
html[data-theme="dark"] .sm-chrome-tab::after { background: #9aa3ad; }
.sm-page.is-chrome-min {
    height: 100vh;
}
.sm-page.is-chrome-min .sm-toolbar {
    position: relative;
    z-index: 20;
    height: 0;
    min-height: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}
.sm-page.is-chrome-min .sm-toolbar-inner { display: none; }
.sm-page.is-chrome-min .sm-chrome-tab { display: block; }
html.sm-chrome-min body.lakom-admin:not(.lakom-admin--login) {
    padding-top: 0;
}
html.sm-chrome-min .lakom-admin-topbar {
    transform: translateY(-100%);
    pointer-events: none;
}
.sm-toolbar h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.sm-hist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.sm-hist-select,
.sm-ver-select {
    max-width: 220px;
    min-width: 140px;
    height: 31px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--lakom-border, #d8d6d0);
    background: var(--lakom-surface, #fff);
    color: inherit;
    padding: 0 8px;
}
.sm-title-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}
.sm-title-edit input {
    width: min(280px, 36vw);
    min-width: 160px;
    height: 31px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--lakom-border, #d8d6d0);
    background: var(--lakom-surface, #fff);
    color: inherit;
    padding: 0 10px;
}
.sm-ver-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}
.sm-ver-input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--lakom-border, #d8d6d0);
}
.sm-page { position: relative; }
.sm-body { display: flex; flex: 1; min-height: 0; position: relative; }
.sm-board-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    background:
        radial-gradient(circle at 50% 50%, rgba(15,118,110,.06), transparent 42%),
        var(--lakom-bg, #f7f7f5);
}
html[data-theme="dark"] .sm-board-wrap {
    background: radial-gradient(circle at 50% 50%, rgba(15,118,110,.12), transparent 42%), #12161c;
}
.sm-presence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin-top: 4px;
}
.sm-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.sm-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    background: #64748b;
    padding: 0;
}
.sm-avatar.is-me { cursor: default; outline: 2px solid rgba(15,118,110,.45); }
.sm-avatar:hover { transform: scale(1.08); }
.sm-cursors {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 18;
}
.sm-cursor {
    position: absolute;
    transform: translate(-2px, -2px);
    pointer-events: none;
    white-space: nowrap;
    will-change: left, top;
}
.sm-cursor.is-pulse svg {
    filter: drop-shadow(0 0 6px rgba(15,118,110,.9));
}
.sm-cursor svg {
    width: 18px;
    height: 18px;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.sm-cursor span {
    display: inline-block;
    margin-left: 14px;
    margin-top: -16px;
    padding: 1px 6px;
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.sm-board {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    user-select: none;
}
.sm-svg {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
}
.sm-edge { pointer-events: auto; cursor: pointer; }
.sm-edge-hit { pointer-events: stroke; }
.sm-svg.is-dim-edges .sm-edge { opacity: 0.22; }
.sm-svg.is-dim-edges .sm-edge.is-hot { opacity: 1; }
.sm-edge.is-hot .sm-edge-line { stroke-width: 4.2px; }
.sm-svg.is-pinned .sm-edge.is-hot .sm-edge-line { stroke-width: 5px; }
.sm-topic {
    position: absolute;
    box-sizing: border-box;
    padding: 8px 12px 24px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #d8d6d0;
    cursor: pointer;
    line-height: 1.25;
    font-size: 12.5px;
    font-weight: 650;
    color: #1a1d21;
    box-shadow: none;
    z-index: 10;
    overflow: hidden;
    pointer-events: auto;
}
html[data-theme="dark"] .sm-topic {
    background: #1a222c;
    border-color: #2a3542;
    color: #e8eef4;
}
.sm-topic:hover {
    border-color: #0f766e;
    z-index: 12;
    overflow: visible;
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
    transform: translateY(-6px);
}
.sm-topic.is-root {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    padding: 14px 18px 28px;
    border-radius: 10px;
}
.sm-topic.is-selected:not(.is-root) {
    outline: 2px solid #0f766e;
    outline-offset: 1px;
}
.sm-topic.is-root.is-selected { outline: 2px solid #134e4a; outline-offset: 2px; }
.sm-plus {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #cfc8be;
    background: #fff;
    font-size: 13px;
    line-height: 16px;
    text-align: center;
    color: #444;
    z-index: 14;
    cursor: pointer;
    padding: 0;
}
html[data-theme="dark"] .sm-plus {
    background: #1a222c;
    border-color: #3a4654;
    color: #ddd;
}
.sm-plus.is-link {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
    font-weight: 800;
    z-index: 16;
}
.sm-plus.is-link:hover {
    background: #b91c1c;
}
.sm-port {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #ea580c;
    box-shadow: 0 0 0 1px #c2410c;
    z-index: 22;
    cursor: grab;
    padding: 0;
}
.sm-port.is-head { background: #0f766e; box-shadow: 0 0 0 1px #0f766e; }
.sm-port.is-new { background: #2563eb; box-shadow: 0 0 0 1px #1d4ed8; }
.sm-port:hover { transform: scale(1.15); }
.sm-board-wrap.is-rewire { cursor: crosshair; }
.sm-rubber {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 21;
}
.sm-topic.is-drop {
    outline: 3px solid #ea580c;
    z-index: 18;
}
.sm-topic.is-loose {
    border-style: dashed;
}
.sm-title {
    display: block;
    cursor: text;
}
.sm-edit-pop {
    position: fixed;
    z-index: 90;
    width: min(360px, calc(100vw - 24px));
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d8d6d0;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
html[data-theme="dark"] .sm-edit-pop {
    background: #1a222c;
    border-color: #2a3542;
}
.sm-edit-pop[hidden] { display: none !important; }
.sm-edit-pop input {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #cfc8be;
    padding: 0 10px;
    font-size: 14px;
}
.sm-edit-pop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.sm-del-inline {
    display: none;
    margin-top: 10px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
    cursor: pointer;
}
.sm-del-inline:hover { background: #b91c1c; }
.sm-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1a1d21;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    z-index: 80;
    transition: opacity .15s, transform .15s;
}
.sm-toast.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sm-k {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
}
.sm-topic.is-root .sm-k { display: none; }
.sm-has-note {
    display: inline-block;
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0f766e;
    margin-left: 6px;
    vertical-align: 1px;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
    cursor: pointer;
}
.sm-has-note:hover { box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.35); }
.sm-note-box #smNoteBody p { font-size: 14px; line-height: 1.45; margin: 0 0 10px; }
.sm-note-box #smNoteBody ul { margin: 0; padding-left: 1.15rem; }
.sm-note-box #smNoteBody li { margin-bottom: 6px; font-size: 14px; line-height: 1.4; }
.sm-kind-check { border-left: 4px solid #ca8a04; }
.sm-kind-route { border-left: 4px solid #ea580c; }
.sm-kind-task { border-left: 4px solid #2563eb; }
.sm-kind-onec { border-left: 4px solid #64748b; }
.sm-kind-result { border-left: 4px solid #16a34a; }
.sm-kind-entry { border-left: 4px solid #0f766e; }
.sm-kind-open,
.sm-topic.has-q {
    border-left: 4px solid #dc2626;
    outline: 2px dashed #dc2626;
    outline-offset: 2px;
}
.sm-topic.is-open-hl {
    outline: 4px solid #dc2626;
    outline-offset: 3px;
    border-color: #dc2626;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.18);
    z-index: 3;
}
.sm-topic.is-dim { opacity: 0.28; }
.sm-check {
    position: absolute;
    left: 6px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c5c0b8;
    border-radius: 4px;
    background: #fff;
    padding: 0;
    color: transparent;
    cursor: pointer;
    line-height: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sm-check svg { width: 12px; height: 12px; display: block; }
.sm-check:hover { border-color: #15803d; }
.sm-topic.is-reviewed:not(.is-root) {
    background: #ecfdf3;
    border-color: #86efac;
}
.sm-topic.is-reviewed .sm-check {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}
.sm-topic.is-root.is-reviewed {
    background: #166534;
    border-color: #166534;
}
html[data-theme="dark"] .sm-check {
    background: #1a222c;
    border-color: #3a4654;
}
html[data-theme="dark"] .sm-topic.is-reviewed:not(.is-root) {
    background: #14532d;
    border-color: #22c55e;
    color: #ecfdf3;
}
html[data-theme="dark"] .sm-topic.is-reviewed .sm-check {
    background: #22c55e;
    border-color: #22c55e;
    color: #052e16;
}
.sm-note {
    position: absolute;
    z-index: 4;
    width: 280px;
    max-height: 240px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #d8d6d0;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #3a3f45;
}
html[data-theme="dark"] .sm-note {
    background: #1a222c;
    border-color: #2a3542;
    color: #c8d0d8;
}
.sm-note ul { margin: 6px 0 0; padding-left: 1.1rem; }
.sm-note li { margin-bottom: 4px; }
.sm-q { border: 1px solid var(--lakom-border, #e6e7e9); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.sm-q h3 { font-size: 13px; margin: 0 0 4px; }
.sm-api-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--lakom-muted, #667085);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sm-api-toggle input { margin: 0; }
.sm-api {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #d8d6d0;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.3;
    color: #334155;
    text-align: left;
}
html[data-theme="dark"] .sm-api { color: #c5d0dc; border-top-color: #2a3542; }
.sm-api-btn {
    position: absolute;
    z-index: 15;
    width: 22px;
    height: 22px;
    border: 1px solid #cfc8be;
    border-radius: 6px;
    background: #fff;
    padding: 3px;
    color: #475569;
    cursor: pointer;
    line-height: 0;
}
.sm-api-btn svg { width: 100%; height: 100%; display: block; }
.sm-api-btn:hover { border-color: #0f766e; color: #0f766e; }
.sm-api-card {
    border: 1px solid #e6e7e9;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.sm-api-card code {
    display: block;
    font-size: 12px;
    color: #0f766e;
    margin-bottom: 4px;
    word-break: break-all;
}
.sm-api-card h3 { font-size: 15px; margin: 0 0 6px; }
.sm-api-card p { font-size: 13px; line-height: 1.4; margin: 0 0 8px; color: #3a3f45; }
.sm-api-card ul { margin: 0; padding-left: 1.1rem; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sm-api-card li { margin-bottom: 3px; }
.sm-leaf {
    position: absolute;
    z-index: 15;
    width: 22px;
    height: 22px;
    border: 1px solid #cfc8be;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    color: #0f766e;
    cursor: pointer;
    line-height: 0;
}
.sm-leaf svg { width: 100%; height: 100%; display: block; }
.sm-leaf.has-items { background: #ecfdf5; border-color: #0f766e; }
.sm-leaf-n {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #0f766e;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}
.sm-comments {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 92vw);
    z-index: 20;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #e6e7e9;
    box-shadow: -10px 0 28px rgba(0,0,0,.08);
}
html[data-theme="dark"] .sm-comments {
    background: #1a222c;
    border-left-color: #2a3542;
}
.sm-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e6e7e9;
    flex: 0 0 auto;
}
.sm-comments-head strong {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.sm-comments-head .btn { flex: 0 0 auto; }
.sm-comments-list {
    flex: 1;
    overflow: auto;
    padding: 10px 14px;
}
.sm-cmt {
    border: 1px solid #ecece8;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12.5px;
}
.sm-cmt.is-reply { margin-left: 18px; background: #f8faf9; }
.sm-cmt-meta { color: #667085; font-size: 11px; margin-bottom: 4px; }
.sm-cmt-reply {
    border: 0;
    background: none;
    color: #0f766e;
    font-size: 11px;
    padding: 0;
    cursor: pointer;
}
.sm-cmt.is-goto { cursor: pointer; }
.sm-cmt-node {
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
    margin-bottom: 4px;
    line-height: 1.3;
}
.sm-all-n {
    display: inline-block;
    min-width: 1.15rem;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}
.sm-comments-form {
    padding: 10px 14px 14px;
    border-top: 1px solid #e6e7e9;
}
.sm-comments-form textarea {
    width: 100%;
    border: 1px solid #d8d6d0;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    resize: vertical;
}
.sm-comments-reply {
    font-size: 12px;
    color: #0f766e;
    margin-bottom: 6px;
}
.sm-lb {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.sm-lb.sm-hidden { display: none !important; }
.sm-lb-back {
    position: absolute;
    inset: 0;
    background: rgba(16, 18, 22, 0.55);
}
.sm-lb-card {
    position: relative;
    width: min(440px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
html[data-theme="dark"] .sm-lb-card { background: #1a222c; color: #e8eef4; }
.sm-lb-card h2 { font-size: 1.15rem; margin: 0 28px 14px 0; }
.sm-lb-card p { font-size: 13px; color: var(--lakom-muted, #667085); margin: 0 0 10px; }
.sm-lb-list { list-style: none; padding: 0; margin: 0 0 14px; }
.sm-lb-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13.5px;
    line-height: 1.35;
}
.sm-lb-list i {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: 0 0 14px;
    margin-top: 3px;
}
.sm-lb-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
}
.sm-hidden { display: none !important; }
@media (max-width: 900px) {
    .sm-page { height: 100vh; margin: 0; }
}
