* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --danger: #ff4d4f;
  --bg: #f5f5f5;
  --card: #fff;
  --border: #e8e8e8;
  --text: #333;
  --text-secondary: #888;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.1);
  --sidebar-w: 380px;
}
html { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--text); height: 100%; display: flex; overflow: hidden;
  overscroll-behavior: none;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); min-width: 0; height: 100%; display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--border); z-index: 10; overflow: hidden;
  transition: width .25s ease, min-width .25s ease;
}
#sidebar.collapsed { width: 0; min-width: 0; border-right: none; }
#sidebar-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#sidebar-header h1 { font-size: 17px; font-weight: 600; white-space: nowrap; }
.header-actions { display: flex; gap: 6px; align-items: center; }
#sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tab-btn {
  flex: 1; padding: 10px; text-align: center; cursor: pointer;
  font-size: 14px; border: none; background: none; color: var(--text-secondary);
  border-bottom: 2px solid transparent; transition: all .2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-btn:hover { color: var(--primary); }
#sidebar-content { flex: 1; overflow-y: auto; }
.tab-panel { display: none; padding: 12px; }
.tab-panel.active { display: block; }

#sidebar-toggle {
  position: absolute; top: 50%; left: var(--sidebar-w); transform: translateY(-50%);
  width: 20px; height: 48px; background: var(--card); border: 1px solid var(--border);
  border-left: none; border-radius: 0 6px 6px 0; cursor: pointer; z-index: 11;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #aaa;
  transition: left .25s ease; box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
#sidebar-toggle:hover { color: var(--primary); }
body.sidebar-collapsed #sidebar-toggle { left: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 13px; transition: all .2s;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-icon { width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.btn-icon-bare { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; border-radius: 50%; transition: background .2s; }
.btn-icon-bare:hover { background: #f0f0f0; }

/* ── Day Cards ───────────────────────────────────────────── */
.day-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; box-shadow: var(--shadow); overflow: visible;
}
.day-header {
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
  background: #fafafa; border-bottom: 1px solid var(--border); cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0; transition: background .15s;
}
.day-card.collapsed .day-header { border-bottom: none; border-radius: var(--radius); }
.day-header:hover { background: #f0f5ff; }
.day-header h3 { font-size: 15px; font-weight: 500; flex-shrink: 0; }
.day-header .day-meta { font-size: 11px; color: var(--text-secondary); margin-left: 6px; flex-shrink: 0; }
.day-header .day-date-tag { font-size: 10px; padding: 1px 5px; border-radius: 10px; margin-left: 4px; flex-shrink: 0; }
.day-date-tag.workday { background: #f0f5ff; color: #1d39c4; }
.day-date-tag.weekend { background: #f6ffed; color: #389e0d; }
.day-date-tag.holiday { background: #fff1f0; color: #cf1322; }
.day-date-tag.adjusted-workday { background: #fffbe6; color: #ad6800; }
.day-body { padding: 10px 12px; position: relative; }

.day-note-preview {
  margin: 4px 0 8px 0; padding: 6px 8px; background: #f9f9f9; border-radius: 6px;
  cursor: pointer; border: 1px solid #f0f0f0; transition: border-color .2s;
}
.day-note-preview:hover { border-color: var(--primary); }
.day-note-preview .dnp-text {
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word; white-space: pre-line;
}
.day-note-preview .dnp-text:empty::before { content: '点击添加备注...'; color: #ccc; white-space: normal; }
.day-note-images { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.day-note-images img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; }

.waypoint-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  background: #fafafa; position: relative;
}
.waypoint-item .wp-index {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.waypoint-item .wp-info { flex: 1; min-width: 0; }
.waypoint-item .wp-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waypoint-item .wp-addr { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waypoint-actions { display: flex; gap: 4px; flex-shrink: 0; }
.route-info-bar {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px;
  margin: -4px 0 8px 30px; font-size: 11px; color: var(--text-secondary);
}
.add-wp-row { display: flex; gap: 8px; margin-top: 4px; position: relative; }
.add-wp-row input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none;
}
.add-wp-row input:focus { border-color: var(--primary); }

.add-day-card {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 14px;
  text-align: center; cursor: pointer; color: var(--text-secondary); transition: all .2s;
  margin-bottom: 12px; font-size: 14px;
}
.add-day-card:hover { border-color: var(--primary); color: var(--primary); background: #f0f5ff; }

.day-color-dot {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; flex-shrink: 0;
}
.drag-handle { cursor: grab; color: #ccc; font-size: 16px; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: .5; }

/* ── Search Dropdown ─────────────────────────────────────── */
.search-dropdown-inline {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 6px 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15);
  max-height: 200px; overflow-y: auto; z-index: 100;
}
.search-dropdown-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: #e6f4ff; }
.search-dropdown-item .sdi-name { font-weight: 500; }
.search-dropdown-item .sdi-addr { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ── Bookmarks ───────────────────────────────────────────── */
.bookmark-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: #fafafa;
}
.bookmark-info { flex: 1; min-width: 0; }
.bookmark-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-addr { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag-pill {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 8px; border-radius: 12px; font-size: 11px; cursor: pointer;
  border: 1px solid var(--border); background: #fafafa; color: var(--text-secondary);
  transition: all .15s; user-select: none; white-space: nowrap;
}
.tag-pill:hover { border-color: var(--primary); color: var(--primary); }
.tag-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag-filter-bar { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tag-filter-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.tag-filter-group:last-child { margin-bottom: 0; }
.tag-group-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; margin-right: 2px; flex-shrink: 0; }
.bookmark-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.bookmark-tags .tag-pill { padding: 1px 6px; font-size: 10px; cursor: default; }

.add-bookmark-section { margin-bottom: 12px; }
.add-bookmark-section .form-row { display: flex; gap: 8px; margin-bottom: 8px; position: relative; }
.add-bookmark-section input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none;
}
.add-bookmark-section input:focus { border-color: var(--primary); }

/* ── Map ─────────────────────────────────────────────────── */
#map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

.amap-copyright { bottom: 4px !important; }
.amap-logo { margin-bottom: 0 !important; }
.amap-scalecontrol { bottom: 30px !important; }

.map-controls-right {
  position: absolute; right: 16px; top: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.map-ctrl-btn {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.15); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: background .15s, box-shadow .15s; position: relative;
}
.map-ctrl-btn:hover { background: #f0f5ff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.map-ctrl-btn.active { background: var(--primary); color: #fff; }
.map-ctrl-btn .ctrl-tooltip {
  display: none; position: absolute; top: 50%; transform: translateY(-50%);
  background: #333; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
}
.map-controls-right .map-ctrl-btn .ctrl-tooltip { right: 44px; }
.map-ctrl-btn:hover .ctrl-tooltip { display: block; }
.map-style-group { display: flex; flex-direction: column; }
.map-style-group .map-ctrl-btn { border-radius: 0; border-bottom: 1px solid #eee; }
.map-style-group .map-ctrl-btn:first-child { border-radius: 8px 8px 0 0; }
.map-style-group .map-ctrl-btn:last-child { border-radius: 0 0 8px 8px; border-bottom: none; }
#map-container > .mobile-settings-btn {
  display: flex; position: absolute; right: 16px; bottom: 16px; z-index: 200;
}

/* ── InfoWindow ──────────────────────────────────────────── */
.info-bubble {
  background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.25);
  padding: 12px; position: relative;
}
.info-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 8px solid transparent;
  border-right: 8px solid transparent; border-top: 8px solid #fff;
}
.custom-info-window { width: 300px; }
.custom-info-window h4 { font-size: 14px; margin-bottom: 6px; }
.custom-info-window .ciw-addr { font-size: 12px; color: #888; margin-bottom: 8px; }
.custom-info-window textarea {
  width: 100%; min-height: 60px; padding: 6px; border: 1px solid #ddd; border-radius: 4px;
  font-size: 12px; resize: vertical; outline: none; font-family: inherit;
}
.custom-info-window textarea:focus { border-color: var(--primary); }
.ciw-map-click { min-width: 180px; }
.ciw-map-click h4 { margin-bottom: 4px; }
.ciw-map-click .ciw-addr { margin-bottom: 10px; }
.ciw-map-click .ciw-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.day-picker-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  cursor: pointer; font-size: 14px; transition: all .15s;
}
.day-picker-item:hover { border-color: var(--primary); background: #f0f5ff; }

/* ── Settings Modal ──────────────────────────────────────── */
.settings-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.35); z-index: 5000; display: none;
  align-items: center; justify-content: center;
}
.settings-overlay.show { display: flex; }
.settings-modal {
  background: var(--card); border-radius: 12px; padding: 24px; width: 440px;
  max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.2); position: relative;
}
.settings-modal h2 { font-size: 17px; margin-bottom: 16px; font-weight: 600; }
.settings-modal .close-settings {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 20px; cursor: pointer; color: #aaa; padding: 4px;
}
.settings-modal .close-settings:hover { color: #333; }
.setting-group { margin-bottom: 16px; }
.setting-group label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 6px; }
.setting-group input[type="text"], .setting-group input[type="date"], .setting-group input[type="number"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none;
}
.setting-group input:focus { border-color: var(--primary); }
.setting-group .hint { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.setting-toggle { display: flex; align-items: center; gap: 8px; }
.setting-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ── Note Editor Modal ───────────────────────────────────── */
.note-editor-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4); z-index: 6000; display: none;
  align-items: center; justify-content: center;
}
.note-editor-overlay.show { display: flex; }
.note-editor-modal {
  background: var(--card); border-radius: 12px; width: 640px; max-width: 90vw;
  max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.2);
  overflow: visible;
}
.note-editor-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  border-radius: 12px 12px 0 0;
}
.note-editor-header h3 { font-size: 16px; font-weight: 600; }
.note-editor-body { flex: 1; overflow: visible; display: flex; flex-direction: column; position: relative; }
.note-editor-body .ql-toolbar { flex-shrink: 0; }
.note-editor-body .ql-container { flex: 1; overflow-y: auto; font-size: 14px; overflow-x: visible; }
.note-editor-body .ql-editor { min-height: 200px; }
.ql-tooltip { z-index: 6200 !important; }
.note-editor-footer {
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--card);
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
  border-radius: 0 0 12px 12px;
}
.note-viewer-body {
  flex: 1; overflow-y: auto; padding: 20px; font-size: 14px; line-height: 1.8;
  background: var(--card);
}
.note-viewer-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.note-viewer-body a { color: var(--primary); }
.note-viewer-body:empty::before { content: '暂无备注内容'; color: #ccc; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── Plan Selector ──────────────────────────────────────── */
.plan-selector-panel { padding: 12px; overflow-y: auto; flex: 1; }
.ps-section { margin-bottom: 16px; }
.ps-section-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.ps-empty { text-align: center; color: var(--text-secondary); padding: 16px 20px; font-size: 14px; }
.ps-api-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #fafafa; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background .15s;
}
.ps-api-header:hover { background: #f0f5ff; }
.ps-api-toggle { font-size: 10px; color: var(--text-secondary); }
.ps-api-body {
  padding: 12px; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); background: #fff;
}

.plan-card {
  display: flex; align-items: center; padding: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.plan-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(22,119,255,.12); }
.plan-card-main { flex: 1; min-width: 0; }
.plan-card-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-card-meta {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary);
  margin-top: 4px; flex-wrap: wrap;
}
.plan-card-meta .meta-dot { color: #ddd; }
.plan-card-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: 8px; }

/* ── Route Search ────────────────────────────────────── */
.rs-header { margin-bottom: 12px; }
.rs-header .rs-day-info {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.rs-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.rs-search-row input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none;
}
.rs-search-row input:focus { border-color: var(--primary); }
.rs-search-row input:disabled { background: #f5f5f5; color: #bbb; cursor: not-allowed; }
.rs-search-row button:disabled { opacity: .5; cursor: not-allowed; }
.rs-progress { margin-bottom: 10px; }
.rs-progress-bar {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.rs-progress-fill {
  height: 100%; background: var(--primary); border-radius: 2px;
  transition: width .2s ease;
}
.rs-progress-text { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.rs-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rs-result-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; background: #fafafa;
}
.rs-result-info { flex: 1; min-width: 0; }
.rs-result-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-result-addr { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-result-type { font-size: 10px; color: var(--primary); margin-top: 2px; }
.rs-cache-item {
  display: flex; align-items: center; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  cursor: pointer; transition: all .15s; background: var(--card); box-shadow: var(--shadow);
}
.rs-cache-item:hover { border-color: var(--primary); background: #f0f5ff; }
.rs-cache-info { flex: 1; min-width: 0; }
.rs-cache-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-cache-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.rs-cache-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: 8px; }
.rs-empty { text-align: center; color: var(--text-secondary); padding: 30px 20px; font-size: 13px; }
.rs-day-selector { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.rs-day-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 14px;
  font-size: 12px; cursor: pointer; border: 1px solid var(--border); background: #fafafa;
  color: var(--text-secondary); transition: all .15s; user-select: none; white-space: nowrap;
}
.rs-day-pill:hover { border-color: var(--primary); color: var(--primary); }
.rs-day-pill.active { color: #fff; }
.setting-radio { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.setting-radio input[type="radio"] { accent-color: var(--primary); }

/* ── Exit Plan Button ──────────────────────────────────── */
.exit-plan-btn { font-size: 20px; margin-right: 8px; }
.exit-plan-mobile {
  position: absolute; left: 16px; top: 16px; z-index: 200;
}

/* ── Scrollbar ───────────────────────────────────────────── */
#sidebar-content::-webkit-scrollbar { width: 6px; }
#sidebar-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ── Mobile Drawer ───────────────────────────────────────── */
@media (max-width: 768px) {
  html { height: -webkit-fill-available; touch-action: manipulation; }
  body {
    flex-direction: column; min-height: -webkit-fill-available;
    position: fixed; inset: 0; height: 100%;
    touch-action: manipulation; overscroll-behavior: none;
  }
  #sidebar-toggle { display: none; }
  #map-container { flex: 1; order: 1; height: auto !important; position: relative; z-index: 1; min-height: 0; }
  #sidebar {
    width: 100% !important; min-width: unset !important;
    height: 33dvh; height: 33vh;
    border-right: none; border-top: none;
    order: 2; transition: height .25s ease;
    position: relative; z-index: 10;
    background: transparent;
    margin-top: -36px;
  }
  #sidebar.collapsed { height: 0 !important; margin-top: 0; }
  #sidebar.drawer-collapsed { height: 78px; overflow: hidden; }
  #sidebar.drawer-third { height: 33dvh; height: 33vh; }
  #sidebar.drawer-full { height: 100dvh; height: 100vh; }
  #sidebar-tabs {
    touch-action: none;
    background: var(--card);
    border-top: 1px solid var(--border);
  }
  #sidebar-content { background: var(--card); }
  .plan-selector-panel { padding-top: 8px; background: var(--card); }
  .drawer-handle {
    display: flex; align-items: flex-end; justify-content: center;
    height: 36px; cursor: pointer; flex-shrink: 0;
    touch-action: none;
    background: transparent;
    padding-bottom: 6px;
  }
  .drawer-handle .handle-bar {
    width: 40px; height: 4px; background: rgba(160,160,160,.7); border-radius: 2px;
  }
  .drawer-handle:hover .handle-bar { background: var(--primary); }
  #sidebar-header { display: none; }
  .custom-info-window { width: 60vw; }
  .note-editor-overlay.show { align-items: stretch; justify-content: stretch; }
  .note-editor-modal {
    width: 100% !important; max-width: 100% !important;
    height: 100% !important; max-height: 100% !important;
    border-radius: 0 !important; overflow: hidden !important;
  }
  .note-editor-body { overflow: hidden !important; }
  .note-editor-body .ql-container { overflow-y: auto !important; }
}
@media (min-width: 769px) {
  .drawer-handle { display: none; }
  .exit-plan-mobile { display: none !important; }
}
