/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');

:root {
    --base-fontsize: 1.0rem;
    --header-scale: 1.125;
    --line-height: 1.618;

    /* Dark Theme (Default) */
    --main-bg: #000;
    --text-color: #bfbfbf;
    --link-color: #9fc6e0;
    --header-color: #bfbfbf;
    --wikilink-color: deepskyblue;
    --wikilink-visited-color: deepskyblue;
    --wikilink-hover-color: hotpink;
    --accent-bg: #2B2B2B;
    --border: #666;
    --node-bg: #191919;
    --graph-bg: #222;
    --links-bg: #222;
    --subnode-bg: #303030;
    --subnode-text-color: #cfcfcf;
    --pulled-pushed-bg: #101010;
    --info-box-bg: #1f2c39;
    --info-box-text-color: #cfcfcf;
    --intro-footer-bg: #2a3a59;
    --intro-footer-text-color: #cfcfcf;
    --button-bg: #2d2d2d;
    --button-text-color: #ddd;
    --button-border-color: #999;
    --logo-filter: invert(1);
    --tab-active-bg: #ffffff20;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --separator-border: #ddd;
    --music-player-bg: rgba(31, 41, 55, 0.9); /* Dark blue-gray */
    --blockquote-border: #bfbfbf;
    --agora-protocol-text: #ffffff80;
    --agora-protocol-bg: black;
    --dismiss-button-color: white;
    --synthesis-bg: rgba(74, 59, 106, 0.4);
    --synthesis-border: #6a5acd;
    --music-overlay-color: #b388ff;
    --subnode-shadow: rgba(255, 255, 255, 0.15);
    --subnode-shadow-hover: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] {
    --main-bg: #e9e9e9;
    --text-color: #000000;
    --link-color: #377ba8;
    --header-color: #377ba8;
    --wikilink-color: #1e53a6;
    --wikilink-visited-color: #1e53a6;
    --wikilink-hover-color: hotpink; /* Or something else */
    --accent-bg: #F5F7FF;
    --border: #D8DAE1;
    --node-bg: #f0f0f0;
    --graph-bg: #fdfdfd;
    --links-bg: #fdfdfd;
    --subnode-bg: #f8f8f8;
    --subnode-text-color: #000;
    --pulled-pushed-bg: #fdfdfd;
    --info-box-bg: #ffedb1;
    --info-box-text-color: #000;
    --intro-footer-bg: #ffe17e;
    --intro-footer-text-color: #000;
    --button-bg: #ddd;
    --button-text-color: #000;
    --button-border-color: #999;
    --logo-filter: none;
    --tab-active-bg: rgba(255, 255, 255, 1);
    --overlay-bg: rgba(238, 238, 238, 0.7);
    --separator-border: #222;
    --music-player-bg: rgba(255, 255, 255, 0.9); /* Light white-gray */
    --blockquote-border: #000; /* Or a shade of grey */
    --agora-protocol-text: #00000080;
    --agora-protocol-bg: #ffffff;
    --dismiss-button-color: black;
    --synthesis-bg: #e6e6fa;
    --synthesis-border: #9370db;
    --music-overlay-color: #ffe0b2;
    --subnode-shadow: rgba(0, 0, 0, 0.2);
    --subnode-shadow-hover: rgba(0, 0, 0, 0.3);
}

.overlay {
    /* Fixed positioning relative to the viewport is usually safest for modals, 
       but here we want it to slide out from the left within the layout flow if possible, 
       OR cover the screen. Let's try absolute positioning relative to .content */
    position: fixed; 
    top: 0; 
    left: -100%; /* Start hidden off-screen to the left */
    width: 100%; /* Cover the full width of the content area */
    height: 100%; /* Cover the full height */
    background-color: var(--overlay-bg); /* Semi-transparent background */
    z-index: 2000; /* Sit on top of everything in .content */
    transition: left 0.3s ease-in-out; /* Smooth slide animation */
    
    /* Flexbox to center the content box */
    display: flex;
    justify-content: flex-start; /* Align content to the left side */
    align-items: stretch; /* Stretch to fill height */
}

.overlay.right-overlay {
    left: auto;
    right: -100%;
    justify-content: flex-end; /* Align content to the right side */
    transition: right 0.3s ease-in-out;
}

/* Active State - triggered by JS */
.overlay.active {
    left: 0; /* Slide into view */
}

.overlay.right-overlay.active {
    left: auto;
    right: 0;
}

/* Wrapper to constrain the width of the actual settings panel */
.overlay-wrapper {
    width: 100%;
    max-width: 800px; /* Max width of the settings panel */
    height: 100%;
    background-color: var(--node-bg); /* Use node-bg or background-color */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* Shadow on the right edge */
    display: flex;
    flex-direction: column;
}

/* The scrollable content area within the panel */
.overlay-content {
    padding: 20px;
    /* padding-top: 80px; Removed excessive padding since top offset handles navbar */
    overflow-y: auto; /* Scrollable if content is too long */
    flex-grow: 1; /* Fill available space */
    /* height: 100%; Removed to rely on flex-grow */
    box-sizing: border-box;
}

/* Ensure the body doesn't scroll when overlay is open (handled by JS toggling class) */
body.overlay-open {
    overflow: hidden;
}


html {
    font-family: 'Noto Sans', sans-serif;
    scrollbar-gutter: stable;
}

body {
    background: var(--main-bg);
    color: var(--text-color);
    width: 100%;
    font-size: var(--base-fontsize);
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.content {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
}


.async-content {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    display: flex;
    justify-content: center;
    border: 2px solid red !important;
}


pre {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

a {
    color: var(--link-color);
}

.navigation > a {
  display: flex;
}

.navigation > a > span {
    flex-grow: 1;
    flex-shrink: 0;
    padding: 2px;
}

nav {
    font-family: sans-serif;
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--main-bg);
    padding: 0.25em;
    padding-bottom: 0px;
}

.navbar-item {
    display: flex;
    gap: 0.3em;
    align-items: center;
    flex-direction: row;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    border: 1px solid var(--button-border-color);
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text-color);
    text-transform: capitalize;
    padding: 3px 6px 3px 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.2s;
}

button:hover {
    filter: brightness(1.2);
}

button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

ul {
    line-height: 1.7em;
    padding-right: 0.34em;
    padding-left: 2em;
}

li {
    padding: 0.17em;
}

.subnode-content > ul {
    filter: brightness(100%);
    display: inline-block;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.subnode-content > ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.subnode-content > ul {
    filter: brightness(100%);
    display: inline-block;
    padding-right: 1em;
    padding-top: 5px;
    padding-bottom: 5px;
    background-color: var(--agora-protocol-bg);
    position: relative;
    min-height: 2.5em;
    min-width: 10em;
}

.subnode-content {
    display: block;
    overflow-wrap: break-word;
}

li img {
    vertical-align: top;
}

.iframe-container {
    display: flex;
    flex-direction: column;
}

.iframe-url-overlay {
    align-self: flex-end;
    margin-top: 5px;
    margin-right: 10px;
    position: relative;
    z-index: 1;
    font-size: smaller;
    font-style: italic;
    color: var(--agora-protocol-text);
    background-color: var(--agora-protocol-bg);
    padding: 2px 5px;
    border-radius: 3px;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.1));
}

iframe {
    margin-top: 2px;
    margin-bottom: 2px;
    border-color: gray;
    border-style: dashed;
    border-width: 1px;
    height: 53em;
    width: 99.5%;
}

.mastodon-embed > iframe {
    height: auto;
    width: auto;
}

details .mastodon, .twitter {
    display: inline;
    max-width: 100%;
    vertical-align: top;
}

details[open] > :not(summary) {
    animation: slide-down 0.4s ease;
    will-change: transform, opacity;
}
  
@keyframes slide-down {
    from { 
      opacity: 0;
      transform: translateY(-10px);
    }
    to { 
      opacity: 1;
      transform: translateY(0);
    }
}

@media screen and (max-width: 60em) {
    iframe {
        max-height: 35em;
    }
}

.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.column {
    background-color: #f0f0f0;
    padding: 20px;
    border: 1px solid #ccc;
}

@media (min-width: 60em) {
    .container {
        flex-direction: row;
    }

    .column {
        flex: 1;
    }
}

.navigation .logo {
    vertical-align: middle;
    max-width: 32px;
    max-height: 32px;
    margin-bottom: 4px;
}

.logo {
    filter: var(--logo-filter);
}

.spinner-container {
    overflow: hidden;
    text-align: center;
    overflow-x: hidden;
}

.spinner {
    animation: heartbeat 1s infinite;
}

.spinner2 {
    transform: translateZ(1px);
    animation: flipping 10s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes heartbeat {
  0% { transform: scale(0.95); }
  5% { transform: scale(1.1); }
  39% { transform: scale(0.85); }
  45% { transform: scale(1); }
  60% { transform: scale(0.95); }
  100% { transform: scale(0.9); }
}

@keyframes flipping {
  0%, 100% { animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(1800deg); animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1); }
  100% { transform: rotateY(3600deg); }
}

.content {
    line-height: var(--line-height);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--header-color);
    line-height: 1.1;
}

h1 { font-size: calc(var(--base-fontsize) * var(--header-scale) * var(--header-scale) * var(--header-scale) * var(--header-scale) * var(--header-scale)); margin-block-start: 10px; }
h2 { font-size: calc(var(--base-fontsize) * var(--header-scale) * var(--header-scale) * var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h3 { font-size: calc(var(--base-fontsize) * var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h4 { font-size: calc(var(--base-fontsize)); margin-top: calc(var(--line-height) * 0.8rem); }
h5 { font-size: calc(var(--base-fontsize) / var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h6 { font-size: calc(var(--base-fontsize) / var(--header-scale) / var(--header-scale)); }

li > p {
    margin-block-start: 0;
    margin-block-end: 0;
}

.content blockquote {
    padding-left: 0.5em;
    margin-left: 1em;
    border-left: 2px solid var(--blockquote-border);
    font-style: italic;
}

summary::-webkit-scrollbar {
    display: none;
}

summary, #footer {
    gap: 5px;
    vertical-align: middle;
    align-items: center;
    overflow-x: scroll;
    white-space: nowrap;
    justify-content: space-between;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.navigation::-webkit-scrollbar {
    display: none;
}

.navigation {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.navigation-content {
    display: flex;
    gap: 1em;
    align-items: center;
    white-space: nowrap;
    justify-content: space-between;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-grow: 1;
    min-width: 0;
}

.navigation-content::-webkit-scrollbar {
    display: none;
}

#join {
    margin-right: 0.5em;
}


.navigation {
    overflow-x: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
}

.intro {
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
}

.webnav::-webkit-scrollbar {
    display: none;
}

.webnav{
    vertical-align: middle;
    align-items: center;
    overflow-x: scroll;
    white-space: nowrap;
    justify-content: space-between;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.topline-node {
    vertical-align: middle;
    overflow-y: auto;
}

.topline-node-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 5px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    max-width: 100%;
}

.topline-node-wrapper::-webkit-scrollbar {
    display: none;
}

.topline-node-wrapper:first-child {
    margin-bottom: 8px;
}

.search-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 3px;
}

.action-bar-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 0.2em;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-right: 35px;
}

.action-bar > * {
    flex-shrink: 0;
}

.action-bar::-webkit-scrollbar {
    display: none;
}



input[type="text"] {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
}

button, input {
    font-size: 0.9em;
}

.topline-agora {
    display: flex;
    justify-content: space-between;
    vertical-align: middle;
    overflow-y: auto;
    width: auto;
    margin-top: 10px;
    margin-right: 10px;
    margin-left: 10px;
}

.topline-query {
    flex: auto;
    display: inline;
    vertical-align: middle;
    margin-right: 4px;
}

.topline-cli {
    flex: auto;
    vertical-align: middle;
    width: 100%;
    margin-right: 0;
}

#mini-cli {
    width: 100%;
    padding: 4px;
}



.cli-header {
    margin-right: 10px;
}

button {
    margin-right: 4px;
}

#mini-cli-demo.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(224, 168, 95, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(224, 168, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(224, 168, 95, 0);
    }
}


summary {
    line-height: 1.7;
}

.separator {
    margin-top: 15px;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}

.user {
    font-weight: bold;
}

.node, .web, .stoa, .search, .genai, .minigame-wrapper {
    border-color: gray;
    background: var(--node-bg);
    border-width: 0px;
    border-style: dotted;
    padding: 10px;
    overflow-x: hidden;
}


.context {
    border-color: gray;
    border-style: dotted;
    border-width: 0px;
}

.context-all {
    position: relative;
    height: 800px;
    border-color: gray;
    border-style: solid;
    border-width: 1px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.image-embed {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    max-height: 600px;
}

.subnode {
    background-color: var(--subnode-bg);
    background-image: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.06) 100%);
    color: var(--subnode-text-color);
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--subnode-shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    transition: background-color 0.8s ease-out, box-shadow 0.3s ease, transform 0.3s ease;
}

.subnode:hover {
    box-shadow: 0 0 25px var(--subnode-shadow-hover);
}

/* Ensure common overflowers are constrained within the subnode */
.subnode pre,
.subnode table,
.subnode img,
.subnode iframe,
.subnode video,
.subnode .node-embed {
    max-width: 100%;
}

.subnode pre,
.subnode table,
.subnode img {
    height: auto;
}

.subnode table {
    display: block;
    overflow-x: auto;
}

.not-found {
    background: var(--subnode-bg);
    color: var(--subnode-text-color);
    padding: 10px;
    overflow-x: auto;
    position: relative;
    transition: background-color 0.8s ease-out;
}

.subnode-arrived {
    background-color: var(--intro-footer-bg);
}

.info-box {
    background: var(--info-box-bg);
    filter: brightness(100%);
    padding: 7px 28px 7px 7px;
    font-style: normal;
    color: var(--info-box-text-color);
    border: 1px dashed var(--border);
    position: relative;
}

/* Synthesis Styles */
.synthesis-container {
    border: 1px dashed var(--synthesis-border);
    border-radius: 4px;
    padding: 7px;
    background-color: var(--synthesis-bg);
    margin-bottom: 10px;
    position: relative;
    opacity: 1.0;
}

.synthesis-container:hover,
.synthesis-container:focus-within,
.synthesis-container:has(details[open]) {
    border-color: var(--synthesis-border);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.synthesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
}

.synthesis-header::-webkit-details-marker {
    display: none; /* Hide default arrow in Chrome/Safari */
}

.synthesis-provider-tab, .game-tab {
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.2s ease;
    border: 1px solid transparent; /* Reserve space for border */
}

.synthesis-provider-tab:hover, .game-tab:hover {
    background-color: var(--tab-active-bg);
    opacity: 1;
}

.synthesis-provider-tab.active, .game-tab.active {
    font-weight: bold;
    background-color: var(--tab-active-bg);
    color: var(--link-color);
    opacity: 1;
    border: 1px solid var(--border);
    cursor: default;
}

.synthesis-content {
    line-height: 1.6;
    padding: 10px;
    overflow-wrap: break-word;
}

.synthesis-footer {
    font-size: 0.8rem;
    color: var(--agora-protocol-text);
    margin-top: 1rem;
}

.synthesis-footer hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

#footer {
    background: var(--intro-footer-bg);
    padding: 7px;
    color: var(--intro-footer-text-color);
}

.intro {
    background: var(--intro-footer-bg);
    padding: 10px;
    color: var(--intro-footer-text-color);
}

/* Star Animations */
@keyframes starPulse {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

@keyframes starPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

.star-pending {
    animation: starPulse 1.5s infinite ease-in-out;
    cursor: wait;
}

.star-popping {
    animation: starPop 0.3s ease-out;
}

#footer {
    margin-bottom: 10px;
}

.subnode-arrived {
    background-color: var(--intro-footer-bg);
}

/* Duplicate .info-box selector removed */

details.sortable-section > summary {
    position: relative;
    padding-right: 35px; /* Leave room for drag-handle on the right */
    overflow-x: hidden; /* Disable scrolling on the summary itself */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

details.sortable-section > summary::after {
    content: '≡';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    padding: 0 5px;
    font-weight: bold;
    font-size: 1.15em;
    color: var(--text-color);
    opacity: 0.45;
    transition: opacity 0.2s, color 0.2s;
    user-select: none;
    touch-action: none;
}

details.sortable-section > summary:hover::after {
    opacity: 0.95;
    color: var(--link-color);
}

details.sortable-section.dragging > summary::after {
    cursor: grabbing;
}

.summary-scroll-content {
    display: inline-flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
    flex-grow: 1;
    min-width: 0;
    gap: 5px;
}

.summary-scroll-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.sortable-section.dragging {
    opacity: 0.5;
    box-shadow: 0px 5px 15px rgba(0,0,0,0.3);
    transition: none; /* remove transition so it snaps while dragging */
}

.dismiss-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-weight: bold;
    color: var(--dismiss-button-color);
}

.info-box::before {
  content: '💡';
  width: 1em;
  margin-right: 0.3em;
  flex-shrink: 0;
  transition: 0.3s;
  font-style: normal;
}

.hidden {
    opacity: 0;
    visibility: hidden;
}

.intro {
    line-height: 1.7;
    font-style: normal;
    position: relative;
    box-sizing: border-box;
    align-items: center;
    overflow-x: hidden;
}


.intro::before, #footer::before {
  content: '➼';
  width: 1em;
  margin-right: 0.3em;
  flex-shrink: 0;
  transition: 0.3s;
}



.pulled-subnode, .pushed-subnode, .stoa-public {
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.pulled-search-embed {
    overflow-x: hidden;
}


.node-header, .context-header, .stoa-header, .ctzn-header, .minigame-header {
    justify-content: space-between;
    text-align: left;
    padding-bottom: 2px;
}

.header-with-button {
    display: flex;
}

details > summary {
    cursor: pointer;
}

.with-spacing {
    margin-top: 10px;
}

/* Ensure targets scrolled into view aren't hidden by the sticky navbar */
.synthesis-container, .graph-container, .info-box-container, .context,
#synthesis-details, #graph, #agoragraph {
    scroll-margin-top: 8em;
}

#manual-pulls-container .manual-pull-item, 
#random-pull-embed .manual-pull-item {
    margin-bottom: 0px;
}

.node-name {
    text-transform: capitalize;
}

.subnode-header, .links-header, .backlinks-header, .forwardlinks-header, .search-header, .subnode-id {
    width: 100%;
    padding-bottom: 2px;
    font-weight: bold;
}

.subnode-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

details[open] > .subnode-header {
    border-bottom: 1px solid #ccc;
}

.subnode-id {
    flex-grow: 1;
}

.subnode-footer, .node-footer {
    font-size: smaller;
    font-weight: bolder;
    width: 100%;
    display: flex;
    padding-top: 6px;
    border-top: 1px solid #ccc;
    text-align: left;
}

.subnode-contrib {
    text-align: right;
    text-decoration: none;
    max-width: 40%;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.sortable-subnode > summary .subnode-contrib::after {
    content: '≡';
    cursor: grab;
    padding: 0 5px;
    font-weight: bold;
    font-size: 1.15em;
    color: var(--text-color);
    opacity: 0.45;
    transition: opacity 0.2s, color 0.2s;
    user-select: none;
    touch-action: none;
    display: inline-block;
}

.sortable-subnode > summary .subnode-contrib:hover::after {
    opacity: 0.95;
    color: var(--link-color);
}

.sortable-subnode.dragging > summary .subnode-contrib::after {
    cursor: grabbing;
}

.pull-dismiss {
    right: 35px !important;
}



.sortable-subnode.dragging {
    opacity: 0.5;
    box-shadow: 0px 3px 10px rgba(0,0,0,0.2);
    transition: none;
}

.star-toggle, .node-star-toggle, .external-star-toggle {
    cursor: pointer;
    display: inline-block;
    transition: transform 0.1s; /* Smooth out manual hover effects if added later */
}

.footer-links, .footer-id {
    text-align: right;
    margin-left: auto;
    text-decoration: none;
    font-weight: normal;
}

.agora-actions, .internet-actions {
    text-decoration: none;
    margin-left: auto;
    display: block;
}

.subnode-id {
    max-width: 81%;
}

.subnode-id a {
    text-decoration: none;
}

.search {
    overflow: auto;
    gap: 10px;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
    justify-content: space-between;
    width: 97%;
}

.inline-flex > div {
    flex: auto;
}

.subnodes {
    width: 100%;
}

.annotations, .delta {
    width: 100%;
    display: flex;
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
    padding: 0.5em;
    margin-bottom: 10px;
    gap: 10px;
}

.delta-nodes {
    width: 100%;
    margin-top: 1em;
}

.subnode .delta-nodes {
    width: 100%;
}

.delta-annotations {
    background: var(--pulled-pushed-bg);
    float: left;
    width: 50%;
}

.backlinks, .forwardlinks {
    flex: 1;
}

.forwardlinks {
    text-align: right;
}

.link-list-wrapper {
    /* Do not grow by default, only take content height */
    overflow-y: auto; /* And scroll if you do */
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--links-bg);
}

.link-list-wrapper::-webkit-scrollbar {
    width: 8px;
}

.link-list-wrapper::-webkit-scrollbar-track {
    background: var(--links-bg);
}

.link-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
    border: 2px solid var(--links-bg);
}

.pushlinks, .pulllinks {
    width: 33%;
    overflow: auto;
}

.backlinks-header,
.forwardlinks-header,
.latest-edits-header,
.latest-annotations-header {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5em;
}

.subnode-header a.user {
    text-decoration: none;
}

#agoragraph {
    height: 90%;
    width: 100%;
    position: absolute;
}

.links {
    overflow: auto;
    padding: 10px;
    margin: 10px;
    gap: 10px;
    max-height: 400px;
    width: 50%;
}

.search-header {
    text-align: left;
    margin-bottom: 1em;
    margin-left: 0.2em;
}

.starred-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1em; /* Reduced gap */
    align-items: flex-start;
}

.starred-section-card {
    background: var(--subnode-bg);
    color: var(--text-color);
    padding: 1em;
    border-radius: 10px;
    margin-bottom: 0; /* Let sibling selector handle internal spacing, or grid handle external */
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.starred-section-card + .starred-section-card {
    margin-top: 1em;
}

.starred-section-card h2 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.column {
    flex: 1 1 0; /* Force equal width regardless of content */
    min-width: 0; /* Allow shrinking below content size to force wrapping */
    background-color: transparent;
    color: inherit;
    border: none;
    outline: none;
    padding: 0; /* Ensure no default padding */
    margin: 0; /* Ensure no default margin */
}

.wikilink-marker {
    /* deemphasize */
}

.wikilink:link {
    color: var(--wikilink-color);
}

.wikilink:visited {
    color: var(--wikilink-visited-color);
}

.wikilink:hover {
    color: var(--wikilink-hover-color);
}

#hypothesis-frame {
    display: none;
    position: fixed;
    top: 10%; 
    right: 10px;
    width: 380px;
    height: 50vh;
    z-index: 1000;
    background-color: var(--node-bg);
    border: 1px solid var(--link-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex-direction: column;
    overflow: hidden; /* Frame shouldn't scroll, inner container should */
    border-radius: 8px; 
}

#hypothesis-frame.visible {
    display: flex;
}

#hypothesis-client-container {
    flex-grow: 1;
    height: 100%;
    width: 100%;
    overflow-y: auto; /* Allow scrolling inside the container */
}

#hypothesis-client-container {
    flex-grow: 1;
    position: relative;
}

.microblog_timeline {
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
}

table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 10px 0;
}

td,
th {
    border: 1px solid var(--border);
    padding: .5rem;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-align: left;
}

th {
    background: var(--accent-bg);
    font-weight: bold;
}

tr:nth-child(even) {
    background: var(--accent-bg);
}

table caption {
    font-weight: bold;
    margin-bottom: .5rem;
}

.burger {
    font-size: 1.5em;
    cursor: pointer;
}

.content, .async-content {
    position: relative;
    /* This ensures that absolute positioning of the overlay works relative to the content area */
    overflow-x: hidden; /* Hide the overlay when it slides out */
}

#toast-container {
    position: fixed;
    bottom: 55px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* gap: 10px; Removed to allow margin animation */
    z-index: 9999;
}

.toast {
    background-color: #1f2937;
    color: white;
    padding: 0 1.5rem; /* Start with 0 vertical padding */
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    transition: all 0.8s ease-in-out;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
    padding: 1rem 1.5rem;
    max-height: 200px;
    margin-top: 10px;
}

.ai-provider-tab, .wiki-provider-tab, .web-provider-tab {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

.ai-provider-tab.active, .wiki-provider-tab.active, .web-provider-tab.active, .graph-size-tab.active {
    font-weight: bold;
    background-color: var(--tab-active-bg);
    color: var(--link-color);
    opacity: 1;
    border: 1px solid var(--border);
    text-decoration: none;
}

.ai-generations-container {
    position: relative;
    overflow-x: hidden;
}

@keyframes slide-in-from-bottom {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-embed.visible {
    animation: slide-in-from-bottom 0.5s ease-out forwards;
}

.links-flex {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 20px;
}

@media screen and (max-width: 60em) {
    .links-flex {
        flex-direction: column;
        gap: 10px;
    }
}

.links-flex > .link-list-wrapper {
    flex: 1;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
    flex-shrink: 0;
}

.demo-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
    flex-shrink: 0;
}

.music-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
    flex-shrink: 0;
}

.settings-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
    flex-shrink: 0;
}

.experimental-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
    flex-shrink: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group-header {
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}


.toggle-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.theme-switch input, .demo-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "🌙";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.demo-switch .slider:before {
    content: "🧘"; /* Person in Lotus Position */
}

.music-switch .slider:before {
    content: "🔇"; /* Muted Speaker */
}

.settings-switch .slider:before {
    content: "❌"; /* Off */
}

input:checked + .slider {
    background-color: #377ba8;
}

input:checked + .slider:before {
    transform: translateX(20px);
    content: "🌞";
}

.demo-switch input:checked + .slider:before {
    content: "🏃‍♀️"; /* Woman Running */
}

.music-switch input:checked + .slider:before {
    content: "🎵"; /* Musical Note */
}

.settings-switch input:checked + .slider:before {
    content: "✔️"; /* On */
}

/* Custom icons for Annotate toggle */
.settings-switch input#show-hypothesis-navbar + .slider:before {
    content: "🖋️";
}
.settings-switch input#show-hypothesis-navbar:checked + .slider:before {
    content: "🖋️";
}

/* Custom icons for Experimental toggle */
.experimental-switch input {
    display: none;
}
.experimental-switch .slider:before {
    content: "🧪";
}
.experimental-switch input:checked + .slider {
    background-color: var(--wikilink-color, #377ba8);
}
.experimental-switch input:checked + .slider:before {
    transform: translateX(20px);
    content: "✨";
}

/* Shaded window state */
.agora-draggable-container {
    opacity: 0.9;
}

.agora-draggable-container.shaded > *:not(.agora-drag-handle):not(.agora-header-container) {
    display: none !important;
}

.agora-draggable-container.shaded {
    height: auto !important;
    min-height: 0 !important;
}

.agora-draggable-container.shaded .agora-popup-header {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    border-radius: 8px !important; /* beautifully round all corners in pill-mode when shaded */
}

.agora-drag-handle, .agora-header-container {
    cursor: pointer !important;
}

.agora-popup-header {
    background-color: var(--accent-bg);
    color: var(--text-color);
    padding: 5px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.agora-popup-header button {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
}

.agora-popup-title {
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    font-family: sans-serif;
    color: var(--text-color);
}

.agora-popup-close-btn {
    cursor: pointer !important;
    color: #fff !important;
    background-color: #555 !important;
    border: 1px solid #777 !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    font-family: sans-serif !important;
    font-weight: bold !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.agora-popup-close-btn:hover {
    background-color: #777 !important;
}


#demo-timer {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    color: #fff; /* Bright white for contrast */
    display: none; /* Hidden by default */
}

.demo-switch input:checked + .slider #demo-timer {
    display: inline; /* Show timer when active */
}




.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-toggle-text {
    cursor: pointer;
}

/* Styles for /nodes page grid */
.nodes-grid {
    margin: 1rem 0;
}

.nodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.node-item {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--accent-bg);
    transition: background-color 0.2s;
}

.node-item:hover {
    background: var(--main-bg);
}

.node-link {
    text-decoration: none;
    color: var(--link-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-link .node-name {
    font-weight: 500;
    flex-grow: 1;
}

.node-size {
    font-weight: lighter;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9em;
}

.remaining-nodes {
    margin-top: 1rem;
}

.context-layout {
    display: flex;
    flex-flow: row wrap; /* Unified wrap row for both desktop and mobile */
    gap: 20px 10px;
    width: 100%;
    margin-top: 15px;
}

.context-column {
    min-width: 0;
    box-sizing: border-box;
}

.context-column.left-column {
    flex: 1 1 calc(50% - 10px);
    text-align: left;
    font-size: 0.8em; /* 20% smaller font on mobile */
}

.context-column.right-column {
    flex: 1 1 calc(50% - 10px);
    text-align: right; /* right-aligned bookend */
    font-size: 0.8em; /* 20% smaller font on mobile */
}

.context-column.center-column {
    flex: 1 1 100%; /* Graph takes full width on top */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.context-column .graph-container {
    width: 100%;
}

.backlinks-header, .forwardlinks-header {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    color: var(--text-color);
    cursor: pointer;
    text-align: center;
}

@media screen and (min-width: 60em) {
    .context-layout {
        gap: 20px;
    }

    .context-column.left-column, .context-column.right-column {
        font-size: 1em; /* Reset to normal on desktop */
    }
}

.graph-container {
    position: relative;
    background-color: var(--graph-bg);
    padding: 10px;
    border-radius: 8px;
}

#graph {
    width: 100%;
    height: 400px;
}

#full-graph {
    width: 100%;
    height: 100%;
}

#graph-toggle-labels {
    position: absolute;
    top: 20px; /* Adjust as needed */
    right: 20px; /* Adjust as needed */
    padding: 3px 6px;
    z-index: 1; /* Ensure it's above the graph */
}

.ai-provider-tab, .wiki-provider-tab, .web-provider-tab, .graph-size-tab {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.ai-provider-tab:hover, .wiki-provider-tab:hover, .web-provider-tab:hover, .graph-size-tab:hover {
    background-color: var(--tab-active-bg);
    opacity: 1;
}

/* Pagination styles from nodes.html */
.pagination {
    display: flex;
    justify-content: space-between;
}
.next-link {
    text-align: right;
}

/* hexgame.html */
.hexgame-canvas {
    display: block;
    margin: auto;
    background-color: #f0f0f0;
}

/* Utility classes for inline styles */
.display-block {
    display: block;
}

.display-none {
    display: none;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.w-100 {
    width: 100%;
}

.w-30 {
    width: 30%;
}

.max-w-99 {
    max-width: 99.5%;
}

.mb-10 {
    margin-bottom: 10px;
}

.flex-grow {
    flex: auto;
    flex-grow: 1;
}

.no-border {
    border-style: none;
}

.no-text-decoration {
    text-decoration: none;
}

.all-unset {
    all: unset;
}

/* Meditation Popup Styles */
#meditation-popup-container {
    display: none; /* Hidden by default */
}

#meditation-popup-container.active {
    display: block; /* Shown when active */
}

#meditation-popup {
    position: fixed; /* always fixed-positioned relative to viewport */
    background-color: var(--node-bg);
    border-radius: 8px;
    width: 475px;
    max-width: 90vw;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--link-color);
    z-index: 1001; /* one above hypothesis */
    animation: fadeIn 0.3s ease-in-out;
}

#meditation-popup-body {
    padding: 1rem;
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
}

.meditation-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.loading-ellipsis {
    animation: pulse-ellipsis 1.5s infinite;
}

@keyframes pulse-ellipsis {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

/* Agora Floating Action Buttons (Console, Shortcuts, Scroll) */
#agora-console-btn {
    position: fixed;
    bottom: 15px;
    right: 100px;
    z-index: 9998;
    background-color: var(--accent-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0.6;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}

#agora-console-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#agora-shortcuts-btn {
    position: fixed;
    bottom: 15px;
    right: 60px;
    z-index: 9998;
    background-color: var(--accent-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0.6;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}

#agora-shortcuts-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#agora-console {
    position: fixed;
    background-color: var(--node-bg);
    border-radius: 8px;
    width: 320px;
    height: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--link-color);
    z-index: 1001;
    animation: fadeIn 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#agora-console-toolbar {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--accent-bg);
    display: flex;
    gap: 8px;
}

#agora-console-toolbar button {
    font-size: 0.78em;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#agora-console-toolbar button:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.1));
    transform: translateY(-1px);
}

#agora-console-body {
    padding: 10px;
    font-family: monospace;
    font-size: 0.85em;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.console-line {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    line-height: 1.4;
    word-break: break-word;
}

#music-player-container {
    position: fixed;
    top: 70px; /* Below navbar */
    right: 25px;
    left: auto;
    bottom: auto;
    z-index: 1001;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    width: 200px; /* Give it a fixed width */
    background-color: var(--music-player-bg);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--link-color);
}

#music-player-container.active {
    display: block;
}

#music-player-container #track-info {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}

#music-player-autoplay-message {
    padding: 5px 10px;
    border: 1px solid var(--text-color);
    border-radius: 5px;
    text-align: center;
    margin-bottom: 5px;
}

#music-player-autoplay-message:hover {
    background-color: var(--bg-hover);
}

.music-player-body {
  padding: 10px;
}
#track-info {
    text-align: center;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Marquee animation (Ping Pong) */
@keyframes marquee {
    0%, 10% { transform: translate(0, 0); } /* Pause at start */
    90%, 100% { transform: translate(var(--scroll-distance), 0); } /* Pause at end */
}

.scrolling-track {
    display: inline-block;
    animation: marquee 8s linear infinite alternate;
}

#music-player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    margin: 0 2px;
    line-height: 1;
    vertical-align: middle;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
}


#music-player-title {
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    font-family: sans-serif;
}

#music-player-close-btn {
    cursor: pointer;
    color: #fff;
    background-color: #555;
    border: 1px solid #777;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 16px;
    /* Use flexbox for perfect centering */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1; /* Reset line-height */
}

#music-player-content {
    padding: 0.5rem 1rem;
    font-size: 0.9em;
}

@media screen and (max-width: 60em) {
    #meditation-popup {
        width: 95%;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    #meditation-popup-body {
        overflow-y: auto;
    }
}

/* Responsive action bar */
/* Removed strict wrapping to allow unified 3-line layout */

    /* Wrapper elements get the relative positioning and the pseudo-element for the shadow. */
    .navigation, .topline-node-wrapper, .footer-wrapper, .action-bar-wrapper {
        position: relative;
    }

    .navigation::after, .topline-node-wrapper::after, .footer-wrapper::after, .action-bar-wrapper::after {
        content: '›';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        pointer-events: auto;
        cursor: pointer;
        background: linear-gradient(to right, transparent, var(--main-bg));
        opacity: 1;
        transition: opacity 0.2s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        font-size: 1.5em;
        color: var(--link-color);
        padding-right: 2px;
        font-weight: bold;
    }

    .navigation::before, .topline-node-wrapper::before, .footer-wrapper::before, .action-bar-wrapper::before {
        content: '‹';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        pointer-events: auto;
        cursor: pointer;
        background: linear-gradient(to left, transparent, var(--main-bg));
        opacity: 1;
        transition: opacity 0.2s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        font-size: 1.5em;
        color: var(--link-color);
        padding-left: 2px;
        font-weight: bold;
        z-index: 1;
    }

    /* When the wrapper has this class, the right shadow fades out. */
    .navigation.scrolled-to-end::after, 
    .topline-node-wrapper.scrolled-to-end::after, 
    .footer-wrapper.scrolled-to-end::after,
    .action-bar-wrapper.scrolled-to-end::after {
        opacity: 0;
        pointer-events: none;
    }

    /* When the wrapper has this class, the left shadow fades out. */
    .navigation.scrolled-to-start::before, 
    .topline-node-wrapper.scrolled-to-start::before, 
    .footer-wrapper.scrolled-to-start::before,
    .action-bar-wrapper.scrolled-to-start::before {
        opacity: 0;
        pointer-events: none;
    }

@media screen and (max-width: 60em) {
    html {
        font-size: 80%;
    }
    .agora-name-container, .agora-separator {
        display: none !important;
    }
}

.collapsible-content {
    max-height: 300px; /* Adjust as needed for ~10-15 lines */
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease-in-out;
}

.collapsible-content.expanded {
    max-height: none;
}

.collapsible-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--subnode-bg));
    pointer-events: none; /* Allows clicking through the gradient */
}

.collapsible-content.expanded::after {
    display: none; /* Hide the gradient when expanded */
}

.show-more-button {
    cursor: pointer;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    color: var(--link-color);
}

/* Mastodon Embed Styles */
.mastodon-embed-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: sans-serif;
    max-width: 500px;
}

.mastodon-embed-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.mastodon-embed-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
}

.mastodon-embed-author {
    display: flex;
    flex-direction: column;
}

.mastodon-embed-author span {
    color: var(--text-color-light);
}

.mastodon-embed-content p {
    margin-top: 0;
}

.mastodon-embed-media {
    margin-top: 1rem;
}

.mastodon-embed-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mastodon-embed-footer {
    margin-top: 1rem;
    font-size: 0.9em;
}

.mastodon-embed-footer a {
    color: var(--text-color-light);
    text-decoration: none;
}

.mastodon-embed-footer a:hover {
    text-decoration: underline;
}

/* Enhanced Horizontal Rule */
.agora-hr {
    border: 0;
    height: 1px;
    margin: 2.5em auto;
    width: 80%;
    background-image: linear-gradient(to right, transparent, var(--text-color), transparent);
    opacity: 0.3;
    position: relative;
    overflow: visible;
}

/* Flourish - using a pseudo-element */
.agora-hr::after {
    content: "❖"; /* A decorative diamond */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Center on the line */
    background-color: var(--subnode-bg); /* Match subnode background */
    padding: 0 10px;
    color: var(--text-color);
    font-size: 1.1em;
    opacity: 0.6;
}

/* Poetry / Verse Styling */
/* Use ```poetry or ```verse in Markdown to trigger this. */
code.language-poetry,
code.language-verse {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.15em;
    line-height: 1.6;
    display: block;
    color: var(--text-color);
    white-space: pre-wrap;
    padding: 1em 2em;
    border-left: 2px solid var(--wikilink-color); /* A nice accent bar */
    background-color: var(--tab-active-bg); /* Subtle background */
    border-radius: 0 8px 8px 0;
}

/* Ensure the parent pre doesn't interfere too much */
pre:has(code.language-poetry),
pre:has(code.language-verse) {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 1.5em 0;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 5px;
    justify-content: center;
    text-align: center;
}

.link-item {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Always graph on top flex order */
.context-column.center-column {
    order: 1;
}
.context-column.left-column {
    order: 2;
}
.context-column.right-column {
    order: 3;
}

.context-column.backlinks,
.context-column.outlinks,
.context-column.forwardlinks {
    background-color: var(--graph-bg);
    padding: 12px;
    border-radius: 8px;
}

#scroll-toggle {
    position: fixed;
    bottom: 15px;
    right: 20px;
    z-index: 9998;
    background-color: var(--accent-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0.6;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}

#scroll-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

#show-hypothesis-navbar-label {
    display: none;
}
#show-hypothesis-navbar-label.visible {
    display: inline-block;
}

/* Keyboard Navigation (N-Agora Phase 1) */
.agora-kb-active {
    outline: 2px solid var(--wikilink-color, #1e53a6) !important;
    outline-offset: 3px;
    border-radius: 4px;
    transition: outline 0.2s ease-in-out;
}

.agora-shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.agora-shortcuts-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.agora-shortcuts-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg, rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.agora-shortcuts-card {
    position: relative;
    z-index: 2501;
    background-color: var(--node-bg, #1a1a1a);
    color: var(--text-color, #e0e0e0);
    border: 1px solid var(--border, #444);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    max-width: 480px;
    width: 90%;
    padding: 1.25rem 1.5rem;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.agora-shortcuts-overlay.active .agora-shortcuts-card {
    transform: scale(1);
}

.agora-shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #444);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.agora-shortcuts-title {
    font-size: 1.15rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.agora-shortcuts-close {
    background: none;
    border: none;
    color: var(--text-color, #e0e0e0);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.agora-shortcuts-close:hover {
    opacity: 1;
}

.agora-shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.agora-shortcuts-table tr {
    border-bottom: 1px solid rgba(125, 125, 125, 0.15);
}

.agora-shortcuts-table tr:last-child {
    border-bottom: none;
}

.agora-shortcuts-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.95rem;
    vertical-align: middle;
}

.agora-shortcuts-table .key-col {
    width: 60px;
    text-align: center;
}

.agora-shortcuts-table .desc-col {
    padding-left: 0.75rem;
}

.agora-shortcuts-table kbd {
    display: inline-block;
    min-width: 26px;
    padding: 3px 7px;
    font-family: monospace;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--button-text-color, #eee);
    background-color: var(--button-bg, #2d2d2d);
    border: 1px solid var(--button-border-color, #777);
    border-bottom: 2px solid var(--button-border-color, #555);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.agora-shortcuts-footer {
    border-top: 1px solid var(--border, #444);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.82rem;
    opacity: 0.7;
}

/* N-Agora Spatial Knowledge Workbench (Phase 2) */
#agora-canopy {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

#agora-canopy:empty {
    display: none;
}

#agora-intro {
    margin-top: 5px;
    margin-bottom: 5px;
    border-radius: 6px;
    padding-right: 32px;
}

#agora-canopy-footer {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

#agora-canopy-footer:empty {
    display: none;
}

#agora-canopy-footer .footer-wrapper {
    width: 100%;
    box-sizing: border-box;
}

#agora-canopy-footer #footer {
    margin-top: 10px;
    margin-bottom: 20px;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
}

#nagora-root-wrapper {
    position: relative;
    width: 100%;
}

#nagora-root {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Experimental action bar elements (visible strictly in experimental mode) */
#mini-cli-play,
#mini-cli-go-beyond,
#mini-cli-meditate {
    display: none;
}

body.experimental-mode #mini-cli-play,
body.experimental-mode #mini-cli-go-beyond,
body.experimental-mode #mini-cli-meditate {
    display: inline-block;
}

/* N-Agora Layout Switcher (visible strictly in experimental mode on wide screens) */
.nagora-layout-switcher {
    display: none;
}

body.experimental-mode .nagora-layout-switcher {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.nagora-layout-btn {
    background: var(--button-bg, rgba(125, 125, 125, 0.1));
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--main-text);
    padding: 3px 9px;
    font-size: 0.82rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.nagora-layout-btn:last-child {
    border-right: none;
}

.nagora-layout-btn:hover {
    background: var(--button-hover-bg, rgba(125, 125, 125, 0.25));
}

.nagora-layout-btn.active {
    background: var(--wikilink-color, #1e53a6);
    color: #ffffff;
}

body.nagora-active #nagora-root-wrapper {
        overflow: visible;
        scroll-behavior: smooth;
    }

    body.nagora-active #nagora-root-wrapper::after {
        content: '›';
        position: fixed;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 64px;
        pointer-events: auto;
        cursor: pointer;
        background: linear-gradient(to right, transparent, var(--main-bg));
        opacity: 0.85;
        transition: opacity 0.2s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        font-size: 2em;
        color: var(--link-color);
        padding-right: 4px;
        font-weight: bold;
        z-index: 100;
    }

    body.nagora-active #nagora-root-wrapper::before {
        content: '‹';
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 64px;
        pointer-events: auto;
        cursor: pointer;
        background: linear-gradient(to left, transparent, var(--main-bg));
        opacity: 0.85;
        transition: opacity 0.2s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        font-size: 2em;
        color: var(--link-color);
        padding-left: 4px;
        font-weight: bold;
        z-index: 100;
    }

    body.nagora-active #nagora-root-wrapper.scrolled-to-end::after {
        opacity: 0;
        pointer-events: none;
    }

    body.nagora-active #nagora-root-wrapper.scrolled-to-start::before {
        opacity: 0;
        pointer-events: none;
    }

    body.nagora-active #nagora-root {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 1.25rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding: 0 1.25rem;
    }

    body.nagora-active #nagora-root > .content {
        flex: 1.3 1 0;
        min-width: 22rem;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    /* 2-Column mode adjustments */
    body.nagora-cols-2 #nagora-left-pane {
        display: none !important;
    }

    body.nagora-cols-2 #nagora-root > .content {
        flex: 1.3 1 0;
        min-width: 24rem;
        max-width: none;
    }

    body.nagora-cols-2 #nagora-right-pane {
        flex: 1 1 0;
        min-width: 20rem;
        max-width: none;
    }

    .nagora-pane {
        flex: 1 1 0;
        min-width: 18rem;
        max-width: none;
        position: sticky;
        top: 110px;
        height: calc(100vh - 125px);
        margin-top: 5px;
        align-self: flex-start;
        background: var(--background);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        z-index: 10;
    }

    .nagora-pane.nagora-pane-focused {
        border-color: var(--wikilink-color, #1e53a6);
        box-shadow: 0 0 0 2px var(--wikilink-color, #1e53a6), 0 6px 18px rgba(0, 0, 0, 0.12);
    }

    /* Widescreen multi-column N-Agora canopy & footer across active columns */
    body.nagora-active #agora-canopy,
    body.nagora-active #agora-canopy-footer {
        max-width: 100%;
        padding: 0 1.25rem;
    }

    body.nagora-active #agora-intro,
    body.nagora-active #agora-canopy-footer #footer {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Tiling Window Manager: Monocle (Maximize) Mode */
    body.nagora-active.nagora-monocle #agora-canopy,
    body.nagora-active.nagora-monocle #agora-canopy-footer {
        display: none !important;
    }

    body.nagora-active.nagora-monocle #nagora-root > .content {
        display: none !important;
    }

    body.nagora-active.nagora-monocle .nagora-pane:not(.nagora-pane-monocle) {
        display: none !important;
    }

    body.nagora-active.nagora-monocle .nagora-pane.nagora-pane-monocle {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        height: calc(100vh - 125px) !important;
        position: sticky;
        top: 110px;
    }

    body.nagora-active.nagora-monocle .nagora-pane.nagora-pane-monocle .nagora-pane-body {
        overflow-y: auto;
    }

.nagora-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    background: var(--card-header-bg, rgba(125, 125, 125, 0.08));
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    user-select: none;
    gap: 0.4rem;
    flex-shrink: 0;
}

.nagora-pane-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.nagora-pane-badge {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--badge-bg, rgba(125, 125, 125, 0.18));
    color: var(--main-text);
    flex-shrink: 0;
    cursor: default;
}

.nagora-pane-select {
    background: var(--card-bg, var(--background));
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--main-text);
    font-size: 0.82rem;
    font-weight: 600;
    width: 100%;
    min-width: 0;
    padding: 2px 4px;
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.nagora-pane-select:focus {
    border-color: var(--wikilink-color, #1e53a6);
}

.nagora-pane-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.nagora-pane-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--main-text);
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.85rem;
    line-height: 1.2;
    opacity: 0.75;
    transition: opacity 0.15s, background-color 0.15s, border-color 0.15s;
}

.nagora-pane-btn:hover:not(:disabled) {
    opacity: 1;
    background: var(--button-hover-bg, rgba(125, 125, 125, 0.15));
    border-color: var(--border-color);
}

.nagora-pane-body {
    flex: 1 1 auto;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.nagora-pane-iframe {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 100% !important;
    border: none !important;
    display: block !important;
    background: var(--background);
}

.nagora-pane-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--background);
    z-index: 2;
    transition: opacity 0.2s;
}

.nagora-loader-text {
    margin-top: 12px;
    font-size: 0.92rem;
    color: var(--subnode-text-color, #666);
    font-style: italic;
}

.nagora-pane-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Embed Ancillary Zippy */
.embed-ancillary-zippy {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg, rgba(125, 125, 125, 0.04));
}

.embed-ancillary-zippy > summary {
    font-size: 0.82rem;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.8;
}

.embed-ancillary-zippy[open] > summary {
    opacity: 1;
    border-bottom: 1px solid var(--border-color);
}

.embed-ancillary-content {
    padding: 0.5rem;
}

/* Embed Hygiene (when inside iframe) */
body.is-embed {
    padding: 0;
    margin: 0;
    background-color: var(--background);
    overflow-x: hidden;
}

body.is-embed nav,
body.is-embed .topline-node,
body.is-embed footer,
body.is-embed #footer,
body.is-embed .footer-wrapper,
body.is-embed #agora-canopy-footer,
body.is-embed .intro,
body.is-embed .edit-section-container,
body.is-embed .stoa,
body.is-embed #games,
body.is-embed #scroll-toggle,
body.is-embed #agora-console-btn,
body.is-embed #agora-shortcuts-btn {
    display: none !important;
}

body.is-embed .content {
    padding: 0.75rem 1rem;
    max-width: 100%;
    margin: 0;
}

/* ==========================================================================
   Live Search / Quick Switcher
   ========================================================================== */

.live-search-dropdown {
    position: fixed;
    z-index: 1000;
    background: var(--subnode-bg);
    color: var(--subnode-text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    font-size: 0.9em;
    backdrop-filter: blur(8px);
}

.live-search-results-list {
    max-height: 380px;
    overflow-y: auto;
}

.live-search-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s ease;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-decoration: none;
    color: inherit;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover,
.live-search-item.active {
    background: var(--tab-active-bg);
}

.live-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.live-search-icon {
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
}

.live-search-title {
    font-weight: 600;
    color: var(--link-color);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-badge {
    font-size: 0.72em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.live-search-badge-node {
    background: rgba(46, 160, 67, 0.15);
    color: #2ea043;
}

.live-search-badge-user {
    background: rgba(137, 87, 229, 0.15);
    color: #8957e5;
}

.live-search-badge-content {
    background: rgba(224, 168, 95, 0.2);
    color: #b07010;
}

.live-search-users {
    font-size: 0.8em;
    color: var(--subnode-text-color);
    opacity: 0.8;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-search-snippet {
    font-size: 0.82em;
    color: var(--subnode-text-color);
    opacity: 0.9;
    padding-left: 26px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-snippet b {
    color: var(--accent);
    font-weight: bold;
    text-decoration: underline;
}

.live-search-empty {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--subnode-text-color);
}

.live-search-empty-text {
    font-size: 0.9em;
    opacity: 0.8;
}

.live-search-footer {
    padding: 6px 12px;
    background: var(--intro-footer-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: var(--subnode-text-color);
    gap: 8px;
}

.live-search-footer-action {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
}

.live-search-footer-action:hover {
    text-decoration: underline;
}

.live-search-hints {
    font-size: 0.85em;
    opacity: 0.75;
    white-space: nowrap;
}

.live-search-hints kbd,
.live-search-empty kbd {
    background: var(--subnode-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.9em;
}

.live-search-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: var(--subnode-bg);
    border-top: 1px dashed var(--border-color);
    font-size: 0.85em;
}

.live-page-btn {
    background: var(--intro-footer-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.88em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.live-page-btn:hover:not(:disabled) {
    background: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
}

.live-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.live-page-indicator {
    font-weight: 500;
    color: var(--subnode-text-color);
    font-size: 0.9em;
}



