:root {
    color-scheme: light;
    --background: #f4f6f8;
    --surface: #ffffff;
    --text: #17202a;
    --muted: #65717e;
    --border: #dce2e8;
    --primary: #275efe;
    --primary-hover: #1748d5;
    --danger-background: #fff1f1;
    --danger-text: #9a2929;
    --success-background: #eefaf2;
    --success-text: #246b3b;
}

[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2 {
    margin-top: 0;
    line-height: 1.2;
}

.site-header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.header-navigation,
.site-header form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-navigation {
    gap: 28px;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main-navigation a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.main-navigation a:hover {
    color: var(--primary);
}

.brand {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 48px auto;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(19, 33, 49, 0.06);
}

.auth-card {
    width: min(100%, 440px);
    margin: 8vh auto 0;
    padding: 32px;
}

.auth-card form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 94, 254, 0.15);
}

select {
    padding: 11px 34px 11px 12px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
}

.button:hover {
    background: var(--primary-hover);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button-secondary {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--background);
}

.button-danger {
    background: var(--danger-background);
    color: var(--danger-text);
}

.button-danger:hover {
    background: #fbdede;
}

.muted,
.user-label {
    color: var(--muted);
}

.notice {
    margin: 20px 0;
    padding: 12px 14px;
    border-radius: 7px;
}

.notice-error {
    background: var(--danger-background);
    color: var(--danger-text);
}

.notice-success {
    background: var(--success-background);
    color: var(--success-text);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.create-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.4fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
}

.import-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.4fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
}

.import-card h2,
.import-card p {
    margin: 0;
}

.import-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.create-card h2,
.mindmap-card h2 {
    margin-bottom: 6px;
}

.create-card p,
.mindmap-card p {
    margin: 0;
}

.create-form,
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mindmap-list {
    display: grid;
    gap: 14px;
}

.user-create-card {
    margin-bottom: 24px;
    padding: 24px;
}

.user-create-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.user-list {
    display: grid;
    gap: 16px;
}

.access-create-card {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.5fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
    padding: 24px;
}

.share-link-create-card {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.5fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
    padding: 24px;
}

.share-link-create-card h2,
.share-link-create-card p,
.share-link-card h2,
.share-link-card p {
    margin: 0;
}

.share-link-created {
    display: grid;
    gap: 8px;
}

.share-link-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.share-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
}

.compact-empty-state {
    padding: 24px;
}

.access-create-card h2,
.access-create-card p,
.access-card h2,
.access-card p {
    margin: 0;
}

.access-list {
    display: grid;
    gap: 14px;
}

.access-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(320px, auto) auto;
    gap: 18px;
    align-items: end;
    padding: 20px 24px;
}

.access-form {
    display: flex;
    gap: 10px;
    align-items: end;
}

.user-card {
    padding: 22px 24px;
}

.user-card-heading,
.user-card-actions,
.user-action-form {
    display: flex;
    gap: 16px;
    align-items: center;
}

.user-card-heading {
    justify-content: space-between;
}

.user-card-heading h2,
.user-card-heading p {
    margin: 0;
}

.user-card-actions {
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.user-action-form {
    align-items: flex-end;
}

.password-form {
    justify-content: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    min-height: 46px;
}

.checkbox-label input {
    width: auto;
}

.status-badge {
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.system-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.system-summary-card,
.system-section {
    padding: 22px 24px;
}

.system-summary-card p,
.system-section-heading p,
.system-check p,
.migration-row p,
.update-log-row p {
    margin: 0;
}

.system-summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}

.system-section {
    margin-bottom: 24px;
}

.system-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.system-section-heading h2 {
    margin-bottom: 4px;
}

.system-check-list,
.migration-list,
.update-log-list {
    display: grid;
    gap: 0;
}

.system-check,
.migration-row,
.update-log-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.migration-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.check-indicator {
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    min-width: 68px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.check-ok {
    background: var(--success-background);
    color: var(--success-text);
}

.check-warning {
    background: #fff7df;
    color: #795b0a;
}

.check-error {
    background: var(--danger-background);
    color: var(--danger-text);
}

.backup-checklist {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    padding-left: 22px;
}

.icon-source-groups {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.icon-source-group {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
}

.icon-source-group summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 750;
}

.icon-source-group[open] summary {
    border-bottom: 1px solid var(--border);
}

.icon-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
    padding: 14px;
}

.icon-source-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    padding: 14px 8px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    text-align: center;
}

.icon-source-card svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: #32465f;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-source-card strong {
    overflow: hidden;
    width: 100%;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-source-card code {
    overflow: hidden;
    width: 100%;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-checklist code {
    font-size: 14px;
}

.mindmap-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, auto) minmax(260px, 1.2fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 24px;
}

.mindmap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mindmap-meta {
    min-width: 0;
}

.mindmap-meta h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mindmap-meta a {
    color: var(--text);
    text-decoration: none;
}

.mindmap-meta a:hover {
    color: var(--primary);
}

.editor-page {
    display: flex;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}

.editor-page .site-header {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
}

.editor-page .page-editor {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    margin: 0;
}

.editor-workspace {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.editor-heading {
    position: absolute;
    z-index: 10;
    top: 16px;
    right: 16px;
    left: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.editor-title-panel,
.editor-command-tools,
.editor-settings-tools,
.viewport-actions {
    pointer-events: auto;
}

.editor-selection-count {
    align-self: center;
    min-width: max-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8efff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.editor-title-panel {
    min-width: 220px;
    max-width: min(380px, 35vw);
    padding: 12px 16px;
}

.editor-heading h1 {
    overflow: hidden;
    margin: 4px 0 2px;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-heading p {
    margin: 0;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
}

.editor-actions {
    display: contents;
}

.editor-command-tools,
.editor-settings-tools,
.viewport-actions {
    position: absolute;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    padding: 6px;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    scrollbar-width: thin;
}

.editor-command-tools {
    top: 96px;
    left: 0;
    max-width: min(520px, calc(100vw - 32px));
}

.editor-settings-tools {
    top: 0;
    right: 0;
    max-width: calc(100vw - 440px);
}

.viewport-actions {
    top: 54px;
    right: 0;
    max-width: min(620px, calc(100vw - 32px));
}

.editor-floating-toolbar.is-vertical {
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: min(320px, calc(100vw - 32px));
}

.editor-floating-toolbar.is-custom-position {
    position: fixed;
    z-index: 30;
    right: auto;
    bottom: auto;
}

.editor-floating-toolbar.is-moving {
    opacity: 0.88;
    box-shadow: 0 16px 42px rgba(19, 33, 49, 0.22);
}

.editor-floating-toolbar.is-vertical .editor-tool-group {
    flex-direction: column;
    align-items: stretch;
}

.editor-floating-toolbar.is-vertical .editor-layout-select,
.editor-floating-toolbar.is-vertical .editor-layout-option-select,
.editor-floating-toolbar.is-vertical .editor-grid-select {
    width: 100%;
}

.editor-toolbar-handle {
    width: 24px;
    min-width: 24px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: move;
    font: inherit;
    font-weight: 800;
    letter-spacing: -3px;
}

.editor-toolbar-orientation {
    width: 30px;
    min-width: 30px;
    height: 36px;
    padding: 0;
    font-size: 15px;
}

.editor-stage-color {
    display: inline-flex;
    width: 36px;
    min-width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    cursor: pointer;
}

.editor-stage-color input {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.editor-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    font-size: 19px;
    line-height: 1;
}

.tool-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tool-icon-concept {
    stroke-width: 1.65;
}

.editor-tool-button:has(.tool-icon-concept) {
    border-color: transparent;
    background: transparent;
    color: #32465f;
}

.editor-tool-button:has(.tool-icon-concept):hover {
    border-color: transparent;
    background: #eef4ff;
    color: #1748d5;
}

.editor-tool-button.is-active:has(.tool-icon-concept) {
    outline: 0;
    background: #e8f0ff;
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(39, 94, 254, 0.08);
}

.editor-tool-button.button-danger:has(.tool-icon-concept) {
    color: var(--danger-text);
}

.editor-tool-button.button-danger:has(.tool-icon-concept):hover {
    background: var(--danger-background);
}

.editor-tool-button.is-active {
    outline: 3px solid rgba(39, 94, 254, 0.25);
    background: var(--primary);
    color: #fff;
}

.editor-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: max-content;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface) 92%, var(--background));
}

.editor-tool-group-label {
    padding: 0 5px 0 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.editor-layout-select,
.editor-layout-option-select,
.editor-grid-select {
    width: 126px;
    min-width: 126px;
    height: 36px;
    padding: 5px 28px 5px 9px;
    font-size: 13px;
}

.editor-layout-option-select {
    width: 108px;
    min-width: 108px;
    height: 36px;
    padding: 5px 26px 5px 8px;
    font-size: 12px;
}

.editor-layout-option-select:disabled {
    opacity: 0.5;
}

.editor-grid-select {
    width: 92px;
    min-width: 92px;
}

.editor-grid-dot {
    fill: #9fb1c2;
    opacity: 0.46;
}

.tool-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.node-color-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.node-color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border: 2px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.node-color-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.node-color-option:hover {
    background: var(--background);
}

.node-color-option:has(input:checked) {
    border-color: var(--primary);
    background: #eef3ff;
}

.node-color-option:has(input:focus-visible) {
    outline: 3px solid rgba(39, 94, 254, 0.2);
}

.node-color-option:has(input:disabled) {
    cursor: default;
}

.node-color-option span {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: 2px solid var(--node-option-stroke, #7f8b95);
    border-radius: 6px;
    background: var(--node-option-fill, #fff);
}

.node-color-blue { --node-option-fill: #82b8e6; --node-option-stroke: #356f9f; }
.node-color-petrol { --node-option-fill: #72bdb5; --node-option-stroke: #307a76; }
.node-color-turquoise { --node-option-fill: #59c3cf; --node-option-stroke: #287b85; }
.node-color-indigo { --node-option-fill: #8797d8; --node-option-stroke: #4f609f; }
.node-color-sand { --node-option-fill: #dfb84e; --node-option-stroke: #89681d; }
.node-color-orange { --node-option-fill: #e59a52; --node-option-stroke: #9a5924; }
.node-color-coral { --node-option-fill: #df8a74; --node-option-stroke: #985344; }
.node-color-violet { --node-option-fill: #ae91cc; --node-option-stroke: #704f8e; }
.node-color-rose { --node-option-fill: #d58ca7; --node-option-stroke: #92516a; }
.node-color-taupe { --node-option-fill: #b9a18f; --node-option-stroke: #786251; }
.node-color-gray { --node-option-fill: #aeb9c3; --node-option-stroke: #687783; }
.node-color-pure-red { --node-option-fill: #ff0000; --node-option-stroke: #ff0000; }
.node-color-pure-green { --node-option-fill: #00ff00; --node-option-stroke: #00ff00; }
.node-color-pure-blue { --node-option-fill: #0000ff; --node-option-stroke: #0000ff; }
.node-color-pure-yellow { --node-option-fill: #ffff00; --node-option-stroke: #ffff00; }
.node-color-black { --node-option-fill: #000000; --node-option-stroke: #000000; }
.node-color-pure-gray { --node-option-fill: #808080; --node-option-stroke: #808080; }

.node-detail-dialog {
    width: min(640px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(19, 33, 49, 0.25);
}

.node-detail-dialog::backdrop {
    background: rgba(23, 32, 42, 0.45);
    backdrop-filter: blur(2px);
}

.node-detail-form {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.node-detail-heading,
.node-detail-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.node-detail-heading h2 {
    margin-bottom: 0;
}

.node-detail-hint {
    margin: -6px 0 0;
    font-size: 14px;
}

.node-description-count {
    justify-self: end;
    margin-top: -2px;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.node-detail-colors {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.node-detail-icons {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.node-detail-colors legend,
.node-detail-icons legend {
    padding: 0 5px;
    font-weight: 650;
}

.bulk-apply-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

#bulk-tag-mode {
    margin: 6px 0;
}

.node-icon-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.node-icon-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
}

.node-icon-option:hover {
    background: var(--background);
}

.node-icon-option:has(input:checked) {
    border-color: var(--primary);
    background: #eef3ff;
}

.node-icon-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.node-icon-preview {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #edf2ff;
    color: var(--primary);
}

.node-icon-preview svg,
.node-option-icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.node-detail-actions {
    justify-content: flex-end;
}

.viewport-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-button {
    width: 42px;
    padding-inline: 0;
    font-size: 20px;
}

.zoom-level {
    min-width: 58px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

.viewport-actions.is-vertical .zoom-level {
    display: none;
}

.editor-notifications {
    position: absolute;
    z-index: 15;
    bottom: 16px;
    left: 50%;
    width: min(420px, calc(100% - 32px));
    transform: translateX(-50%);
    pointer-events: none;
}

.selected-node-inspector {
    position: absolute;
    z-index: 12;
    bottom: 16px;
    left: 16px;
    width: min(360px, calc(100% - 90px));
    padding: 14px 16px;
    pointer-events: auto;
}

.selected-node-inspector h2 {
    margin: 3px 0 7px;
    font-size: 17px;
}

.selected-node-inspector-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-node-inspector-mode {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 11px;
}

.selected-node-inspector p {
    margin: 0;
}

.google-snippet-preview {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #e2e6eb;
    border-radius: 10px;
    background: #fff;
    font-family: Arial, sans-serif;
}

.google-snippet-preview .google-snippet-site {
    overflow: hidden;
    color: #202124;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.google-snippet-preview .google-snippet-title {
    margin-top: 4px;
    color: #1a0dab;
    font-size: 18px;
    line-height: 1.3;
}

.google-snippet-preview .google-snippet-description {
    margin-top: 4px;
    color: #4d5156;
    font-size: 13px;
    line-height: 1.45;
}

.google-snippet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.google-snippet-meta-item {
    padding: 3px 7px;
    border-radius: 999px;
    background: #f1f3f4;
    color: #4d5156;
    font: 600 10px/1.3 system-ui, sans-serif;
}

.google-snippet-meta-item.is-positive {
    background: #e6f4ea;
    color: #137333;
}

.google-snippet-meta-item.is-negative {
    background: #fce8e6;
    color: #b3261e;
}

.selected-node-inspector-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.selected-node-inspector-tag {
    padding: 3px 8px;
    border: 1px solid rgba(39, 94, 254, 0.2);
    border-radius: 999px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.pan-momentum-debug {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 1000;
    max-width: min(620px, calc(100vw - 24px));
    max-height: 260px;
    overflow: auto;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.88);
    color: #dbeafe;
    font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    pointer-events: none;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.editor-message {
    margin: 0;
    border: 1px solid currentColor;
    box-shadow: 0 10px 30px rgba(19, 33, 49, 0.18);
}

.mindmap-editor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background-color: var(--stage-color, #f7f9fc);
}

.mindmap-editor.is-drag-auto-panning {
    box-shadow: inset 0 0 0 3px rgba(39, 94, 254, 0.28), inset 0 0 80px rgba(39, 94, 254, 0.08);
}

.inline-title-editor {
    position: absolute;
    z-index: 18;
    min-width: 150px;
}

.inline-title-editor input {
    width: 100%;
    height: 36px;
    padding: 6px 9px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    outline: 4px solid rgba(39, 94, 254, 0.18);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 22px rgba(19, 33, 49, 0.2);
    font: 650 15px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#mindmap-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
    touch-action: none;
}

#mindmap-canvas.is-pan-ready {
    cursor: grab;
}

#mindmap-canvas.is-panning {
    cursor: grabbing;
}

#mindmap-canvas.is-pan-momentum {
    cursor: grab;
}

#mindmap-canvas.is-inline-title-tool .mindmap-node {
    cursor: text;
}

.mindmap-connection {
    fill: none;
    stroke: #aab7c4;
    stroke-linecap: round;
    stroke-width: 3;
}

.mindmap-path-highlight-glow,
.mindmap-path-highlight {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.mindmap-path-highlight-glow {
    stroke: rgba(39, 94, 254, 0.2);
    stroke-width: 12;
}

.mindmap-path-highlight {
    stroke: var(--primary);
    stroke-width: 4;
}

.mindmap-dock-point {
    fill: #fff;
    stroke: #8da0b4;
    stroke-width: 1.5;
    pointer-events: none;
}

[data-can-edit="1"] .mindmap-dock-point {
    pointer-events: all;
    cursor: move;
}

.mindmap-dock-point.is-manual {
    fill: #e8efff;
    stroke: var(--primary);
}

.mindmap-node {
    cursor: pointer;
    outline: none;
}

[data-can-edit="1"] .mindmap-node {
    cursor: grab;
}

[data-can-edit="1"] .mindmap-node:active {
    cursor: grabbing;
}

.mindmap-node-card {
    fill: var(--node-fill, var(--surface));
    stroke: var(--node-stroke, #9aabba);
    stroke-width: 1.25;
    filter: drop-shadow(0 4px 6px rgba(19, 33, 49, 0.12));
}

.mindmap-node-title {
    fill: var(--text);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.15px;
    pointer-events: none;
}

.mindmap-node-icon circle {
    fill: color-mix(in srgb, var(--node-stroke, #275efe) 13%, #fff);
    stroke: color-mix(in srgb, var(--node-stroke, #275efe) 35%, #fff);
    stroke-width: 1;
}

.mindmap-node-icon-symbol {
    fill: none;
    color: var(--node-stroke, var(--primary));
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.icons-inverted .mindmap-node-icon circle,
.icons-inverted .history-node-icon-circle {
    fill: var(--node-stroke, var(--primary));
    stroke: var(--node-stroke, var(--primary));
}

.icons-inverted .mindmap-node-icon-symbol {
    color: #fff;
}

.nodes-inverted .mindmap-node-card {
    fill: var(--node-stroke, var(--primary));
}

.nodes-inverted .mindmap-node-title,
.nodes-inverted .mindmap-node-description {
    fill: var(--node-contrast, #fff);
}

.nodes-inverted .mindmap-node-icon circle,
.nodes-inverted .history-node-icon-circle {
    fill: color-mix(in srgb, var(--node-contrast, #fff) 16%, transparent);
    stroke: color-mix(in srgb, var(--node-contrast, #fff) 60%, transparent);
}

.nodes-inverted .mindmap-node-icon-symbol {
    color: var(--node-contrast, #fff);
}

.nodes-inverted .mindmap-node-tag-badge rect {
    fill: color-mix(in srgb, var(--node-contrast, #fff) 18%, transparent);
    stroke: color-mix(in srgb, var(--node-contrast, #fff) 55%, transparent);
}

.nodes-inverted .mindmap-node-tag-badge text {
    fill: var(--node-contrast, #fff);
}

.nodes-inverted .mindmap-node.is-selected .mindmap-node-card,
.nodes-inverted .mindmap-node:focus .mindmap-node-card {
    stroke: var(--node-contrast, #fff);
}

.mindmap-root-halo {
    fill: color-mix(in srgb, var(--node-stroke, var(--primary)) 5%, transparent);
    stroke: color-mix(in srgb, var(--node-stroke, var(--primary)) 22%, transparent);
    stroke-width: 5;
    filter: drop-shadow(0 8px 14px rgba(39, 94, 254, 0.12));
    pointer-events: none;
}

.mindmap-node.is-root .mindmap-node-title {
    font-weight: 760;
}

.mindmap-node.is-root .mindmap-node-icon circle {
    stroke-width: 1.5;
}

.mindmap-node-description {
    fill: #536476;
    font-size: 11px;
    letter-spacing: -0.05px;
    pointer-events: none;
}

.mindmap-node-tag-badge rect {
    fill: color-mix(in srgb, var(--node-stroke, var(--primary)) 14%, #fff);
    stroke: color-mix(in srgb, var(--node-stroke, var(--primary)) 24%, #fff);
    stroke-width: 0.75;
}

.mindmap-node-tag-badge text {
    fill: var(--node-stroke, var(--primary));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.05px;
    pointer-events: none;
}

.history-node-icon-circle {
    fill: #fff;
    stroke: var(--node-stroke, var(--primary));
    stroke-width: 1;
}

.mindmap-node-description-marker circle {
    fill: #17202a;
    stroke: #fff;
    stroke-width: 1.5;
}

.mindmap-node-description-marker text {
    fill: #fff;
    font-size: 11px;
    font-weight: 800;
}

.mindmap-node-collapse-marker circle {
    fill: var(--primary);
    stroke: #fff;
    stroke-width: 1.5;
}

.mindmap-node-collapse-marker text {
    fill: #fff;
    font-size: 9px;
    font-weight: 800;
}

.mindmap-node.is-selected .mindmap-node-card,
.mindmap-node:focus .mindmap-node-card {
    stroke: var(--primary);
    stroke-width: 3;
}

.mindmap-node.is-path-highlight .mindmap-node-card {
    filter:
        drop-shadow(0 0 5px rgba(39, 94, 254, 0.34))
        drop-shadow(0 4px 6px rgba(19, 33, 49, 0.12));
}

.mindmap-node.is-reparent-source .mindmap-node-card {
    stroke: var(--danger-text);
    stroke-width: 3;
    stroke-dasharray: 8 5;
}

.mindmap-node.is-reparent-target .mindmap-node-card {
    stroke: var(--success-text);
    stroke-width: 3;
}

.mindmap-node.is-reparent-invalid {
    opacity: 0.42;
}

.mindmap-node.is-drag-preview {
    opacity: 0.28;
    pointer-events: none;
}

.mindmap-node.is-drag-preview .mindmap-node-card {
    stroke-dasharray: 7 5;
    filter: none;
}

.mindmap-connection.is-drag-preview {
    opacity: 0.24;
    stroke-dasharray: 7 6;
    pointer-events: none;
}

.editor-help {
    position: absolute;
    z-index: 10;
    right: 16px;
    bottom: 16px;
    pointer-events: auto;
}

.editor-help .button {
    box-shadow: 0 8px 28px rgba(19, 33, 49, 0.12);
}

.editor-help-dialog {
    width: min(980px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--background);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(19, 33, 49, 0.25);
}

.editor-help-dialog::backdrop {
    background: rgba(23, 32, 42, 0.38);
    backdrop-filter: blur(2px);
}

.editor-help-dialog-heading,
.editor-help-dialog-actions {
    position: sticky;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
}

.editor-help-dialog-heading {
    top: 0;
    border-bottom: 1px solid var(--border);
}

.editor-help-dialog-heading h2 {
    margin: 2px 0 0;
}

.editor-help-dialog-content {
    padding: 18px;
}

.editor-help-dialog-actions {
    bottom: 0;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.editor-help-dialog .help-section {
    box-shadow: none;
}

.history-heading {
    position: absolute;
    z-index: 10;
    top: 16px;
    right: 16px;
    left: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.history-heading > * {
    pointer-events: auto;
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: min(680px, calc(100% - 250px));
    padding: 7px;
}

.history-controls input[type="range"] {
    width: min(320px, 30vw);
}

.history-controls output {
    min-width: 54px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.history-status {
    position: absolute;
    z-index: 10;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 3px;
    min-width: 250px;
    padding: 10px 14px;
}

#history-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.history-node {
    cursor: default;
}

.editor-help details {
    position: relative;
}

.editor-help summary {
    margin-left: auto;
    list-style: none;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(19, 33, 49, 0.12);
}

.editor-help summary::-webkit-details-marker {
    display: none;
}

.editor-help-panel {
    position: absolute;
    right: 0;
    bottom: 44px;
    width: min(620px, calc(100vw - 32px));
    max-height: min(520px, calc(100dvh - 180px));
    overflow-y: auto;
    padding: 16px 18px;
    box-shadow: 0 12px 40px rgba(19, 33, 49, 0.16);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    margin: 16px 0 0;
}

.help-grid div {
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.help-grid dt {
    font-weight: 700;
}

.help-sections {
    display: grid;
    gap: 18px;
}

.help-section {
    padding: 22px;
}

.help-section h2 {
    margin-bottom: 0;
}

.help-section-intro {
    margin: 8px 0 0;
}

.help-grid dd {
    margin: 3px 0 0;
    color: var(--muted);
}

.help-shortcuts-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.help-shortcuts {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 14px;
}

.help-shortcuts th,
.help-shortcuts td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.help-shortcuts thead th {
    background: color-mix(in srgb, var(--surface) 82%, var(--background));
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.help-shortcuts tbody tr:last-child th,
.help-shortcuts tbody tr:last-child td {
    border-bottom: 0;
}

.help-shortcuts tbody th {
    width: 38%;
    font-weight: 700;
}

.help-shortcuts kbd {
    display: inline-block;
    min-width: 24px;
    padding: 2px 6px;
    border: 1px solid #c8d1dc;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #f7f9fc;
    color: var(--text);
    font: 650 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    white-space: nowrap;
}

.help-shortcut-note {
    margin: 10px 0 0;
    font-size: 13px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.roadmap-list,
.changelog-list {
    display: grid;
    gap: 18px;
}

.roadmap-phase,
.changelog-release {
    padding: 24px;
}

.roadmap-phase-heading,
.changelog-heading {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
}

.changelog-heading {
    grid-template-columns: 1fr auto;
}

.roadmap-phase-heading h2,
.changelog-heading h2 {
    margin-bottom: 6px;
}

.roadmap-phase-heading p,
.changelog-heading p {
    margin: 0;
}

.priority-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.priority-badge {
    background: #e9efff;
    color: #2048af;
}

.status-badge {
    background: var(--background);
    color: var(--muted);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
    margin: 22px 0 0;
    padding-left: 20px;
}

.feature-list li::marker {
    color: var(--primary);
}

.changelog-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin-top: 24px;
}

.changelog-groups h3 {
    margin: 0;
    font-size: 16px;
}

.changelog-groups .feature-list {
    grid-template-columns: 1fr;
    margin-top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .header-navigation {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .main-navigation {
        flex-wrap: wrap;
    }

    .page {
        margin-top: 24px;
    }

    .auth-card {
        padding: 24px;
    }

    .create-card,
    .import-card,
    .mindmap-card,
    .user-create-form,
    .access-create-card,
    .share-link-create-card,
    .access-card {
        grid-template-columns: 1fr;
    }

    .create-form,
    .import-form,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .create-form .button,
    .import-form .button,
    .inline-form .button {
        width: 100%;
    }

    .editor-heading {
        top: 10px;
        right: 10px;
        left: 10px;
        gap: 8px;
    }

    .user-card-heading,
    .user-card-actions,
    .user-action-form {
        align-items: stretch;
        flex-direction: column;
    }

    .user-action-form .button {
        width: 100%;
    }

    .access-form {
        align-items: stretch;
        flex-direction: column;
    }

    .access-form .button,
    .access-card form:last-child .button {
        width: 100%;
    }

    .share-link-card {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-command-tools {
        top: 54px;
        left: 0;
        max-width: calc(58% - 4px);
    }

    .viewport-actions {
        top: 54px;
        right: 0;
        max-width: calc(42% - 4px);
    }

    .editor-settings-tools {
        top: 102px;
        right: 0;
        left: 0;
        max-width: 100%;
    }

    .node-color-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .node-detail-form {
        padding: 18px;
    }

    .node-detail-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .node-detail-actions .button {
        width: 100%;
    }

    .editor-title-panel {
        min-width: 44px;
        max-width: 44px;
        padding: 8px;
    }

    .editor-title-panel h1,
    .editor-title-panel p {
        display: none;
    }

    .editor-title-panel .back-link {
        display: block;
        overflow: hidden;
        width: 26px;
        height: 26px;
        font-size: 0;
        text-align: center;
    }

    .editor-title-panel .back-link::first-letter {
        font-size: 22px;
    }

    .viewport-actions {
        flex-wrap: nowrap;
        padding-left: 0;
        border-left: 0;
    }

    .editor-help {
        right: 10px;
        bottom: 10px;
    }

    .editor-help-panel {
        bottom: 42px;
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 150px);
        padding: 12px;
    }

    .editor-notifications {
        bottom: 54px;
        left: 10px;
        width: calc(100% - 20px);
        transform: none;
    }

    .selected-node-inspector {
        bottom: 54px;
        left: 10px;
        width: calc(100% - 74px);
    }

    .editor-page .site-header {
        align-items: center;
        flex-direction: row;
        padding: 6px 10px;
    }

    .editor-page .main-navigation,
    .editor-page .user-label {
        display: none;
    }

    .editor-page .site-header form .button {
        padding: 6px 9px;
        font-size: 12px;
    }

    .roadmap-phase-heading,
    .changelog-heading,
    .changelog-groups,
    .feature-list,
    .help-grid,
    .system-summary {
        grid-template-columns: 1fr;
    }

    .system-check,
    .migration-row,
    .update-log-row {
        grid-template-columns: 1fr;
    }

    .system-section-heading {
        align-items: stretch;
        flex-direction: column;
    }
}
