      html, body {
        margin: 0;
        padding: 0;
        background-color: #f8f9fa;
      }

      /* Full-screen mode when editor is active */
      html:has(#editorSection:not(.d-none)),
      html:has(#editorSection:not(.d-none)) body {
        height: 100%;
        overflow: hidden;
      }

      .app-shell {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
      }

      /* Full-screen mode when editor is active */
      html:has(#editorSection:not(.d-none)) .app-shell {
        height: 100vh;
        overflow: hidden;
      }

      .app-shell .container-fluid {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        padding: 0;
        min-height: 0;
      }

      /* Full-screen mode when editor is active */
      html:has(#editorSection:not(.d-none)) .app-shell .container-fluid {
        overflow: hidden;
      }

      .app-shell #loginSection {
        overflow-y: visible;
        overflow-x: hidden;
        padding: 2.5rem 1rem;
      }

      @media (min-width: 992px) {
        .app-shell #loginSection {
          padding: 2.5rem 3rem;
        }
      }

      .app-shell #editorSection {
        overflow: hidden;
        padding: 0;
        height: 100vh;
      }

      #richTextEditor {
        flex: 1 1 auto;
        border: 1px solid #ced4da;
        border-radius: 0.375rem;
        padding: 1rem;
        background-color: #ffffff;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
      }

      #richTextEditor h1 {
        font-size: 2rem;
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
      }

      #richTextEditor h2 {
        font-size: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
      }

      #richTextEditor p {
        font-size: 1rem;
        margin-bottom: 1rem;
      }

      .resizable-wrapper {
        display: flex;
        align-items: stretch;
        height: 100%;
        background-color: #f8f9fb;
        border: 1px solid #e1e5ea;
        border-radius: 0;
        overflow: hidden;
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
      }

      .tree-panel {
        flex: 0 0 auto;
        width: 440px;
        min-width: 220px;
        max-width: 560px;
        background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
        border-right: 1px solid #dfe3e8;
        padding: 1.25rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        height: 100%;
        overflow: hidden;
        min-height: 0;
      }

      .tree-panel.collapsed {
        display: none;
      }

      .resizable-wrapper[data-tree-collapsed='true'] .resizer {
        display: none;
      }

      /* Mobile view (smartphones) */
      @media (max-width: 768px) {
        .resizable-wrapper {
          flex-direction: column;
        }

        .tree-panel {
          width: 100% !important;
          max-width: 100%;
          border-right: none;
          border-bottom: 1px solid #dfe3e8;
        }

        .editor-panel {
          width: 100%;
        }

        .resizer {
          display: none;
        }

        /* Hide editor panel by default on mobile */
        .resizable-wrapper[data-mobile-view='tree'] .editor-panel {
          display: none;
        }

        /* Hide tree panel when editor is shown on mobile */
        .resizable-wrapper[data-mobile-view='editor'] .tree-panel {
          display: none;
        }

        /* Show back button on mobile */
        #backToTreeButton {
          display: inline-flex !important;
        }

        /* Hide toggle tree button on mobile */
        #toggleTreeButton {
          display: none !important;
        }
      }

      /* Hide back button on desktop */
      #backToTreeButton {
        display: none;
      }

      .tree-panel h2 {
        font-size: 1.1rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0;
        cursor: default;
      }

      .tree-panel h2 i {
        color: #0d6efd;
      }

      .tree-panel ul {
        list-style: none;
        margin: 0;
        padding-left: 0;
      }

      .tree-panel > ul,
      .tree-container > ul {
        margin-top: 0;
      }

      .tree-panel ul ul {
        margin: 0;
        padding-left: 1.5rem;
        border-left: 1px solid #dfe3e8;
      }

      .tree-panel ul ul .tree-toggle,
      .tree-panel ul ul .tree-leaf {
        padding-left: 0.25rem;
      }

      .tree-container {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
      }

      .tree-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.4rem 0.5rem;
        border: none;
        background: transparent;
        border-radius: 0.5rem;
        color: #1f2933;
        font-weight: 600;
        text-align: left;
        user-select: none;
      }

      .tree-toggle:hover,
      .tree-toggle:focus-visible {
        background-color: rgba(13, 110, 253, 0.1);
        outline: none;
      }

      .tree-toggle .caret {
        margin-left: 0;
        margin-right: 0;
        color: #6c757d;
        transition: transform 0.2s ease;
        flex-shrink: 0;
      }

      .tree-toggle[aria-expanded='true'] .caret {
        transform: rotate(90deg);
      }

      .tree-children {
        margin: 0.05rem 0 0;
        padding-left: 0;
        display: none;
      }

      .tree-children.show {
        display: block;
      }

      .tree-leaf {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.35rem 0.5rem;
        border-radius: 0.5rem;
        color: #354052;
        text-decoration: none;
        cursor: pointer;
        user-select: none;
      }

      .tree-node-shared [data-folder-icon],
      .tree-node-shared .tree-leaf > i.bi-file-earmark-text {
        transition: color 0.2s ease;
      }

      .tree-node-shared-readonly [data-folder-icon],
      .tree-node-shared-readonly .tree-leaf > i.bi-file-earmark-text {
        color: #b45309 !important;
      }

      .tree-node-shared-editable [data-folder-icon],
      .tree-node-shared-editable .tree-leaf > i.bi-file-earmark-text {
        color: #17823c !important;
      }

      .shared-permission-indicator {
        margin-left: 0.35rem;
        font-size: 0.9rem;
        opacity: 0.9;
      }

      .share-count-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.2rem;
        margin-left: 0.35rem;
        padding: 0.05rem 0.45rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 600;
        background-color: #e9f2ff;
        color: #0d6efd;
        line-height: 1.2;
      }

      .share-count-pill i {
        font-size: 0.85rem;
      }

      .editor-readonly {
        background-color: #f8f9fa;
        cursor: not-allowed;
      }

      #readOnlyNotice {
        border-radius: 0.75rem;
      }

      .tree-leaf i {
        color: #0d6efd;
      }

      .tree-leaf:hover,
      .tree-leaf:focus-visible {
        background-color: rgba(13, 110, 253, 0.08);
        outline: none;
      }

      .tree-leaf.active,
      .tree-leaf.active:focus-visible {
        background-color: rgba(13, 110, 253, 0.18);
        color: #0b3d91;
      }

      .tree-toggle.active,
      .tree-toggle.active:focus-visible {
        background-color: rgba(13, 110, 253, 0.18);
        color: #0b3d91;
      }

      /* Drag and drop styles */
      .tree-panel li {
        position: relative;
      }

      .tree-panel li[draggable="true"] {
        cursor: move;
      }

      .tree-panel li.dragging {
        opacity: 0.5;
      }

      .tree-panel li.drag-over {
        background-color: rgba(13, 110, 253, 0.15);
        border-radius: 0.5rem;
      }

      .tree-panel li.drag-over,
      .tree-panel h2.drag-over,
      .tree-panel #treeContainer.drag-over {
        background-color: rgba(13, 110, 253, 0.2);
        border: 2px dashed #0d6efd;
        border-radius: 0.5rem;
      }

      .tree-search-highlight {
        background-color: #fff3cd;
        padding: 0;
        border-radius: 0.2rem;
        font-weight: 600;
        display: inline;
      }

      .tree-node-hidden {
        display: none !important;
      }

      .tree-node-match {
        background-color: rgba(255, 243, 205, 0.3);
      }

      .auth-card {
        width: 100%;
        max-width: 360px;
      }

      .resizer {
        flex: 0 0 auto;
        width: 6px;
        cursor: col-resize;
        background: linear-gradient(180deg, rgba(13, 110, 253, 0.25) 0%, rgba(13, 110, 253, 0.05) 100%);
        position: relative;
      }

      .resizer::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 2px;
        height: 32px;
        background-color: rgba(13, 110, 253, 0.35);
        transform: translate(-50%, -50%);
        border-radius: 1px;
      }

      body.resizing {
        cursor: col-resize;
        user-select: none;
      }

      .editor-panel {
        flex: 1 1 auto;
        padding: 1.5rem;
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        min-width: 0;
        height: 100%;
        overflow: hidden;
        min-height: 0;
      }

      .editor-panel .btn-toolbar {
        flex-shrink: 0;
      }


      .editor-panel .d-flex:has(#saveButton) {
        flex-shrink: 0;
        margin-top: auto;
        padding-top: 0.25rem;
      }

      /* Floating message styles */
      #appMessages {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1050;
        pointer-events: none;
      }

      #appMessage {
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        min-width: 300px;
        max-width: 600px;
      }

      #appMessageText {
        flex: 1;
      }

      #appMessageClose {
        flex-shrink: 0;
      }

      .editor-panel #readOnlyNotice {
        flex-shrink: 0;
      }

      /* Hide footer when editor is shown (show only on login page) */
      #editorSection.d-none ~ .w-100 {
        display: block;
      }

      #editorSection:not(.d-none) ~ .w-100 {
        display: none;
      }

      @media (max-width: 992px) {
        .resizable-wrapper {
          flex-direction: column;
        }

        .tree-panel {
          width: 100%;
          max-width: none;
          border-right: none;
          border-bottom: 1px solid #dfe3e8;
        }

        .resizer {
          height: 6px;
          width: 100%;
          cursor: row-resize;
        }

        .resizer::before {
          width: 32px;
          height: 2px;
        }

        body.resizing {
          cursor: row-resize;
        }
      }

      .context-menu {
        position: fixed;
        z-index: 1080;
        display: none;
        min-width: 180px;
        background-color: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
      }

      .context-menu.show {
        display: block;
      }

      .context-menu button {
        width: 100%;
        padding: 0.5rem 1rem;
        background: transparent;
        border: 0;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .context-menu button:hover,
      .context-menu button:focus {
        background-color: #f8f9fa;
      }

      .context-menu .separator {
        margin: 0.25rem 0;
        border-top: 1px solid #dee2e6;
      }

      /* Image resize handles */
      #richTextEditor img {
        position: relative;
        cursor: default;
        max-width: 100%;
        height: auto;
      }

      #richTextEditor img.selected {
        outline: 2px solid #007bff;
        outline-offset: 2px;
      }

      /* Full-screen application styles */
      #editorSection {
        height: 100vh;
        margin: 0;
        padding: 0;
        overflow: hidden;
      }

      #editorSection .row {
        height: 100%;
        margin: 0;
      }

      #editorSection .col-12 {
        height: 100%;
        padding: 0;
      }

      #editorSection .card {
        height: 100%;
        border: none;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
      }

      #editorSection .card-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        padding: 1rem;
        min-height: 0;
        overflow: hidden;
      }

      #editorSection .card-body > .d-flex:first-child {
        flex-shrink: 0;
      }

      #editorSection .resizable-wrapper {
        flex: 1 1 auto;
        min-height: 0;
      }

      /* Ensure dropdown menus appear above the editor */
      #editorSection .dropdown-menu {
        z-index: 1090 !important;
      }

