::selection {
  background-color: #fff666;
  color: #333;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #222;
  color: #ddd;
  font-family: sans-serif;
  filter: sepia(.6) hue-rotate(180deg);
  text-rendering: geometricprecision;
  background: radial-gradient(#2d2d2d, #181818);
}

html {
  background: #2f3237;
}

#page {
  min-height: 100vh;
  max-width: 50em;
  margin: 0 auto;
  padding: 0 2em;
  background: #333;
  position: relative;
}

#appMessages {
  position: fixed;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #222;
  font-size: 0.95rem;
  color: #777;
}

.toast button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #7a5cff, #ff7a18);
  color: #fff;
  cursor: pointer;
}

.toast button:hover,
.toast button:focus {
  filter: brightness(1.1);
}

#header {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 1em 0;
  margin-bottom: 0.5em;
  background: #333;
}

#headerControls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: .25rem;
}

#title {
  margin: 0 0 1em 0;
  letter-spacing: 3px;
  color: #202020;
}

#controls {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  display: none;
}

#audioPlayer {
  width: 100%;
}

#dropOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #444c;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 9999;
}

#dropOverlay.active {
  display: flex;
}

#playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-bottom: 2em;
}

#playlistMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  border-bottom: 1px solid #7771;
}

#playlistTotal {
  margin: 0 0.5em;
  color: #666;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

#closeAllTracksBtn {
  display: block;
  padding: .15rem 0 0;
  width: 30px;
  height: 28px;
  border-radius: 50% 50% 0 0;
  background: #7771;
  position: relative;
  font-size: 18px;
  line-height: 26px;
}
}

#closeAllTracksBtn.confirming {
  background: #222 !important;
  color: #eee !important;
}

.trackItem {
  cursor: default;
  background: #3b3b3b;
  display: flex;
  align-items: center;
  position: relative;
}

.trackName {
  line-break: anywhere;
}


.trackItem[draggable="false"]:hover .closeTrackButton {
  display: none;
}

.highlight .trackPlayBtn {
  color: #ddd !important;
  background: #1e1e1e !important;
}

.trackItem:nth-child(even) {
  background-color: #373737;
}

/*.trackItem button {
  height: 30px;
}*/
.trackItem:hover {
  background: #ffffff1a;
}

.trackItem:hover button {
  color: #222;
}

.trackLine {
  display: flex;
  align-items: stretch;
  flex: auto;
}

.trackPlayBtn {
  padding: 0;
  width: 45px;
  box-sizing: border-box;
  margin-right: 0.1em;
  background: none;
  border: 0;
  color: transparent;
  font-size: 16pt;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s, filter 0.1s;
  border-radius: 0;
  flex-shrink: 0;
}

/*.trackPlayBtn:hover {
  background: #eee;
  color: #333;
}*/
.trackPlayBtn.active {
  background: #ddd;
  color: #ddd;
}

.trackPlayBtn.hide {
  display: none !important;
}

.trackInfo {
  flex: 0 10 auto;
  flex: 1 2 auto;
  padding: 4px 10px 6px 10px;
}

/*.trackName {
  flex: 0 10 auto;
  padding: 5px 10px;
}*/
.trackDuration {
  margin-left: 10px;
  font-size: .8em;
  color: #888;
}

.noteSummary {
  flex: 1;
  flex: 0 0 auto;
  color: #6a6a6a;
  font-size: .8em;
  font-weight: normal;
  cursor: default;
  /*text-align: right;*/
  margin: 0 .5em 0 0;
  display: flex;
  align-items: center;
  line-height: 1em;
}

.noteSummary[contenteditable='true'] {
  border: 0;
  outline: 0;
  background: #aaaaaa;
  color: #444;
  padding: 7px 6px;
  border-radius: 1px;
  font-weight: normal;
  cursor: text;
  margin: 0 2px;
  white-space: pre-wrap;
  text-align: left;
  flex: 10 1 auto;
}

.date {
  color: #fff2;
  font-size: 0.7em;
  margin: 0 0.5em 0 0;
  display: flex;
  align-items: center;
  letter-spacing: -.04em;
}

.highlight .date {
  color: #0004;
}

.closeTrackButton {
  padding: 0;
  width: 30px;
  border: 0;
  color: #666;
  border-radius: 0;
  background: #0002;
  cursor: pointer;
  font-weight: bold;
  font-size: 22px;
  transform: scaleX(-1);
  display: none;

  position: absolute;
  right: 0;
  height: 100%;
  background-color: #555;
}

.trackItem.highlight .closeTrackButton {
  background-color: #bbb;
}

.trackItem:hover .closeTrackButton {
  display: flex;
}

.closeTrackButton.confirming {
  background: #222 !important;
  color: #eee !important;
}

.highlight {
  font-weight: bold;
  background: #ccc !important;
  color: #444 !important;
}

button {
  cursor: pointer;
  padding: 5px 10px;
  background: #ddd1;
  color: #ddd;
  border: 0;
  border-radius: 3px;
  user-select: none;
}

.highlight button:hover {
  background: #888;
  color: #222
}

button:hover {
  /*background: #555;*/
  /*opacity: 0.6;*/
  filter: brightness(1.2);
}

button.active {
  background: #222;
}


#headerControls>div>button {
  width: 2rem;
  height: 2rem;
  display: grid;
  align-content: center;
  justify-content: center;
}


#menu {
  padding: 1.5em 0 1em 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  position: relative;
}

#menuToggleBtn {
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#menuToggleBtn.modified {
  background: #ddd;
  color: #333;
}


#menuToggleBtn:active {
  translate: 2px 2px;
}

.menu-dropdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0;
  background: #444;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 0 15px 2px #0003;
  min-width: 14rem;
  z-index: 99999;
  top: -5px;
  position: relative;
}

.menu-dropdown button.active {
  background: #ddd;
  color: #222;
}

.menu-dropdown button {
  width: 100%;
  text-align: left;
  border-radius: 1px;
  background: #373737;
  color: #fff;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 500;
}

#searchContainer {
  padding: 1.5em 0 1em 0;
  display: flex;
  align-items: center;
}

#searchToggleBtn {
  padding: 0.45rem 0.65rem;
  font-size: 1rem;
  line-height: 1;
}

#searchContainer.open #searchToggleBtn {
  filter: invert(1);
  background: #222;
}

#searchInput {
  width: 0;
  height: 2rem;
  opacity: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ddd;
  border-radius: 0 4px 4px 0;
  transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease, border 0.2s ease;
  pointer-events: none;
}

#searchContainer.open #searchInput {
  width: 12rem;
  opacity: 1;
  padding: 0.35rem 0.75rem;
  border: 0px solid #555;
  background: #222;
  pointer-events: auto;
  outline: 0;
}

#searchInput:focus {
  outline: 1px solid #777;
}

/* Disable text selection during drag */
.noselect,
.noselect * {
  user-select: none !important;
}

/* Drag & drop reordering visuals */
.trackItem.dragging {
  opacity: 0.5;
}

.trackItem.drag-over {
  background: #555 !important;
}


.drag-insert-line {
  position: relative;
  height: 4px;
  background: #aaa;
  pointer-events: none;
  margin: -2px 0;
  z-index: 100;
}

.empty-message {
  text-align: center;
  color: #888;
  margin: 0em 0 4em 0;
}

.empty-message.hidden {
  display: none;
}

.hidden {
  display: none;
}

#allNotes {
  margin-top: 1em;
  font-size: 0.9em;
}

#allNotes div {
  margin-bottom: 0.3em;
}

#allNotes strong {
  color: #777;
}

#allNotes span {
  color: #ccc;
}

/*<div class="drag-insert-line"></div>*/

#playlist button {
  font-size: 18px;
  line-height: 28px;
  /*display: flex;*/
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#playlist {
  line-height: 20px;
}

.trackInfo {
  padding: 4px 10px;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  margin-right: -3px;
  background: url("data:image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'> <path d='M2 2 L8 8 M8 2 L2 8' stroke='%23fff5' stroke-width='1.0' stroke-linecap='round'/> </svg>") no-repeat center;
  cursor: pointer;
}