.browser-top, #browser-close-library { display: none }
#browser-storage {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--floating);
  padding: 22px;
  width: min(400px, calc(100vw - 28px));
}
#browser-storage::backdrop { background: #27203559 }
#browser-storage h2 { margin: 0 0 10px; font-size: 20px }
#browser-storage p { margin: 0 0 14px; color: var(--muted) }
#browser-storage .storage-actions { display: grid; gap: 8px }
#browser-storage button { border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 12px; text-align: left }
#browser-storage button:hover { background: var(--accent-soft) }
#browser-storage .storage-close { margin-top: 15px; width: 100%; text-align: center }
@media (max-width:730px) {
  .app { grid-template-columns: minmax(0, 1fr) }
  .browser-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 4px 10px;
    padding-top: max(4px, env(safe-area-inset-top));
    background: #121212;
    color: #f5f5f5;
  }
  .browser-top button { flex: none; padding: 8px 10px; border: 1px solid #555; border-radius: 7px }
  #browser-compact-status { min-width: 0; font-size: 12px; color: #d4d4d4 }
  #browser-compact-status.error { color: #ffb4ab }
  #browser-library-backdrop { position: fixed; inset: 0; z-index: 8; background: #17131c80 }
  .library {
    position: fixed;
    z-index: 9;
    inset: 0 auto 0 0;
    width: min(320px, 87vw);
    padding: max(16px, env(safe-area-inset-top)) 14px max(15px, env(safe-area-inset-bottom));
    visibility: hidden;
  }
  .browser-library-open .library { visibility: visible }
  #browser-close-library { display: block; margin-left: auto; border-radius: 8px; min-width: 36px; min-height: 36px; background: #282828 }
  .brand { gap: 8px; margin: 0 0 16px; font-size: 18px }
  .library-row > .nav-note, .library-actions button { font-size: 14px; min-height: 36px }
  .tabs { min-height: 34px; padding-inline: 8px }
  .note-header { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 6px 9px; gap: 4px }
  #note-title { font-size: 20px }
  .header-actions { gap: 2px; flex-wrap: wrap }
  .header-actions > button, #mode button { padding: 7px 5px }
  #popup { position: fixed; top: 140px; right: 8px; max-width: calc(100vw - 16px); max-height: 68dvh; overflow: auto }
  .text-toolbar { padding: 5px 7px; gap: 3px }
  #note-edit-tools, .note-view-actions { min-width: 0; overflow-x: auto }
  #note-editor-pages { min-width: 0 }
  #note-rich, #formatted-note { padding-inline: 15px; overflow-wrap: anywhere }
  .note-document { min-width: 0 }
  #note-details-panel { width: min(260px, 80vw) }
  #tools {
    top: 7px;
    left: 7px;
    width: calc(100% - 14px);
    max-width: none;
    transform: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }
  #tools button { flex: 0 0 auto; padding: 8px 7px }
  #inspector {
    inset: auto 8px max(54px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 34%;
    padding: 9px 12px;
    overscroll-behavior: contain;
  }
  #canvas-footer { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)) }
  #panes:has(#split-pane:not([hidden])) { flex-direction: column }
  #split-pane:not([hidden]) { flex: 1; width: 100%; min-height: 0; border-left: 0; border-top: 1px solid var(--border) }
  .wire-handle { width: 24px; height: 24px }
  #toast { bottom: max(54px, calc(env(safe-area-inset-bottom) + 12px)); z-index: 11; width: max-content }
}
