OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-note / web / css / app.css

1391 lines · css ref:
/* Hypernote — Web UI Styles */

:root {
  --sidebar-width: 260px;
  --topbar-height: 48px;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Dark (default theme) */
[data-theme="dark"], :root {
  --bg: #1e1e1e;
  --bg-secondary: #252525;
  --bg-sidebar: #1a1a1a;
  --bg-card: #252525;
  --bg-hover: rgba(255,255,255,0.05);
  --bg-active: rgba(86,156,214,0.15);
  --text: #d4d4d4;
  --text-muted: #808080;
  --accent: #569cd6;
  --accent-hover: #7ab8e8;
  --border: #3c3c3c;
  --green: #4ec9b0;
  --yellow: #dcdcaa;
  --code-bg: #1a1a1a;
  --input-bg: #2d2d2d;
  --toolbar-invert: invert(0.8);
  --shadow: rgba(0,0,0,0.4);
}

/* Dark Blue */
[data-theme="dark-blue"] {
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-sidebar: #0f3460;
  --bg-card: #1a1a2e;
  --bg-hover: rgba(255,255,255,0.05);
  --bg-active: rgba(233,69,96,0.15);
  --text: #e4e4e4;
  --text-muted: #8b8b9e;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --border: #2a2a4a;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --code-bg: #0d1117;
  --input-bg: #16213e;
  --toolbar-invert: invert(0.8);
  --shadow: rgba(0,0,0,0.3);
}

/* Light */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-sidebar: #eaeaea;
  --bg-card: #ffffff;
  --bg-hover: rgba(0,0,0,0.04);
  --bg-active: rgba(37,99,235,0.1);
  --text: #1e1e1e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #d1d5db;
  --green: #16a34a;
  --yellow: #ca8a04;
  --code-bg: #f3f4f6;
  --input-bg: #ffffff;
  --toolbar-invert: invert(0);
  --shadow: rgba(0,0,0,0.1);
}

.text-muted { color: var(--text-muted); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button {
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
}
button:hover { background: var(--border); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: #fff; }

input[type="text"], textarea {
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
}
input[type="text"]:focus, textarea:focus {
  border-color: var(--accent);
}

/* Layout */
#app { display: flex; flex-direction: column; height: 100vh; }

#topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; }

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

#sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  padding: 4px 8px;
  color: var(--text-muted);
}

#breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
#breadcrumb a { color: var(--text-muted); }
#breadcrumb a:hover { color: var(--text); }
#breadcrumb .sep { color: var(--border); }

.search-box { position: relative; }
#search-input { width: 220px; }
.search-toggle { display: none; background: none; border: none; font-size: 1rem; padding: 4px 6px; color: var(--text-muted); cursor: pointer; }
.directory-toggle { background: none; border: none; font-size: 1rem; padding: 4px 8px; color: var(--text-muted); cursor: pointer; margin-left: 4px; }
.directory-toggle:hover { color: var(--text-primary); }

/* User directory modal items */
.directory-item {
  display: block; padding: 10px 14px; margin: 6px 0;
  background: var(--bg-secondary); border-radius: 6px;
  text-decoration: none; color: var(--text); transition: background 0.15s;
}
.directory-item:hover { background: var(--bg-hover); }
.directory-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.directory-username { font-size: 0.8rem; color: var(--text-muted); }

/* Sidebar */
#layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  transition: margin-left 0.2s;
}
#sidebar.collapsed { margin-left: calc(var(--sidebar-width) * -1); }

.sidebar-section { padding: 12px 0; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); }

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sidebar-header button {
  font-size: 1rem;
  padding: 0 6px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--text-muted);
}
.sidebar-header button:hover { color: var(--accent); }

#notebook-list {
  list-style: none;
}

/* Notebook tree item */
.nb-item { }

.nb-row {
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nb-row:hover { background: var(--bg-hover, rgba(255,255,255,0.05)); }
.nb-row.active { background: var(--bg-active, rgba(233,69,96,0.15)); color: var(--accent); }

.nb-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 10px;
  flex-shrink: 0;
}

.nb-label { flex: 1; }

.note-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Nested note list */
.nb-notes {
  list-style: none;
  padding: 0;
}

.nb-note, .nb-note-new {
  padding: 4px 14px 4px 34px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.nb-note:hover, .nb-note-new:hover { background: var(--bg-hover, rgba(255,255,255,0.05)); color: var(--text); }
.nb-note.active { background: var(--bg-active, rgba(233,69,96,0.1)); color: var(--accent); }
.nb-note-new { color: var(--accent); font-size: 0.75rem; opacity: 0.7; }
.nb-note-new:hover { opacity: 1; }

.encrypted-badge {
  font-size: 0.7rem;
  color: var(--yellow);
  margin-left: 4px;
}

/* Main */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.view { display: none; }
.view.active { display: block; }

/* Notebook view */
.notebook-header { margin-bottom: 24px; }
.notebook-header-row { display: flex; align-items: center; gap: 12px; }
.notebook-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.notebook-meta { color: var(--text-muted); font-size: 0.85rem; }

#notebook-notes .note-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
#notebook-notes .note-card:hover { border-color: var(--accent); }

.note-card-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.note-card:hover .note-card-actions { opacity: 1; }
.note-card-btn {
  padding: 3px 10px; font-size: 0.75rem; border-radius: 4px;
  border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-card); color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.note-card-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.note-card-delete:hover { background: #e94560; color: #fff; border-color: #e94560; }
.note-card h3 { font-size: 1rem; margin-bottom: 4px; }
.note-card .snippet { color: var(--text-muted); font-size: 0.85rem; }
.note-card .meta { color: var(--text-muted); font-size: 0.75rem; margin-top: 8px; }
.note-card .tags { display: flex; gap: 4px; margin-top: 6px; }
.note-card .tag {
  font-size: 0.7rem;
  background: var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}

/* Note view */
.note-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

#note-content { max-width: 720px; }
#note-links-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
#note-links-panel h3 { font-size: 0.9rem; margin-bottom: 8px; color: var(--text-muted); }
#note-links-panel ul { list-style: none; }
#note-links-panel li { padding: 4px 0; font-size: 0.85rem; }

/* Editor */
.editor-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
#editor-title { flex: 1; min-width: 200px; font-size: 1.1rem; font-weight: 600; }
#editor-tags { width: 200px; }
.editor-actions { display: flex; gap: 8px; }

/* Toast UI Editor overrides for dark theme */
#editor-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#editor-container .toastui-editor-defaultUI {
  border: none;
  border-radius: var(--radius);
  background: var(--bg);
}

#editor-container .toastui-editor-defaultUI-toolbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

#editor-container .toastui-editor-mode-switch {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

#editor-container .toastui-editor-mode-switch .tab-item {
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}
#editor-container .toastui-editor-mode-switch .tab-item.active {
  color: var(--text);
  background: var(--bg);
}

#editor-container .toastui-editor-ww-container,
#editor-container .toastui-editor-md-container {
  background: var(--bg);
}

/* WYSIWYG content area */
#editor-container .toastui-editor-contents,
#editor-container .toastui-editor-contents p,
#editor-container .toastui-editor-contents h1,
#editor-container .toastui-editor-contents h2,
#editor-container .toastui-editor-contents h3,
#editor-container .toastui-editor-contents h4,
#editor-container .toastui-editor-contents h5,
#editor-container .toastui-editor-contents h6,
#editor-container .toastui-editor-contents li,
#editor-container .toastui-editor-contents td,
#editor-container .toastui-editor-contents th,
#editor-container .toastui-editor-contents blockquote,
#editor-container .ProseMirror {
  color: var(--text) !important;
  font-family: var(--font);
  font-size: 0.9rem;
}

/* Markdown source editor */
#editor-container .toastui-editor-md-container .CodeMirror {
  background: var(--bg);
  color: var(--text);
}
#editor-container .toastui-editor-md-container .CodeMirror-cursor {
  border-left-color: var(--text);
}
#editor-container .toastui-editor-md-container .CodeMirror-line,
#editor-container .toastui-editor-md-container .CodeMirror-line span {
  color: var(--text) !important;
}

/* Markdown preview pane */
#editor-container .toastui-editor-md-preview {
  background: var(--bg-secondary);
  color: var(--text);
}
#editor-container .toastui-editor-md-preview p,
#editor-container .toastui-editor-md-preview li,
#editor-container .toastui-editor-md-preview h1,
#editor-container .toastui-editor-md-preview h2,
#editor-container .toastui-editor-md-preview h3 {
  color: var(--text) !important;
}

/* Splitter between editor and preview */
#editor-container .toastui-editor-md-splitter {
  background-color: var(--border);
}

/* Toolbar icon visibility */
#editor-container .toastui-editor-toolbar-icons {
  filter: var(--toolbar-invert);
}

/* Toolbar divider */
#editor-container .toastui-editor-toolbar-divider {
  background-color: var(--border);
}

/* Placeholder text */
#editor-container .toastui-editor-contents .placeholder {
  color: var(--text-muted) !important;
}
#editor-container .ProseMirror .placeholder {
  color: var(--text-muted) !important;
}

/* Links in editor */
#editor-container .toastui-editor-contents a {
  color: var(--accent);
}

/* Code blocks in editor */
#editor-container .toastui-editor-contents pre {
  background: var(--code-bg);
  color: var(--text);
}
#editor-container .toastui-editor-contents code {
  background: var(--code-bg);
  color: var(--text);
}

/* Tables */
#editor-container .toastui-editor-contents table th,
#editor-container .toastui-editor-contents table td {
  border-color: var(--border);
}
#editor-container .toastui-editor-contents table th {
  background: var(--bg-secondary);
}

/* Popup menus (heading selector, etc) */
#editor-container .toastui-editor-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
}
#editor-container .toastui-editor-popup-body label {
  color: var(--text);
}
#editor-container .toastui-editor-popup-body input {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

/* Blockquote */
#editor-container .toastui-editor-contents blockquote {
  border-left-color: var(--accent);
}

/* Horizontal rule */
#editor-container .toastui-editor-contents hr {
  border-color: var(--border);
}

/* Search */
#search-results .search-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
}
#search-results .search-item:hover { border-color: var(--accent); }
.search-item .title { font-weight: 600; }
.search-item .path { font-size: 0.75rem; color: var(--text-muted); }
.search-item .snippet { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Markdown body */
.markdown-body h1 { font-size: 1.8rem; margin: 24px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.markdown-body h2 { font-size: 1.4rem; margin: 20px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 1.15rem; margin: 16px 0 8px; }
.markdown-body h4 { font-size: 1rem; margin: 12px 0 6px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 24px; }
.markdown-body li { margin: 2px 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 16px;
  margin: 12px 0;
  color: var(--text-muted);
}
.markdown-body pre {
  background: var(--code-bg);
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.85rem;
}
.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.markdown-body :not(pre) > code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
}
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.markdown-body img { max-width: 100%; border-radius: var(--radius); }
.markdown-body a.wikilink { color: var(--green); }
.markdown-body a.wikilink.unresolved { color: var(--text-muted); text-decoration: underline dashed; }

/* Gallery — masonry layout */
.gallery-masonry {
  column-count: 3;
  column-gap: 8px;
  margin: 16px 0;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-secondary);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}
.gallery-caption {
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

/* Gallery responsive */
@media (max-width: 768px) { .gallery-masonry { column-count: 2; } }
@media (max-width: 480px) { .gallery-masonry { column-count: 2; column-gap: 6px; } .gallery-item { margin-bottom: 6px; } }

/* Recent feed */
.recent-feed { display: flex; flex-direction: column; gap: 8px; }
.feed-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.feed-card:hover { border-color: var(--accent); }
.feed-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.feed-card-title { font-weight: 600; font-size: 15px; color: var(--accent); }
.feed-card-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-left: 12px; }
.feed-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.feed-card-notebook { margin-right: 8px; }
.feed-card-preview { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.feed-card-tags { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.feed-card-tags .tag {
  font-size: 11px;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Admin panel */
.admin-link {
  text-decoration: none; font-size: 1.1rem; padding: 4px 6px;
  color: var(--text-muted); cursor: pointer; margin-left: 4px;
}
.admin-link:hover { color: var(--accent); }

/* P2P Network Section */
.p2p-status-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px; font-size: 0.9rem;
}
.p2p-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.p2p-online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.p2p-offline { background: #ef4444; }
.p2p-peers { margin-left: auto; color: var(--text-muted); font-size: 0.85rem; }

.p2p-site-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.p2p-site-row label { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.site-url-code {
  display: inline-block; padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.8rem; word-break: break-all; cursor: pointer;
  transition: background 0.15s; flex: 1; min-width: 0;
}
.site-url-code:hover { background: var(--bg-hover); }
.site-url-code.copied { background: var(--accent); color: #fff; }

.p2p-key-code {
  font-size: 0.75rem; padding: 2px 6px; background: var(--bg-secondary);
  border-radius: 3px; cursor: pointer; transition: background 0.15s;
}
.p2p-key-code:hover { background: var(--bg-hover); }
.p2p-key-code.copied { background: var(--accent); color: #fff; }

.p2p-badge {
  display: inline-block; padding: 2px 8px; font-size: 0.75rem;
  border-radius: 12px; font-weight: 600;
}
.p2p-badge-on { background: rgba(34,197,94,0.15); color: #22c55e; }
.p2p-badge-off { background: var(--bg-secondary); color: var(--text-muted); }

.p2p-republish {
  white-space: nowrap;
}

.p2p-notebooks { margin-bottom: 24px; }
.p2p-add-remote { margin-top: 12px; }
.p2p-add-remote h4 { margin: 0 0 8px; font-size: 0.9rem; }
.p2p-add-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.p2p-input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text); font-size: 0.85rem; font-family: monospace;
}
.p2p-input:focus { outline: none; border-color: var(--accent); }
.p2p-input { flex: 1; min-width: 200px; }
.p2p-input-sm { flex: 0 0 140px; min-width: 100px; font-family: inherit; }
.admin-stats {
  display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.admin-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; min-width: 100px; text-align: center;
}
.admin-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.admin-stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.admin-section-title { margin: 24px 0 12px; font-size: 1rem; color: var(--text); }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.admin-table th {
  text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase;
}
.admin-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text);
}
.admin-table td a { color: var(--accent); text-decoration: none; }
.admin-table td a:hover { text-decoration: underline; }
.admin-table tr:hover td { background: var(--bg-hover); }

.admin-role {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600;
}
.admin-role-admin { background: rgba(233,69,96,0.15); color: #e94560; }
.admin-role-writer { background: rgba(78,201,176,0.15); color: var(--green); }
.admin-role-reader { background: var(--bg-hover); color: var(--text-muted); }

.admin-vis {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem;
}
.admin-vis-public { background: rgba(78,201,176,0.15); color: var(--green); }
.admin-vis-private { background: var(--bg-hover); color: var(--text-muted); }

.admin-actions { white-space: nowrap; }
.admin-role-select, .admin-owner-select {
  background: var(--input-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 6px; font-size: 0.8rem; cursor: pointer;
}
.admin-role-select:focus, .admin-owner-select:focus { border-color: var(--accent); outline: none; }

/* Visibility button */
.btn-visibility {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-visibility:hover { border-color: var(--accent); color: var(--accent); }

/* Upload progress overlay */
.upload-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.upload-progress-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 32px;
  min-width: 320px;
  text-align: center;
  box-shadow: 0 8px 32px var(--shadow);
}
.upload-progress-label {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}
.upload-progress-track {
  background: var(--input-bg);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  width: 0%;
  transition: width 0.15s ease;
}
.upload-progress-pct {
  color: var(--text-muted);
  font-size: 12px;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
  user-select: none;
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 301;
  line-height: 1;
  opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 301;
  padding: 8px 16px;
  opacity: 0.6;
  user-select: none;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.6);
  padding: 6px 16px;
  border-radius: var(--radius);
  z-index: 301;
  max-width: 80vw;
  text-align: center;
}
.lightbox-counter {
  position: fixed;
  top: 20px;
  left: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  z-index: 301;
}
.markdown-body table { border-collapse: collapse; margin: 12px 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 12px; }
.markdown-body th { background: var(--bg-secondary); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 360px;
  max-width: 480px;
}
.modal h2 { margin-bottom: 16px; font-size: 1.1rem; }
.modal .form-group { margin-bottom: 14px; }
.modal .form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.modal .form-group input { width: 100%; }
.modal .form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Auth setup */
#auth-setup {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.auth-card {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}
.auth-card h1 { color: var(--accent); font-size: 2rem; margin-bottom: 12px; }
.auth-card p { color: var(--text-muted); margin-bottom: 16px; }
.auth-card input { width: 100%; margin-bottom: 12px; text-align: center; }
.auth-card button { width: 100%; }
.auth-card .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; }

/* Profile link */
.profile-link {
  margin-left: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: color 0.15s;
}
.profile-link:hover { color: var(--accent); }

/* Settings / Profile */
.settings-card {
  max-width: 640px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.settings-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}
.settings-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 120px;
}
.settings-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.perm-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 10px;
}
.perm-badge.admin { background: var(--accent); color: #fff; }
.perm-badge.write { background: var(--green); color: #fff; }
.perm-badge.read { background: var(--border); color: var(--text-muted); }

.btn-sm {
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.btn-sm:hover { background: var(--border); }
.btn-sm.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm.btn-primary:hover { background: var(--accent-hover); }
.btn-sm.btn-danger { color: var(--accent); border-color: var(--accent); }
.btn-sm.btn-danger:hover { background: var(--accent); color: #fff; }

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Theme picker */
.theme-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
  background: none;
  color: var(--text);
  font-size: 0.8rem;
}
.theme-option:hover { border-color: var(--accent); }
.theme-option.active { border-color: var(--accent); background: rgba(var(--accent), 0.1); }
.theme-swatch {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(128,128,128,0.3);
}
.theme-swatch.swatch-light { background: linear-gradient(135deg, #fff 50%, #eaeaea 50%); }
.theme-swatch.swatch-dark { background: linear-gradient(135deg, #1e1e1e 50%, #252525 50%); }
.theme-swatch.swatch-dark-blue { background: linear-gradient(135deg, #1a1a2e 50%, #0f3460 50%); }

/* File input */
input[type="file"] {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Password input */
input[type="password"] {
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
  width: 100%;
}
input[type="password"]:focus { border-color: var(--accent); }

/* Light theme: soften input borders */
[data-theme="light"] input[type="text"],
[data-theme="light"] textarea,
[data-theme="light"] input[type="password"] {
  border-color: var(--border);
  background: var(--input-bg);
}

[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,0.3);
}

[data-theme="light"] #editor-container .toastui-editor-contents,
[data-theme="light"] #editor-container .toastui-editor-contents p,
[data-theme="light"] #editor-container .toastui-editor-contents h1,
[data-theme="light"] #editor-container .toastui-editor-contents h2,
[data-theme="light"] #editor-container .toastui-editor-contents h3,
[data-theme="light"] #editor-container .toastui-editor-contents h4,
[data-theme="light"] #editor-container .toastui-editor-contents h5,
[data-theme="light"] #editor-container .toastui-editor-contents h6,
[data-theme="light"] #editor-container .toastui-editor-contents li,
[data-theme="light"] #editor-container .toastui-editor-contents td,
[data-theme="light"] #editor-container .toastui-editor-contents th,
[data-theme="light"] #editor-container .toastui-editor-contents blockquote,
[data-theme="light"] #editor-container .ProseMirror {
  color: var(--text) !important;
}

/* Media hover overlays (note view — delete/remove images, galleries, videos) */
.media-hover-wrap {
  position: relative;
  display: inline-block;
}
.media-hover-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}
.media-hover-wrap:hover .media-hover-actions { opacity: 1; }
.media-hover-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: rgba(0,0,0,0.7);
  color: #fff;
  backdrop-filter: blur(4px);
}
.media-hover-actions { display: flex; gap: 4px; }
.media-hover-edit:hover { background: var(--accent); }
.media-hover-delete:hover { background: #e94560; }

/* Gallery item overlay — injected inside, not wrapped */
.gallery-item { overflow: visible; }
.gallery-item img { border-radius: var(--radius); }
.gallery-item .media-hover-actions {
  position: absolute;
  top: 4px;
  right: 4px;
}
.gallery-item:hover .media-hover-actions { opacity: 1; }

/* Gallery container toolbar */
.gallery-masonry { position: relative; }
.gallery-toolbar {
  position: absolute;
  top: -32px;
  right: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 6;
}
.gallery-masonry:hover .gallery-toolbar { opacity: 1; }

/* Link hover wrap */
.link-hover-wrap {
  position: relative;
  display: inline;
}
.link-hover-wrap .media-hover-actions {
  position: absolute;
  top: -28px;
  right: 0;
  white-space: nowrap;
}
.link-hover-wrap:hover .media-hover-actions { opacity: 1; }

/* Link edit popover */
.link-edit-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 4px 16px var(--shadow);
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-edit-popover label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.link-edit-popover input {
  font-size: 0.85rem;
  padding: 5px 8px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}
.link-edit-popover input:focus { border-color: var(--accent); }
.link-edit-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.link-edit-actions button {
  padding: 4px 12px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
}
.link-edit-actions .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Editor floating media overlay */
.editor-media-overlay {
  position: absolute;
  z-index: 50;
  pointer-events: auto;
}
.editor-media-overlay .media-hover-btn {
  pointer-events: auto;
}

/* Note type badge */
.note-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  vertical-align: middle;
  background: var(--accent);
  color: #fff;
}

/* Spreadsheet editor */
#editor-spreadsheet, #note-spreadsheet-view {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  min-height: 300px;
}
#editor-spreadsheet .jexcel, #note-spreadsheet-view .jexcel {
  color: var(--text);
}
#editor-spreadsheet .jexcel td, #note-spreadsheet-view .jexcel td {
  border-color: var(--border);
}
#editor-spreadsheet .jexcel thead td, #note-spreadsheet-view .jexcel thead td {
  background: var(--bg-secondary);
  color: var(--text-muted);
}
#editor-spreadsheet .jexcel tbody tr td:first-child, #note-spreadsheet-view .jexcel tbody tr td:first-child {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Calendar editor + view */
#editor-calendar, #note-calendar-view {
  min-height: 400px;
  margin-top: 16px;
}
/* FullCalendar theme integration */
.fc {
  --fc-border-color: var(--border);
  --fc-button-bg-color: var(--bg-secondary);
  --fc-button-border-color: var(--border);
  --fc-button-text-color: var(--text);
  --fc-button-hover-bg-color: var(--border);
  --fc-button-hover-border-color: var(--border);
  --fc-button-active-bg-color: var(--accent);
  --fc-button-active-border-color: var(--accent);
  --fc-today-bg-color: var(--bg-active);
  --fc-page-bg-color: var(--bg);
  --fc-neutral-bg-color: var(--bg-secondary);
  --fc-event-bg-color: var(--accent);
  --fc-event-border-color: var(--accent);
  --fc-event-text-color: #fff;
}
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number,
.fc .fc-timegrid-slot-label-cushion {
  color: var(--text);
}
.fc .fc-toolbar-title {
  color: var(--text);
  font-size: 1.2rem;
}
.fc .fc-scrollgrid {
  border-color: var(--border);
}
.fc-theme-standard td, .fc-theme-standard th {
  border-color: var(--border);
}

/* Multi-Writer Sync */
#mw-section { margin-top: 0.5rem; }
#mw-status-display { margin-bottom: 0.5rem; font-size: 0.9em; }
#mw-invite-display { margin-top: 1rem; padding: 0.75rem; background: var(--bg-secondary); border-radius: 6px; }
#mw-invite-code { margin: 0.5rem 0; }

/* Responsive — tablets and small laptops */
@media (max-width: 768px) {
  :root { --sidebar-width: 200px; }

  #sidebar {
    position: fixed;
    z-index: 50;
    height: calc(100vh - var(--topbar-height));
    top: var(--topbar-height);
    left: 0;
  }
  #sidebar.collapsed { margin-left: calc(var(--sidebar-width) * -1); }

  /* Sidebar backdrop — closes sidebar on tap outside */
  #sidebar:not(.collapsed)::after {
    content: '';
    position: fixed;
    top: 0; left: var(--sidebar-width); right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: -1;
  }

  #main { padding: 16px; }

  /* Breadcrumb hidden on tablet — takes too much room */
  #breadcrumb { display: none; }

  #search-input { width: 140px; }

  /* Editor */
  #editor-container .toastui-editor-defaultUI { height: auto !important; min-height: 300px; }
  .editor-toolbar { flex-direction: column; gap: 8px; }
  #editor-title { min-width: 0; width: 100%; }
  #editor-tags { width: 100%; }
  .editor-actions { width: 100%; justify-content: flex-end; }

  /* Modal */
  .modal { min-width: 0; max-width: calc(100vw - 32px); width: calc(100vw - 32px); }
}

/* Responsive — phones */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 180px;
    --topbar-height: 44px;
  }

  /* Topbar: compact layout */
  #topbar { padding: 0 10px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 4px; }
  .logo { font-size: 1rem; }
  .search-toggle { display: inline-block; }
  .search-box { position: static; }
  #search-input { width: 0; padding: 6px 0; border: none; opacity: 0; transition: opacity 0.2s; }
  #search-input:focus, #search-input.open {
    width: 140px; padding: 6px 10px; border: 1px solid var(--border); opacity: 1;
  }
  .profile-link { margin-left: 4px; font-size: 0.8rem; padding: 4px 6px; }

  #main { padding: 12px; }

  /* Note toolbar wraps */
  .note-toolbar { flex-wrap: wrap; gap: 6px; }
  .note-toolbar button { font-size: 0.8rem; padding: 5px 10px; }

  /* Notebook header */
  .notebook-header h1 { font-size: 1.2rem; }

  /* Note cards tighter */
  #notebook-notes .note-card { padding: 12px; margin-bottom: 8px; }
  .note-card h3 { font-size: 0.9rem; }

  /* Settings / profile */
  .settings-card { padding: 16px; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .settings-row label { min-width: 0; }
  .settings-value { flex-wrap: wrap; }

  /* Markdown body */
  .markdown-body h1 { font-size: 1.4rem; }
  .markdown-body h2 { font-size: 1.2rem; }
  .markdown-body pre { padding: 10px; font-size: 0.8rem; }

  /* Modal full-width on phone */
  .modal { padding: 16px; }

  /* Auth card */
  .auth-card { padding: 24px 16px; }
  .auth-card h1 { font-size: 1.5rem; }

  /* Video in note content */
  #note-content video { max-width: 100%; height: auto; }
  #note-content img { max-width: 100%; height: auto; }
}