  /* ============================================================
   NOTES TREE — MODERNIZED STYLE (Chevron, Animations, Rows)
============================================================ */

  .notes-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 8px 0;
  }

  .notes-row-btn {
      background: var(--surface-base) !important;
      border: 1px solid var(--surface-border);
      padding: 10px 12px;
      color: var(--text-primary);
      cursor: pointer;
      font-size: 15px;
      border-radius: 12px;
      text-align: left;
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: background 0.2s, transform 0.12s, border-color 0.2s, box-shadow 0.2s;
      box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  }

  .notes-row[draggable="true"] .notes-row-btn {
      cursor: grab;
  }

  .notes-row:hover .notes-row-btn {
      background: var(--surface-hover) !important;
      border-color: color-mix(in srgb, var(--accent-primary), var(--surface-border) 70%);
      transform: translateY(-1px);
  }

  .notes-row.drop-target .notes-row-btn {
      outline: 2px dashed var(--accent-primary);
      outline-offset: 2px;
      background: color-mix(in srgb, var(--accent-primary), transparent 92%) !important;
  }

  /* Delete button */
  .note-btn {
      background: none;
      border: none;
      color: var(--accent-primary);
      cursor: pointer;
      font-size: 18px;
      padding-left: 10px;
      transition: background 0.2s ease;
  }

  .note-btn:hover {
      background: color-mix(in srgb, var(--accent-primary), transparent 85%);
      border-radius: 8px;
  }

  /* Indentation */
  .notes-indent {
      margin-left: 16px;
  }

  /* Active page highlighting */
  .notes-page.active .notes-row-btn {
      background: var(--surface-elevated) !important;
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary), transparent 85%);
  }

  /* Expand animation */
  .notes-expand {
      overflow: hidden;
      max-height: 0;
      opacity: 0;
      transition: max-height 0.25s ease, opacity 0.25s ease;
  }

  .notes-expand.open {
      max-height: 800px;
      /* large enough */
      opacity: 1;
  }

  /* Chevron styling */
  .chevron {
      width: 16px;
      height: 16px;
      transition: transform 0.25s ease;
  }

  .chevron.open {
      transform: rotate(90deg);
  }

  .notes-bullet {
      opacity: 0.7;
  }

  /* Make + New Subset / + New Page exactly match all rows */
  .notes-row-btn {
      width: 100%;
  }

  /* Remove weird extra spacing caused by previous version */
  .notes-row {
      margin: 4px 0;
  }

  /* Ensure indent rows line up */
  .notes-indent .notes-row {
      margin-left: 0;
  }

  /* ============================================================
   NOTES TREE COLOR CODING — Categories / Subsets / Pages
============================================================ */

  /* CATEGORY rows */
  .notes-row.category {
      background: transparent !important;
  }

  .notes-row.category .notes-row-btn {
      border-left: 4px solid var(--accent-primary);
  }

  /* SUBSET rows */
  .notes-row.subset {
      background: transparent !important;
  }

  .notes-row.subset .notes-row-btn {
      border-left: 4px solid color-mix(in srgb, var(--accent-primary), transparent 45%);
  }

  /* PAGE rows */
  .notes-row.page {
      background: transparent !important;
  }

  .notes-row.page .notes-row-btn {
      border-left: 4px solid color-mix(in srgb, var(--accent-primary), transparent 70%);
  }

  /* Hover state unified */
  .notes-row-btn:hover {
      background: var(--surface-hover) !important;
  }

  /* Active page highlight */
  .notes-page.active .notes-row-btn {
      background: var(--surface-elevated) !important;
      border: 1px solid var(--surface-border);
  }

  .notes-inline-input {
      width: 100%;
      border: 1px solid var(--surface-border);
      background: var(--surface-base);
      color: var(--text-primary);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 15px;
      outline: none;
  }

  .notes-inline-rename {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 6px;
  }

  .notes-inline-rename .notes-inline-input {
      flex: 1 1 auto;
      min-width: 0;
  }

  .notes-inline-confirm {
      flex: 0 0 auto;
      width: 32px;
      height: 32px;
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      background: var(--surface-base);
      color: var(--accent-primary);
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
  }

  .notes-inline-confirm:hover {
      background: var(--surface-hover);
  }

  .notes-tree-panel {
      background: color-mix(in srgb, var(--surface-base), transparent 0%) !important;
      min-width: 220px;
      max-width: 620px;
      width: var(--notes-tree-width, 280px);
      flex: 0 0 auto;
  }

  .notes-tree-resizer {
      position: relative;
      width: 10px;
      cursor: col-resize;
      background: transparent;
      border: none;
      flex: 0 0 10px;
      user-select: none;
      touch-action: none;
  }

  .notes-tree-resizer::before {
      display: none;
  }

  .notes-tree-resizer::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 4px;
      height: 28px;
      transform: translate(-50%, -50%);
      border-radius: 999px;
      background: color-mix(in srgb, var(--text-secondary), transparent 45%);
      opacity: 0.55;
      transition: opacity 0.2s ease, background 0.2s ease;
  }

  .notes-tree-resizer:hover::after,
  .notes-tree-resizer.is-dragging::after {
      opacity: 0.95;
      background: color-mix(in srgb, var(--accent-primary), transparent 28%);
  }

  .notes-tree-title {
      letter-spacing: 0.02em;
      font-size: 18px;
      margin-bottom: 10px;
  }

  .notes-editor-panel {
      background: linear-gradient(180deg, color-mix(in srgb, var(--surface-base), transparent 0%), var(--surface-base));
  }

  .notes-editor-input.is-empty:before {
      content: attr(data-placeholder);
      color: var(--text-secondary);
      opacity: 0.75;
      pointer-events: none;
  }

  .notes-quick-modal-box {
      width: min(92vw, 520px);
  }

  .notes-context-menu {
      position: fixed;
      width: max-content;
      min-width: 0;
      max-width: 180px;
      background: var(--surface-muted);
      border: 1px solid var(--surface-border);
      border-radius: 10px;
      box-shadow: var(--shadow-elevated);
      padding: 6px;
      z-index: 999999;
  }

  .notes-context-menu.hidden {
      display: none;
  }

  .notes-context-menu button {
      width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      background: transparent;
      border: none;
      text-align: left;
      padding: 8px 10px;
      color: var(--text-primary);
      border-radius: 8px;
      cursor: pointer;
  }

  .notes-context-menu button:hover {
      background: var(--surface-hover);
  }

  .notes-context-menu button.danger {
      color: var(--accent-primary);
  }

  .notes-ai-btn {
      padding: 8px 12px;
      border: 1px solid color-mix(in srgb, var(--accent-primary), transparent 45%);
      background: color-mix(in srgb, var(--accent-primary), transparent 12%);
      color: var(--text-on-accent);
      border-radius: 8px;
      cursor: pointer;
      font-size: 15px;
      transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .notes-ai-btn:hover {
      background: color-mix(in srgb, var(--accent-primary), transparent 0%);
      border-color: color-mix(in srgb, var(--accent-primary), transparent 20%);
      box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-primary), transparent 70%);
      transform: translateY(-1px);
  }

  .notes-editor {
      overflow-y: auto;
      overflow-x: hidden;
      white-space: normal;
      word-wrap: break-word;
      width: 100%;
  }

  .notes-tree {
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 8px;
      /* so hover looks nice */
  }

  .notes-category-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
  }

  .notes-category {
      padding: 10px 14px;
      background: var(--surface-base);
      border: 1px solid var(--surface-border);
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.2s;
      color: var(--text-primary);
  }

  .notes-category:hover {
      background: var(--surface-hover);
  }

  .note-btn {
      background: var(--surface-base);
      border: none;
      color: var(--text-primary);
      padding: 6px 10px;
      border-radius: 6px;
      cursor: pointer;
  }

  .note-btn:hover {
      background: var(--surface-hover);
  }

#notesToolbar .note-btn {
    border: none;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--surface-base);
}

.notes-math {
    position: relative;
}

.notes-math-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    display: none;
    padding: 10px;
    background: var(--surface-base);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    z-index: 1000002;
    min-width: 260px;
    max-width: min(360px, 90vw);
}

.notes-math-menu.show {
    display: block;
}

.notes-math-header {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.notes-math-textarea {
    width: 100%;
    min-height: 56px;
    resize: vertical;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: var(--surface-base);
    color: var(--text-primary);
    font-family: inherit;
}

.notes-math-preview {
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    background: var(--surface-elevated);
    border: 1px dashed var(--surface-border);
    min-height: 34px;
}

.notes-math-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.notes-math-delete-btn {
    margin-right: auto;
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
    background: var(--surface-base);
}

.notes-math-delete-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.notes-math-section {
    margin-top: 8px;
}

.notes-math-section-toggle {
    width: 100%;
    text-align: left;
    background: color-mix(in srgb, var(--surface-base), var(--surface-border) 35%);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 13px;
}

.notes-math-grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow: auto;
}

.notes-math-grid.collapsed {
    display: none;
}

.notes-math-grid button {
    border: 1px solid var(--surface-border);
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 14px;
}

#notesGreekMenu button {
    font-family: "STIX Two Math", "Cambria Math", "Noto Sans Math", "Times New Roman", serif;
    letter-spacing: 0;
}

.notes-math-grid button:hover {
    background: var(--surface-hover);
}

.notes-greek-menu {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow: auto;
}

.notes-greek-menu button {
    border: 1px solid var(--surface-border);
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 14px;
}

.notes-greek-menu button:hover {
    background: var(--surface-hover);
}

.notes-math-field {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    background: transparent;
    border: none;
    min-height: 30px;
}

.notes-math-field.is-rendered {
    background: transparent;
    border-color: transparent;
    padding: 0;
}

.notes-math-block {
    display: block;
    margin: 10px 0;
}

.notes-math-render {
    display: inline-block;
    color: var(--text-primary);
    min-height: 22px;
    min-width: 40px;
    font-family: inherit;
}

.notes-math-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    cursor: pointer;
}

.notes-math-field:hover .notes-math-delete {
    opacity: 1;
    pointer-events: auto;
}

.notes-math-delete:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

  .summarize-item {
      padding: 10px 14px;
      cursor: pointer;
      color: var(--text-primary);
      font-size: 14px;
  }

  .summarize-item:hover {
      background: var(--surface-hover);
  }

  .gfn-page-card {
      padding: 15px;
      background: var(--surface-base);
      border-radius: 10px;
      cursor: pointer;
      border: 2px solid transparent;
      transition: 0.15s;
      color: var(--text-primary);
  }

  .gfn-page-card:hover {
      background: var(--surface-hover);
  }

  .gfn-page-card.selected {
      border-color: var(--accent-primary);
      background: color-mix(in srgb, var(--accent-primary), transparent 75%);
      color: var(--text-on-accent);
  }

  /* ============================================================
   AI NOTES PANEL
   ============================================================ */

  #aiNotesPanel {
      position: fixed;
      display: none;
      right: -400px;
      /* hidden by default */
      top: var(--toolbar-height);
      width: 400px;
      height: calc(100vh - var(--toolbar-height));
      background: var(--surface-elevated);
      border-left: 1px solid var(--surface-border);
      padding: 20px;
      overflow-y: auto;
      transition: right 0.3s ease;
      z-index: 99996;
      color: var(--text-primary);
  }

  #aiNotesPanel.open {
      right: 0;
      display: block;
  }

  .ai-notes-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
  }

  .ai-notes-title {
      font-size: 18px;
      font-weight: 600;
  }

  .ai-notes-subtitle {
      font-size: 13px;
      color: var(--text-secondary);
  }

  .ai-notes-actions {
      display: flex;
      flex-direction: column;
      gap: 12px;
  }

  .ai-notes-primary,
  .ai-notes-secondary {
      width: 100%;
      padding: 12px 14px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      font-size: 15px;
  }

  .ai-notes-primary {
      background: var(--accent-primary);
      color: var(--text-on-accent);
  }

  .ai-notes-secondary {
      background: var(--surface-base);
      color: var(--text-primary);
      border: 1px solid var(--surface-border);
  }

  .ai-notes-ghost {
      background: transparent;
      border: 1px solid var(--surface-border);
      color: var(--text-primary);
      padding: 6px 10px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 12px;
  }

  .ai-notes-card {
      background: var(--surface-base);
      border: 1px solid var(--surface-border);
      border-radius: 12px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
  }

  .ai-notes-card-title {
      font-weight: 600;
  }

  .ai-notes-card-subtext {
      font-size: 13px;
      color: var(--text-secondary);
  }

  .ai-notes-textarea {
      min-height: 90px;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: var(--surface-muted);
      color: var(--text-primary);
      padding: 10px;
      font-size: 14px;
      resize: vertical;
  }

  .ai-notes-char-counter {
      font-size: 12px;
      color: var(--text-secondary);
      text-align: right;
      margin-top: -4px;
  }

  .exercise-modal-box {
      width: min(760px, 92vw);
      max-height: 90vh;
      overflow-y: auto;
  }

  .exercise-subtext {
      margin-top: -4px;
      color: var(--text-secondary);
      font-size: 13px;
  }

  .exercise-mode-group {
      display: flex;
      gap: 8px;
      margin: 6px 0 10px;
      flex-wrap: wrap;
  }

  .exercise-mode-pill {
      border: 1px solid var(--surface-border);
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 13px;
      background: var(--surface-base);
      cursor: pointer;
  }

  .exercise-mode-pill input {
      margin-right: 6px;
  }

  .exercise-check-grid {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin: 6px 0;
  }

  .exercise-checkbox {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-primary);
  }

  .exercise-status {
      margin-top: 10px;
      font-size: 13px;
      color: var(--text-secondary);
  }

  .exercise-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 12px;
  }

  .exercise-download-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
      margin-bottom: 12px;
  }

  .exercise-download-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      padding: 8px 12px;
      text-decoration: none;
      color: var(--text-primary);
      background: var(--surface-base);
  }

  .exercise-question-wrap {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: 44vh;
      overflow-y: auto;
      margin: 8px 0 10px;
  }

  .exercise-answer-item {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 8px;
      border: 1px solid var(--surface-border);
      border-radius: 10px;
      background: var(--surface-base);
  }

  .exercise-review-card {
      margin-top: 12px;
      border: 1px solid var(--surface-border);
      border-radius: 10px;
      padding: 10px;
      background: var(--surface-base);
  }

  .exercise-review-score {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 8px;
  }

  .exercise-review-row {
      border-top: 1px solid var(--surface-border);
      margin-top: 8px;
      padding-top: 8px;
      font-size: 13px;
  }

  .exercise-mini-title {
      font-size: 12px;
      color: var(--text-secondary);
      margin-bottom: 6px;
  }

  .exercise-mini-row {
      font-size: 12px;
      margin-bottom: 4px;
      color: var(--text-primary);
  }

  .exercise-review-mini {
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      padding: 8px;
      margin-top: 8px;
      background: var(--surface-muted);
      font-size: 12px;
  }

  #aiNotesPanel .test-config-note {
      padding: 12px 14px;
      border-radius: 12px;
      background: var(--surface-base);
      border: 1px solid var(--surface-border);
      color: var(--text-secondary);
      font-size: 14px;
  }

  #aiNotesPanel .test-config-btn {
      padding: 10px 18px;
      border-radius: 12px;
      border: 1px solid transparent;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition:
          transform 0.2s ease,
          box-shadow 0.2s ease,
          background 0.2s ease;
  }

  #aiNotesPanel .test-config-btn.secondary {
      background: var(--surface-base);
      color: var(--text-primary);
      border-color: var(--surface-border);
  }

  .ai-chat-thread {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: calc(100vh - 260px);
      overflow-y: auto;
      padding-right: 4px;
  }

  .ai-chat-controls {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      margin-bottom: 10px;
  }

  .ai-chat-message {
      background: var(--surface-base);
      border: 1px solid var(--surface-border);
      border-radius: 12px;
      padding: 12px;
      box-shadow: var(--shadow-soft);
  }

  .ai-chat-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
  }

  .ai-chat-title {
      font-weight: 600;
  }

  .ai-chat-checkbox {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text-secondary);
  }

  .ai-chat-content {
      font-size: 14px;
      line-height: 1.6;
      color: var(--text-primary);
  }

  .ai-history-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
  }

  .ai-history-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: var(--surface-muted);
  }

  .ai-history-title {
      font-weight: 600;
      font-size: 13px;
  }

  .ai-history-meta {
      font-size: 11px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 6px;
  }

  .ai-history-empty {
      font-size: 12px;
      color: var(--text-secondary);
  }

  .ai-history-actions-wrap {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
  }

  .ai-history-actions {
      display: flex;
      gap: 6px;
      flex-wrap: nowrap;
  }

  .ai-history-actions-secondary {
      width: 100%;
      justify-content: flex-end;
  }

  .ai-history-tag {
      padding: 2px 6px;
      border-radius: 999px;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      background: color-mix(in srgb, var(--accent-primary), transparent 80%);
      color: var(--text-primary);
  }

  .ai-chat-examples-content {
      font-size: 14px;
      line-height: 1.6;
      color: var(--text-primary);
  }

  .ai-examples-modal-box {
      width: min(92vw, 860px);
      max-height: min(86vh, 860px);
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 18px;
      position: relative;
  }

  .ai-examples-modal-header {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
      padding-right: 42px;
      min-height: 34px;
  }

  .ai-examples-modal-title {
      font-weight: 700;
      font-size: 17px;
  }

  .ai-examples-modal-thread {
      max-height: min(62vh, 620px);
      overflow-y: auto;
      padding: 4px;
  }

  .ai-examples-modal-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 10px;
      padding-top: 6px;
  }

  .ai-examples-modal-actions .ai-notes-primary,
  .ai-examples-modal-actions .ai-notes-ghost {
      width: auto;
      min-width: 150px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      white-space: nowrap;
  }

  @media (max-width: 560px) {
      .ai-examples-modal-actions {
          flex-wrap: wrap;
          justify-content: stretch;
      }

      .ai-examples-modal-actions .ai-notes-primary,
      .ai-examples-modal-actions .ai-notes-ghost {
          flex: 1 1 100%;
          min-width: 0;
      }
  }

  .ai-chat-example .ai-chat-examples-content {
      padding: 0;
  }

.notes-tree-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notes-mobile-close-btn,
.notes-mobile-browse-btn,
.notes-mobile-tree-backdrop {
    display: none;
}

#notesMobileBrowseToolbarBtn {
    display: none;
}

@media (max-width: 900px) {
    #notesPage {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }

    #notesSplit {
        position: relative;
        display: block !important;
        height: auto !important;
        min-height: calc(100dvh - var(--toolbar-height) - env(safe-area-inset-bottom, 0px));
    }

    #notesTreePanel {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100dvh;
        max-height: none;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 1000004;
        border-right: none !important;
        border-bottom: none !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: calc(var(--toolbar-height) + env(safe-area-inset-top, 0px) + 8px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
    }

    #notesTreeContainer {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 8px;
    }

    #notesSplit.mobile-tree-open #notesTreePanel {
        transform: translateX(0);
    }

    #notesTreeResizer {
        display: none !important;
    }

    .notes-mobile-tree-backdrop {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: color-mix(in srgb, var(--surface-base), transparent 28%);
        z-index: 1000003;
    }

    .notes-mobile-tree-backdrop.show {
        display: block;
    }

    #notesEditorPanel {
        width: 100%;
        min-height: calc(100dvh - var(--toolbar-height) - env(safe-area-inset-bottom, 0px));
        overflow: visible !important;
        padding: 14px !important;
    }

    .notes-mobile-browse-btn {
        display: inline-flex;
        margin-bottom: 12px;
    }

    .notes-mobile-close-btn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        min-height: 40px;
        min-width: 40px;
        padding: 0 !important;
        justify-content: center;
        line-height: 1;
        font-size: 20px;
        flex: 0 0 auto;
    }

    #noteEditor {
        min-height: 44dvh !important;
        padding: 14px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    .notes-row-btn,
    .note-btn,
    .notes-ai-btn {
        min-height: 42px;
    }

    #aiNotesPanel {
        top: var(--toolbar-height);
        width: 100vw;
        height: calc(100dvh - var(--toolbar-height) - env(safe-area-inset-bottom, 0px));
        right: -100vw;
        padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
    }

    .ai-chat-thread {
        max-height: none;
    }
}
