.calendar-help {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.65;
}

.day-entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-entry {
  padding: 0;
}

.day-entry.deleting {
  animation: day-entry-delete 0.3s ease forwards;
  pointer-events: none;
}

@keyframes day-entry-delete {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}

.day-entry summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.day-entry summary::-webkit-details-marker {
  display: none;
}

.day-entry summary::before {
  content: '[-] ';
  font-weight: 400;
}

.day-entry.collapsed summary::before {
  content: '[+] ';
}

.day-entry-label {
  margin-left: 4px;
}

@media (max-width: 768px) {
  .day-entry-label {
    font-size: 0.9rem;
  }
}

/* grid-template-rows 0fr/1fr is the modern, declarative way to transition
   a block's height to/from its natural content size -- no JS
   measurement, no layout-thrashing per-frame height animation. <details>
   stays permanently open (see calendar-view.js) so content never leaves
   the render tree; this class is what actually controls visibility. */
.day-entry-body-wrapper {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;
}

.day-entry.collapsed .day-entry-body-wrapper {
  grid-template-rows: 0fr;
}

.day-entry-body {
  overflow: hidden;
  min-height: 0;
}

/* Padding lives on the content, not on .day-entry-body itself -- padding
   on the collapsing grid item can't shrink below its declared value even
   at grid-template-rows: 0fr, which left a visible sliver at rest. */
.day-entry-body > .clip-list,
.day-entry-body > .day-entry-empty {
  padding: 0 16px 16px;
}

.download-icon {
  border: none;
  background: none;
  padding: 0;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--accent);
  transition: color 0.15s ease;
}

.download-icon:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
}

.download-icon:disabled {
  opacity: 0.35;
}

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

.clip-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  cursor: pointer; /* hints double-click/double-tap to delete */
}

.clip-row:hover {
  background-color: var(--canvas-dark);
}

.clip-row.deleting {
  animation: clip-row-delete 0.3s ease forwards;
  pointer-events: none;
}

@keyframes clip-row-delete {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}

.clip-title {
  font-size: 0.8rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 76px;
  max-width: 160px;
  cursor: text;
  border-radius: var(--radius);
  padding: 2px 4px;
  margin: -2px -4px;
}

.clip-title:hover {
  opacity: 1;
  background-color: var(--canvas);
}

.clip-title.editing {
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip; /* .clip-title's ellipsis would otherwise clip live text as you type */
  scrollbar-width: none; /* text past the pinned width scrolls, not wraps -- keeps row height fixed */
  opacity: 1;
  cursor: text;
  outline: 1px solid var(--accent);
  background-color: var(--canvas);
}

.clip-title.editing::-webkit-scrollbar {
  display: none;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.play-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.play-btn:hover {
  background: none;
  color: var(--accent);
}

.audio-player.playing .play-btn {
  color: var(--accent);
}

.progress-track {
  flex: 1;
  height: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  cursor: pointer;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.player-time {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
  min-width: 78px;
  text-align: right;
  flex-shrink: 0;
}

/* Narrow phones (down to ~320px) don't have room for the full-size
   clip-row -- time label + play button + progress bar + time readout
   were overflowing the container around 334px. */
@media (max-width: 375px) {
  .clip-row {
    gap: 8px;
    padding: 8px;
  }

  .clip-title {
    font-size: 0.65rem;
    min-width: 54px;
    max-width: 96px;
  }

  .audio-player {
    gap: 6px;
  }

  .play-btn {
    font-size: 0.75rem;
  }

  .player-time {
    font-size: 0.6rem;
    min-width: 56px;
  }
}
