:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #e7edf8;
  background: #0b1020;
  --panel: #111a2b;
  --line: #26334c;
  --muted: #a0afc8;
  --blue: #4f7cff;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { opacity: .42; cursor: default; }
button:focus-visible, select:focus-visible { outline: 2px solid #87a8ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.app { height: 100%; display: flex; flex-direction: column; }
.top { position: relative; z-index: 6; min-height: 66px; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: #101829; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-name { font-size: 17px; font-weight: 720; letter-spacing: -.04em; }
.brand-label { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .15em; text-transform: uppercase; }
.mark { position: relative; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: #d5e2ff; background: #0a0a0a; border: 1px solid #365088; border-radius: 10px; }
.mark svg { width: 27px; height: 27px; }
.mark img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 160%; height: 160%; max-width: none; object-fit: contain; }
.map-context { display: flex; align-items: center; gap: 9px; min-width: 0; border-left: 1px solid var(--line); padding-left: 18px; }
.map-picker { height: 34px; max-width: 175px; border: 1px solid transparent; background: #172237; border-radius: 8px; color: #c7d4ea; padding: 0 10px; font-size: 12px; }
.crumb { width: 170px; min-width: 80px; height: 34px; border: 1px solid transparent; background: transparent; color: #f0f4fc; font-size: 13px; font-weight: 620; padding: 0 8px; border-radius: 8px; }
.crumb:hover { border-color: var(--line); }
.crumb:focus { outline: 2px solid #6089fa; background: #172237; }
.save-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.saved { color: #a4b8d0; font-size: 11px; max-width: 205px; line-height: 1.5; }
.saved::before { content: '●'; color: #68ccac; margin-right: 6px; font-size: 8px; }
.saved[data-state="pending"]::before { color: #f2c989; }
.saved.error { color: #ffa6ad; }
.saved.error::before { color: #ff8794; }
.actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.history-controls { display: flex; align-items: center; gap: 2px; border-right: 1px solid var(--line); padding-right: 10px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #c1d0e8; font-size: 22px; line-height: 1; transition: color .12s, background .12s, border-color .12s; }
.icon-btn:hover:not(:disabled) { background: #23324b; color: #f1f5ff; border-color: #344864; }
.icon-btn.danger { color: #c9a3ae; }
.icon-btn.danger:hover:not(:disabled) { color: #ffd5dd; background: #422534; border-color: #68404d; }
.map-menu-wrap { position: relative; }
.map-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 120px); overflow-y: auto; padding: 7px; background: #152138; border: 1px solid #354562; border-radius: 13px; box-shadow: 0 16px 40px #02050d66; animation: modal-entry .12s ease-out; }
.map-menu button { display: block; width: 100%; text-align: left; border: 0; padding: 11px 12px; border-radius: 7px; background: transparent; color: #d6e1f2; font-size: 12px; }
.map-menu button:hover:not(:disabled), .map-menu button:focus-visible { background: #23334e; }
.map-menu button.danger { color: #e0acb8; }
.map-menu button.danger:hover:not(:disabled) { background: #422534; }
.menu-label { display: block; color: #95a7c0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 12px 4px; }
.menu-divider { margin: 6px; border-top: 1px solid #2a3953; }
.btn { border: 1px solid #33415b; border-radius: 8px; padding: 9px 12px; background: #19253b; color: #d7e1f3; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: #23324e; border-color: #536688; }
.btn.primary { background: #527bfa; border-color: #6b90ff; color: #fff; box-shadow: 0 3px 15px #2449cb20; }
.btn.primary:hover:not(:disabled) { background: #678cff; }
.btn.danger { color: #d6a9b2; background: transparent; border-color: #4b3b4d; }
.btn.danger:hover:not(:disabled) { color: #ffb8c2; background: #492535; border-color: #68404d; }
.map-delete { margin-right: 8px; }
.btn.small { padding: 6px 8px; font-size: 11px; }
.logout { color: #aebdd4; background: transparent; }
.context-toolbar { position: absolute; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 5px; border: 1px solid #425878; border-radius: 12px; background: #142238f5; box-shadow: 0 8px 22px #03071366; animation: modal-entry .12s ease-out; cursor: default; }
.context-toolbar .icon-btn { width: 40px; height: 40px; }
.contextual-menu { z-index: 5; right: auto; width: 220px; max-height: calc(100% - 20px); }
.connection-mode { position: absolute; z-index: 5; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 24px); padding: 10px 12px; border: 1px solid #668bb0; border-radius: 12px; background: #182b42; color: #dcebf8; font-size: 12px; box-shadow: 0 8px 22px #03071366; }
.connection-mode span { min-width: 0; }
.workspace.connecting, .workspace.connecting .node { cursor: crosshair; }
.node.connection-source > rect { stroke: #8dd8d1; stroke-width: 2.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.node:focus-visible > rect { stroke: #d9e5ff; stroke-opacity: 1; stroke-width: 2.5; }
.free-connection { cursor: pointer; outline: none; }
.connection-line { fill: none; stroke: var(--connection-color, var(--free-color, #8babbc)); stroke-width: var(--connection-width, 1.5); stroke-dasharray: var(--connection-dash, 5 5); stroke-linecap: var(--connection-cap, butt); opacity: .65; vector-effect: non-scaling-stroke; pointer-events: none; }
.connection-hit { fill: none; stroke: transparent; stroke-width: 18; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.free-connection:hover .connection-line, .free-connection.selected .connection-line, .free-connection:focus-visible .connection-line { opacity: 1; stroke: var(--connection-color, var(--free-selected, #b2dedb)); stroke-width: var(--connection-selected-width, 2); }
.connection-caption rect { fill: #16263b; stroke: #466177; stroke-width: 1; }
.connection-caption text { fill: #ccdae9; font-size: 12px; pointer-events: none; }
.free-connection.selected .connection-caption rect, .free-connection:focus-visible .connection-caption rect { stroke: #a1cbc9; }
.topic-indicator { cursor: pointer; outline: none; }
.topic-indicator circle { fill: #20344a; stroke: #7394b0; stroke-width: 1; }
.topic-indicator path { fill: none; stroke: #d0dff1; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.topic-indicator:hover circle, .topic-indicator:focus-visible circle { fill: #304d69; stroke: #e1ecff; stroke-width: 2; }
.inline-editor { position: absolute; z-index: 5; border: 1px solid #81a7ff; border-radius: 13px; padding: 5px; background: #162640; box-shadow: 0 8px 25px #02081666; cursor: text; }
.inline-editor textarea { display: block; width: 100%; min-height: 76px; resize: none; border: 0; padding: 12px; background: transparent; color: #f1f5ff; font-size: 14px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.inline-editor textarea:focus { outline: none; }
.inline-hint { padding: 4px 6px 7px; color: #abbdd6; text-align: center; font-size: 10px; line-height: 1.4; }
.divider { height: 22px; border-left: 1px solid #2b3750; margin: 0 4px; }
.hint { margin-left: auto; color: #889bb9; font-size: 11px; white-space: nowrap; }
.workspace { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab; background-color: #0b1221; background-image: radial-gradient(#22304a 1px, transparent 1px); background-size: 28px 28px; }
.workspace.dragging, .workspace.dragging .node { cursor: grabbing; }
.workspace.loading { cursor: progress; }
svg#canvas { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.edge { fill: none; stroke: #789be0; stroke-width: 1.8; opacity: .7; stroke-linecap: round; pointer-events: none; }
.node { cursor: grab; }
.node rect { fill: #142136; stroke: var(--branch, #789be0); stroke-opacity: var(--branch-opacity, .6); stroke-width: 1.1; filter: drop-shadow(0 3px 5px #03081533); transition: fill .12s, stroke-opacity .12s; }
.node.level-one rect { fill: var(--branch-fill, #1b2d47); }
.node:hover rect { stroke-opacity: 1; fill: color-mix(in srgb, var(--branch-fill, #1b2d47) 85%, #42536b); }
.node.root rect { fill: #294e96; stroke: #8eaeec; stroke-opacity: 1; }
.node text { fill: #e3ecfb; font-size: 13px; font-weight: 580; dominant-baseline: middle; pointer-events: none; }
.node.root text { fill: #fff; font-weight: 650; }
.node.selected rect { stroke: #bfd1ff; stroke-opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 6px #789be021); }
.node .addDot { fill: #17263d; stroke: var(--branch, #789be0); stroke-width: 1.1; cursor: pointer; }
.node [data-act]:focus-visible { outline: none; }
.node [data-act]:focus-visible .addDot { stroke: #d9e5ff; stroke-width: 2.5; }
.node .addTxt { font-size: 14px; fill: #e0eaff; text-anchor: middle; }
.empty { position: absolute; left: 20px; bottom: 24px; color: #8da1bd; font-size: 10px; pointer-events: none; }
.zoom { position: absolute; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 4px; padding: 5px; background: #162136; border: 1px solid #31415d; border-radius: 10px; box-shadow: 0 5px 18px #02050b33; }
.zoom button { width: 36px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: #d0def3; font-size: 18px; }
.zoom button:hover { background: #2b3c5c; }
.zoom #zoomLabel { color: #b6c9e5; font-size: 11px; min-width: 42px; text-align: center; }
.toast { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); max-width: min(560px, 90%); padding: 12px 16px; border: 1px solid #58729b; border-radius: 10px; background: #223553; color: #f0f5fc; font-size: 13px; line-height: 1.5; opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 3; }
.toast.show { opacity: 1; }
.modalback { display: none; position: fixed; inset: 0; place-items: center; z-index: 9; background: #050915b8; backdrop-filter: blur(5px); padding: 20px; }
.modalback.open { display: grid; }
.modal { width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid #354562; background: #152138; border-radius: 18px; padding: 28px; box-shadow: 0 25px 100px #0008; }
.modalback.open .modal { animation: modal-entry .15s ease-out; }
@keyframes modal-entry { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.modal h2 { margin: 0 0 9px; font-size: 20px; letter-spacing: -.03em; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 20px; }
.modal textarea { width: 100%; min-height: 100px; border: 1px solid #3a4b6a; background: #0e182a; color: #eef4ff; border-radius: 10px; padding: 13px; font-size: 14px; resize: vertical; }
.modal textarea:focus { outline: 2px solid #648bff; }
.modalfoot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.modalfoot .btn.danger { background: #643043; border-color: #975269; color: #ffe4e9; }
.modalfoot .btn.danger:hover { background: #7b384f; }
#modalDesc { overflow-wrap: anywhere; }
#modalWarning { font-size: 12px; color: #c9a4af; }
.login-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 25% 25%, #233666 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, #162749 0%, transparent 55%), #0a1020; }
.login-screen.hidden { display: none; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid #344463; background: #121e34; border-radius: 22px; box-shadow: 0 30px 90px #02050e66; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-brand .brand-name { font-size: 23px; }
.login-card h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.04em; margin: 0 0 12px; }
.login-card p { color: #a1b1cb; font-size: 14px; line-height: 1.7; margin: 0 0 26px; }
.login-card label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: #cbd8ee; }
.login-card input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #3a4b68; border-radius: 9px; color: #f0f5ff; background: #0c1629; font-size: 14px; }
.login-card input:focus { outline: 2px solid #648bff; border-color: transparent; }
.login-error { min-height: 22px; color: #ffb0b9; font-size: 12px; line-height: 1.6; margin-top: 15px; }
.login-card .btn { width: 100%; height: 46px; margin-top: 10px; font-size: 14px; }
.login-footer { text-align: center; margin-top: 25px; color: #8296b6; font-size: 11px; letter-spacing: .02em; }
.brand-home { border: 0; padding: 0; background: transparent; color: inherit; text-align: left; border-radius: 6px; }
.back-arrow { font-size: 26px; color: #8da1bd; margin-right: -5px; }
.home { height: 100%; display: flex; flex-direction: column; background: #0c1322; }
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; min-height: 76px; padding: 18px max(24px, calc((100vw - 1200px) / 2)); background: #101829; border-bottom: 1px solid #202d43; }
.home-header .mark { width: 36px; height: 36px; }
.home-account { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; background: transparent; color: #b6c5dc; font-size: 12px; padding: 4px; }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #355078; border-radius: 50%; background: #1c2b45; color: #a9c3fa; font-size: 10px; font-weight: 650; }
.home-account:hover { color: #f0f4fc; background: #172237; }
.home-main { flex: 1; min-height: 0; overflow-y: auto; padding: 52px max(24px, calc((100vw - 1200px) / 2)) 64px; scrollbar-gutter: stable; }
.home-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 34px; }
.home-eyebrow { color: #91ade4; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 12px; }
.home h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -.04em; }
.home h1:focus { outline: none; }
.home-subtitle { color: #98aac4; margin: 12px 0 0; font-size: 13px; line-height: 1.6; }
.home-actions { display: flex; gap: 10px; flex-shrink: 0; }
.home-actions .btn { padding: 12px 16px; }
.home-actions .btn:not(.primary) { border-color: #2d3c55; background: transparent; color: #b5c6df; }
#homeNewMap:focus:not(:focus-visible) { outline: none; }
#homeNewMap:focus-visible { outline: 2px solid #f0f5ff; outline-offset: -4px; }
#homeNewMap:hover:not(:disabled) { background: #5c84fc; }
#homeNewMap:active:not(:disabled) { background: #456fe8; box-shadow: 0 1px 6px #2449cb20; }
.home-library { display: flex; align-items: center; justify-content: flex-start; gap: 16px; border-top: 1px solid #202d43; padding-top: 26px; margin-bottom: 26px; }
.home-search { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); height: 42px; padding: 0 13px; border: 1px solid #2c3b55; border-radius: 9px; background: #111d30; }
.home-search:focus-within { border-color: #7196f9; outline: 2px solid #7196f933; }
.home-search svg { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: #8fa3c1; stroke-width: 1.7; }
.home-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: #e7edf8; font-size: 12px; outline: none; }
.home-search input::placeholder { color: #91a3bf; }
.map-count { font-size: 11px; color: #94a6c0; white-space: nowrap; }
.map-grid, .home-skeleton { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.map-card { position: relative; min-width: 0; border: 1px solid #2a3953; border-radius: 14px; background: #142035; box-shadow: 0 3px 10px #02050b18; cursor: pointer; transition: border-color .14s, box-shadow .14s, transform .14s; }
.map-card:focus-within { border-color: #5a77ac; box-shadow: 0 7px 20px #06112766; }
@media (hover: hover) { .map-card:hover { border-color: #5a77ac; box-shadow: 0 7px 20px #06112766; transform: translateY(-2px); } }
.card-open { display: block; width: 100%; text-align: left; border: 0; padding: 0; border-radius: 14px; background: transparent; color: inherit; }
.card-open:focus-visible { outline-offset: 4px; }
.card-preview { display: block; overflow: hidden; border-radius: 13px 13px 0 0; height: 174px; background-color: #101b2e; background-image: radial-gradient(#27354e .8px, transparent .8px); background-size: 18px 18px; border-bottom: 1px solid #263650; }
.card-preview svg { display: block; width: 100%; height: 100%; }
.card-info { display: block; min-height: 85px; padding: 20px 54px 18px 19px; }
.card-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: #e5edfc; }
.card-date { display: block; font-size: 10px; color: #97aac6; margin-top: 8px; }
.card-menu-toggle { position: absolute; right: 12px; bottom: 27px; width: 32px; height: 32px; }
.card-menu.map-menu { right: 12px; top: auto; bottom: 65px; width: 180px; z-index: 7; }
.home-state { text-align: center; padding: 65px 20px; border: 1px dashed #2b3c56; border-radius: 14px; background: #111c2e; }
.home-state h2 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 12px; }
.home-state p { font-size: 12px; line-height: 1.8; color: #a0b1ca; margin: 0 auto 23px; max-width: 320px; }
.home-state .btn { padding: 12px 16px; }
.empty-map { width: 110px; height: 65px; margin-bottom: 15px; fill: #1b2e4b; stroke: #6d90d5; stroke-width: 1.2; }
.empty-map path { fill: none; stroke-opacity: .7; }
.home-notice { color: #c7d8f7; border: 1px solid #365078; padding: 12px 15px; border-radius: 9px; background: #162540; margin: 0 0 22px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.home-skeleton > div { height: 259px; border: 1px solid #283752; border-radius: 14px; background: linear-gradient(110deg, #132036 30%, #1a2a43 50%, #132036 70%); background-size: 200% 100%; animation: home-loading 1.6s ease-in-out infinite; }
@keyframes home-loading { from { background-position: 180% 0; } to { background-position: -80% 0; } }
#modalNameLabel { display: block; font-size: 12px; color: #cbd8ee; margin-bottom: 9px; }
#modalName { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #3a4b6a; background: #0e182a; color: #eef4ff; border-radius: 9px; font-size: 14px; }
#modalName:focus { outline: 2px solid #648bff; }
#modalNameError { color: #ffb0b9; margin: 8px 0 0; font-size: 11px; }
#modalUrlLabel { display: block; font-size: 12px; color: #c6d4e9; margin-bottom: 8px; }
#modalUrl { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #3a4b6a; background: #0e182a; color: #eef4ff; border-radius: 9px; font-size: 14px; }
#modalUrl:focus { outline: 2px solid #648bff; }
#modalUrlError { color: #ffb0b9; margin: 8px 0 0; font-size: 11px; }
.modalfoot { flex-wrap: wrap; }
#removeLink { margin-right: auto; }
@media (min-width: 701px) { .home-heading { margin-bottom: 26px; } .home-library { padding-top: 20px; margin-bottom: 22px; } }
@media (max-width: 1100px) { .map-grid, .home-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .home-heading { align-items: flex-start; flex-direction: column; gap: 22px; } .home-main { padding: 30px 20px 40px; } .home-header { padding: 16px 20px; } .home h1 { font-size: 28px; } .home-actions { width: 100%; } .home-actions .primary { margin-left: auto; } .home-subtitle { font-size: 12px; } }
@media (max-width: 500px) { .map-grid, .home-skeleton { grid-template-columns: minmax(0, 1fr); gap: 18px; } .home-account > span:nth-child(2) { display: none; } .home-main { padding-inline: 16px; } .home-header { padding-inline: 16px; } .home-library { gap: 10px; } .home-actions .btn { font-size: 11px; padding-inline: 12px; } .home-search { min-width: 0; } .home-state { padding: 44px 14px; } }
@media (max-width: 1100px) { .top { gap: 12px; padding-inline: 16px; } .map-context { padding-left: 12px; } .map-picker { max-width: 140px; } .crumb { width: 130px; } .saved { max-width: 130px; font-size: 10px; } .empty span { display: none; } }
@media (max-width: 900px) { .top { flex-wrap: wrap; gap: 8px 12px; } .brand { margin-right: auto; } .actions { margin-left: auto; } .map-context { order: 3; width: 100%; border-left: 0; padding-left: 0; } .map-picker { max-width: 45%; flex: 1; } .crumb { flex: 1; width: auto; } .save-group { order: 4; width: 100%; margin-left: 0; } .saved { max-width: none; } }
@media (max-width: 600px) { .top { padding: 10px 12px; gap: 7px; } .brand { gap: 8px; } .brand-name { font-size: 16px; } .brand-label { display: none; } .mark { width: 30px; height: 30px; } .actions { gap: 4px; } .actions .header-label { display: none; } .actions .btn { min-width: 36px; height: 36px; padding: 7px; } .history-controls { padding-right: 4px; } .history-controls .icon-btn { width: 32px; } .empty { display: none; } .zoom { right: 12px; bottom: 12px; } .zoom button { width: 40px; height: 40px; } .login-card { padding: 28px; } }
.node.custom-color > rect { fill: var(--branch-fill); stroke: var(--branch); stroke-opacity: .85; }
.node.custom-color.root > rect { stroke-width: 1.8; }
.node.custom-color:hover > rect { fill: color-mix(in srgb, var(--branch-fill) 88%, #8392a9); stroke-opacity: 1; }
.node.custom-color.selected > rect { stroke: #bfd1ff; stroke-opacity: 1; stroke-width: 2; }
.node[data-shape="underline"] > rect { fill: transparent !important; stroke: transparent !important; filter: none !important; }
.topic-underline { fill: none; stroke: var(--branch); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.node.root .topic-underline { stroke-width: 2.5; }
.node[data-shape="underline"].selected > rect, .node[data-shape="underline"]:focus-visible > rect { stroke: #bfd1ff !important; stroke-width: 1; stroke-dasharray: 3 4; }
.node[data-shape="underline"].selected .topic-underline { stroke: #bfd1ff; }
.style-panel { position: absolute; z-index: 6; top: 16px; right: 16px; width: 316px; max-width: calc(100% - 24px); max-height: calc(100% - 90px); display: flex; flex-direction: column; cursor: default; border: 1px solid #425472; border-radius: 16px; background: #142137; color: #e1eafa; box-shadow: 0 16px 48px #02060d66; }
.style-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 10px 14px 8px 18px; border-bottom: 1px solid #2d3f59; }
.style-heading h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.style-heading .icon-btn { font-size: 24px; width: 34px; height: 34px; }
.style-panel form { display: flex; flex-direction: column; min-height: 0; }
.style-scroll { min-height: 0; overflow-y: auto; padding: 14px 18px; overscroll-behavior: contain; }
.style-hint { color: #a6b7d0; font-size: 11px; line-height: 1.5; margin: 0 0 14px; }
.style-preview { display: flex; align-items: center; justify-content: center; min-height: 62px; padding: 16px; margin-bottom: 18px; border: 1px solid var(--preview-accent, #789be0); border-radius: 14px; background: var(--preview-fill, #1b2d47); color: #e7edf8; font-size: var(--preview-size, 13px); font-weight: var(--preview-weight, 580); font-style: var(--preview-font-style, normal); }
.style-preview span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; text-align: center; }
.style-preview[data-shape="soft"] { border-radius: 5px; }
.style-preview[data-shape="capsule"] { border-radius: 80px; }
.style-preview[data-shape="underline"] { border: 0; border-bottom: 2px solid var(--preview-accent); border-radius: 0; background: transparent; }
.style-preview[data-kind="connection"] { border: 0; border-bottom: var(--preview-width, 2px) dashed var(--preview-accent); border-radius: 0; background: transparent; }
.style-preview[data-kind="connection"][data-line="solid"] { border-bottom-style: solid; }
.style-preview[data-kind="connection"][data-line="dotted"] { border-bottom-style: dotted; }
.style-panel fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.style-panel legend { padding: 0; margin: 0 0 10px; color: #c5d3e9; font-size: 11px; font-weight: 650; }
.style-palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-auto { grid-column: 1 / -1; background: #1b2b45; color: #c8d8ee; border: 1px solid #3d506d; border-radius: 8px; min-height: 36px; font-size: 11px; }
.style-swatch { position: relative; height: 34px; border: 1px solid #ffffff22; border-radius: 8px; background: var(--swatch); }
.style-swatch[aria-pressed="true"]::after { content: '✓'; display: grid; place-items: center; width: 21px; height: 21px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #f6f9ff; background: #152138; border-radius: 50%; font-size: 13px; font-weight: 700; }
.style-auto[aria-pressed="true"], .style-text-actions [aria-pressed="true"] { border-color: #87a8ff; background: #2b4268; color: #fff; }
.style-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.style-custom label { flex: 1; font-size: 11px; color: #b4c5df; }
.style-custom input { width: 36px; height: 34px; padding: 3px; border: 1px solid #486080; border-radius: 7px; background: #1b2b45; cursor: pointer; }
.style-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.style-row label { font-size: 11px; color: #b4c5df; }
.style-row select { width: 162px; max-width: 65%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid #3d506d; border-radius: 8px; background: #1b2b45; color: #deebfd; font-size: 11px; }
.style-text-actions { display: flex; gap: 8px; }
.style-text-actions .btn { flex: 1; min-height: 36px; font-size: 11px; }
#styleItalic { font-style: italic; }
.style-reset { padding: 6px 0; border: 0; background: transparent; color: #b3c7e8; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.style-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; flex-shrink: 0; border-top: 1px solid #2d3f59; }
.style-footer .btn { min-height: 38px; font-size: 11px; }
.theme-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-options button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid #3d506d; padding: 8px; border-radius: 9px; background: #1b2b45; color: #c8d8ee; font-size: 11px; }
.theme-options button[aria-pressed="true"] { border-color: #87a8ff; color: #fff; box-shadow: inset 0 0 0 1px #87a8ff; }
.theme-sample { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #ffffff10; border-radius: 5px; background: #0b1221; }
.theme-sample i { width: 17px; height: 11px; border-radius: 3px; background: #294e96; border: 1px solid #789be0; }
.theme-sample i + i { width: 13px; height: 8px; background: #20334d; }
.theme-midnight { background: #080d17; }.theme-midnight i { background: #223b6d; border-color: #829bc7; }
.theme-graphite { background: #171b21; }.theme-graphite i { background: #343f50; border-color: #96a7bf; }
.theme-light { background: #f3f6fb; }.theme-light i { background: #e4edfc; border-color: #5279b8; }
.workspace[data-theme="midnight"] { background-color: #04070d; background-image: radial-gradient(#101722 1px, transparent 1px); --free-color: #819dad; --free-selected: #bbd5db; }
.workspace[data-theme="midnight"] .node:not(.custom-color) > rect { fill: #0d1420; }
.workspace[data-theme="midnight"] .node.level-one:not(.custom-color) > rect { fill: var(--branch-fill); }
.workspace[data-theme="midnight"] .node.root:not(.custom-color) > rect { fill: #17263f; stroke: #839dc8; }
.workspace[data-theme="midnight"] .context-toolbar, .workspace[data-theme="midnight"] .style-panel, .workspace[data-theme="midnight"] .contextual-menu { background: #101b2b; }
.workspace[data-theme="graphite"] { background-color: #222324; background-image: radial-gradient(#353636 1px, transparent 1px); --free-color: #9eaeb8; --free-selected: #d1dedf; }
.workspace[data-theme="graphite"] .node:not(.custom-color) > rect { fill: #2c2d2f; }
.workspace[data-theme="graphite"] .node.level-one:not(.custom-color) > rect { fill: var(--branch-fill); }
.workspace[data-theme="graphite"] .node.root:not(.custom-color) > rect { fill: #3b3c3f; stroke: #a4a5aa; }
.workspace[data-theme="graphite"] .context-toolbar, .workspace[data-theme="graphite"] .style-panel, .workspace[data-theme="graphite"] .contextual-menu, .workspace[data-theme="graphite"] .zoom { background: #252d38; border-color: #49576a; }
.workspace[data-theme="light"] { color-scheme: light; background-color: #f3f6fb; background-image: radial-gradient(#d8e0ed 1px, transparent 1px); --free-color: #537485; --free-selected: #34675f; }
.workspace[data-theme="light"] .node > rect { filter: drop-shadow(0 3px 5px #34496612); }
.workspace[data-theme="light"] .node:not(.custom-color) > rect { fill: #fff; }
.workspace[data-theme="light"] .node.level-one:not(.custom-color) > rect { fill: var(--branch-fill); }
.workspace[data-theme="light"] .node.root:not(.custom-color) > rect { fill: #e4edfc; stroke: #5279b8; }
.workspace[data-theme="light"] .node .node-label { fill: #25344a; }
.workspace[data-theme="light"] .node.root .node-label { fill: #233f69; }
.workspace[data-theme="light"] .node.custom-color:hover > rect { fill: color-mix(in srgb, var(--branch-fill) 90%, #b1bfd3); }
.workspace[data-theme="light"] .node.selected > rect, .workspace[data-theme="light"] .node:focus-visible > rect { stroke: #335da0; }
.workspace[data-theme="light"] .node[data-shape="underline"].selected > rect, .workspace[data-theme="light"] .node[data-shape="underline"]:focus-visible > rect { stroke: #335da0 !important; }
.workspace[data-theme="light"] .node[data-shape="underline"].selected .topic-underline { stroke: #335da0; }
.workspace[data-theme="light"] .node.connection-source > rect { stroke: #397d71; }
.workspace[data-theme="light"] .context-toolbar, .workspace[data-theme="light"] .contextual-menu, .workspace[data-theme="light"] .style-panel, .workspace[data-theme="light"] .zoom, .workspace[data-theme="light"] .connection-mode { background: #fff; border-color: #bdcbe0; color: #25344a; box-shadow: 0 8px 22px #3349661a; }
.workspace[data-theme="light"] .icon-btn, .workspace[data-theme="light"] .contextual-menu button, .workspace[data-theme="light"] .zoom button { color: #3c506d; }
.workspace[data-theme="light"] .icon-btn:hover:not(:disabled), .workspace[data-theme="light"] .contextual-menu button:hover, .workspace[data-theme="light"] .zoom button:hover { background: #e8eef7; border-color: #bdcbe0; }
.workspace[data-theme="light"] .btn:not(.primary) { background: #edf2fa; border-color: #c1cee2; color: #3e5579; }
.workspace[data-theme="light"] .zoom #zoomLabel, .workspace[data-theme="light"] .empty { color: #526986; }
.workspace[data-theme="light"] .divider, .workspace[data-theme="light"] .menu-divider { border-color: #c4d1e5; }
.workspace[data-theme="light"] .connection-caption rect { fill: #fff; stroke: #9caec8; }
.workspace[data-theme="light"] .connection-caption text { fill: #344c67; }
.workspace[data-theme="light"] .free-connection.selected .connection-caption rect { stroke: #34675f; }
.workspace[data-theme="light"] .topic-indicator circle, .workspace[data-theme="light"] .node .addDot { fill: #edf3fb; stroke: #6c86ac; }
.workspace[data-theme="light"] .topic-indicator path, .workspace[data-theme="light"] .node .addTxt { stroke: #3d5577; fill: none; }
.workspace[data-theme="light"] .node .addTxt { fill: #3d5577; stroke: none; }
.workspace[data-theme="light"] .topic-indicator:focus-visible circle, .workspace[data-theme="light"] .topic-indicator:hover circle { fill: #dce7f7; stroke: #335da0; }
.workspace[data-theme="light"] .inline-editor { background: #fff; border-color: #587ab3; }
.workspace[data-theme="light"] .inline-editor textarea { color: #25344a; }
.workspace[data-theme="light"] .inline-hint { color: #526986; }
.workspace[data-theme="light"] .style-heading, .workspace[data-theme="light"] .style-footer { border-color: #d5dfec; }
.workspace[data-theme="light"] .style-hint, .workspace[data-theme="light"] .style-panel legend, .workspace[data-theme="light"] .style-row label, .workspace[data-theme="light"] .style-custom label { color: #526986; }
.workspace[data-theme="light"] .style-preview { color: #25344a; }
.workspace[data-theme="light"] .style-auto, .workspace[data-theme="light"] .style-row select, .workspace[data-theme="light"] .style-custom input, .workspace[data-theme="light"] .theme-options button { background: #f3f6fb; border-color: #bdcbe0; color: #334c70; }
.workspace[data-theme="light"] .style-reset { color: #42679c; }
.workspace[data-theme="light"] .style-auto[aria-pressed="true"], .workspace[data-theme="light"] .style-text-actions [aria-pressed="true"], .workspace[data-theme="light"] .theme-options button[aria-pressed="true"] { background: #e3ecfb; border-color: #42679c; color: #234a87; }
.workspace[data-theme="midnight"] .node.root.selected > rect, .workspace[data-theme="graphite"] .node.root.selected > rect { stroke: #bfd1ff; }
.workspace[data-theme="light"] .node.root.selected > rect { stroke: #335da0; }
.workspace[data-theme="light"] .contextual-menu button:focus-visible { background: #e8eef7; color: #3c506d; }
.workspace[data-theme="light"] button:focus-visible, .workspace[data-theme="light"] select:focus-visible, .workspace[data-theme="light"] input:focus-visible { outline-color: #42679c; }
.style-panel input:focus-visible { outline: 2px solid #87a8ff; outline-offset: 3px; }
@media (max-width: 600px) {
  .style-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-width: none; max-height: min(58%, 430px); }
  .style-scroll { padding: 12px 16px; }
  .style-swatch, .style-auto, .style-row select, .style-text-actions .btn, .style-custom input { min-height: 40px; }
  .style-preview { min-height: 54px; margin-bottom: 14px; }
  .style-footer .btn { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.creation-backdrop { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 24px; background: #050915b8; backdrop-filter: blur(5px); }
.creation-dialog { width: min(1040px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid #354562; background: #111b2d; border-radius: 20px; box-shadow: 0 25px 100px #0008; }
.creation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 26px 28px 22px; border-bottom: 1px solid #26344e; }
.creation-heading h2 { margin: 7px 0 9px; font-size: 25px; letter-spacing: -.04em; }
.creation-heading p:last-child { margin: 0; color: #a0afc8; font-size: 12px; line-height: 1.6; }
.creation-heading .icon-btn { flex-shrink: 0; }
.creation-scroll { padding: 24px 28px 28px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.creation-blank { display: flex; align-items: center; gap: 18px; width: 100%; padding: 18px 20px; border: 1px solid #3d527b; border-radius: 13px; text-align: left; color: #e7edf8; background: #192943; }
.creation-blank:hover { background: #203352; border-color: #668bc5; }
.creation-blank > span:nth-child(2) { flex: 1; min-width: 0; }
.creation-blank strong { display: block; font-size: 14px; font-weight: 650; }
.creation-blank small { display: block; margin-top: 5px; color: #afbdd3; font-size: 11px; line-height: 1.5; }
.blank-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #2b4266; color: #bcd1f5; font-size: 25px; flex-shrink: 0; }
.template-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.template-section-heading h3 { margin: 0; font-size: 14px; font-weight: 650; }
.template-section-heading > span { font-size: 10px; color: #90a2bd; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.template-card { min-width: 0; overflow: hidden; border: 1px solid #2e3e59; border-radius: 13px; background: #162238; transition: border-color .15s; }
.template-card:focus-within, .template-card:hover { border-color: #536d99; }
.template-preview { aspect-ratio: 2 / 1; overflow: hidden; background: #0b1221; border-bottom: 1px solid #293b58; }
.template-preview svg { width: 100%; height: 100%; display: block; }
.template-info { padding: 16px; }
.template-category { display: block; color: #94abd0; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.template-info h4 { margin: 7px 0; color: #e8effc; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.template-info p { color: #a3b2c9; font-size: 11px; line-height: 1.6; margin: 0 0 16px; min-height: 36px; overflow-wrap: anywhere; }
.template-actions { display: flex; align-items: center; gap: 5px; }
.template-actions > .btn { flex: 1; display: flex; justify-content: space-between; gap: 8px; min-height: 40px; font-size: 11px; }
.template-actions .icon-btn { width: 34px; height: 40px; font-size: 18px; flex-shrink: 0; }
.template-status { color: #92a5c0; font-size: 12px; line-height: 1.6; margin-bottom: 0; }
#modalDescription { min-height: 86px; margin-top: 7px; }
#modalDescriptionLabel { display: block; margin-top: 16px; color: #a0afc8; font-size: 12px; }
@media (max-width: 1100px) { .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .creation-backdrop { padding: 12px; }.creation-dialog { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .creation-heading { padding: 20px 16px 16px; }.creation-heading h2 { font-size: 22px; }.creation-heading .home-eyebrow { font-size: 9px; }
  .creation-heading .icon-btn { width: 44px; height: 44px; }
  .creation-scroll { padding: 16px; }.creation-blank { gap: 12px; padding: 14px; }.template-grid { grid-template-columns: 1fr; gap: 16px; }
  .template-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }.template-info { padding: 16px; }
  .template-actions > .btn, .template-actions .icon-btn { min-height: 44px; }
}
