/* ── Todo / lists ── */
#todo-container a {
  color: var(--link);
}

#todo-container ul {
  list-style: none;
  padding: 0 2.5px;
  margin: 0;
}

#todoList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

#todo-container li {
  margin: 0.15em 0;
}

#todo-container li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


#todo-container .todo-note-title {
  display: block;
  margin: 0 2.5px 5px;
  padding: 0 0 5px;
  border-bottom: 1px solid var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#todoList > li {
  margin-bottom: 20px;
}

#preview li.task-item + li.bullet-item,
#preview li.bullet-item + li.task-item,
#todoList li.task-item + li.bullet-item,
#todoList li.bullet-item + li.task-item {
  margin-top: 8px;
}

/* ── Empty-state panel hints ── */
.panel-hint {
  color: var(--muted);
  font-size: 0.8em;
  font-style: italic;
  text-align: center;
  padding: 2em 1em;
  line-height: 1.6;
  list-style: none;
  opacity: 0.7;
}
.panel-hint code {
  font-style: normal;
  background: var(--surface, #2a2a2a);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.95em;
}

/* ── Arrow button — invisible hover zone covering entire right edge ── */
#panel-arrow {
  position: fixed;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  border-radius: 0;
  background: transparent;
  color: transparent;
  border: none;
  font-size: 0;
  line-height: 1;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 100;
}

/* Hide the arrow entirely when panel is pinned or visible */
body.panel-pinned #panel-arrow,
body.panel-visible #panel-arrow {
  display: none;
}

/* ── Panel open button — visible menu button at top-right ── */
#panel-open-btn {
  position: fixed;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--pin-color);
  cursor: pointer;
  padding: 4px;
  margin: 10px;
  border-radius: 4px;
  line-height: 0;
  z-index: 100;
}

#panel-open-btn:hover {
  color: var(--text);
  background-color: var(--surface);
}

/* Hide when panel is pinned (pin button takes over that spot) */
body.panel-pinned #panel-open-btn {
  display: none;
}

/* ════════════════════════════════════════════
   Content area — row wrapper for editor + panel
   ════════════════════════════════════════════ */

#content-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ════════════════════════════════════════════
   Editor — fills available width in content-area
   ════════════════════════════════════════════ */

#editor-section {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gap);
  box-sizing: border-box;
  position: relative;
}


/* ════════════════════════════════════════════
   Lists overlay — hidden by default,
   shown on arrow hover
   ════════════════════════════════════════════ */

#panel-lists {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: calc(100% - 20px);
  z-index: 50;
  background-color: var(--bg);
  overflow: hidden;
  padding: 10px 10px 0 0;
  margin: 10px;
  box-sizing: border-box;
  flex-direction: column;
  /* ── Floating card treatment ── */
  border-radius: 20px;
  box-shadow: -4px 0 20px var(--shadow-light);
  /* ── Animated slide ── */
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
              visibility 0.3s ease,
              box-shadow 0.3s ease,
              border-radius 0.3s ease;
  will-change: transform;
}

#panel-lists.visible {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  z-index: 101; /* above #panel-arrow (100) so the pin button receives clicks */
}

/* Pinned: stay fixed at top of viewport (same as unpinned overlay).
   z-index must exceed the macOS drag region (98) so the pin button
   receives clicks and the panel's no-drag region takes effect.
   Visually "pasted" into the app — no floating shadow or rounded corners. */
#panel-lists.pinned {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  z-index: 101;
  border-radius: 0;
  box-shadow: none;
}

/* Restore floating visuals when hovering over the pinned panel */
#panel-lists.pinned:hover {
  border-radius: 20px;
  box-shadow: -4px 0 20px var(--shadow-light);
}

/* ── Last Backed Up status — bottom-center of editor section ── */
#last-backup-status {
  grid-row: 1;
  grid-column: 1;
  font-size: 11px;
  color: var(--hr);
  text-align: center;
  padding: 1.5px 0;
  transition: opacity 1s ease;
}


/* ── Panel section headings ── */
#files-container h2,
#todo-container h2,
#schedule-container h2 {
  text-align: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 15px 10px;
}

#files-container h2:hover,
#todo-container h2:hover,
#schedule-container h2:hover {
  color: var(--panel-heading-hover);
}

/* ── Pin button ── */
#panel-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--pin-color);
  cursor: pointer;
  padding: 4px;
  margin: 0;
  border-radius: 4px;
  line-height: 0;
  z-index: 1;
}

#panel-pin:hover {
  color: var(--text);
  background-color: var(--surface);
}

#panel-pin.active {
  color: var(--pin-active);
}

#panel-pin.active svg circle {
  fill: currentColor;
}

