/* Station Logbook Drawer */
.logbook-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
}

.logbook-drawer.open {
  pointer-events: auto;
  visibility: visible;
}

.logbook-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.72);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.logbook-drawer.open .logbook-backdrop {
  opacity: 1;
}

.logbook-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  height: 100dvh;
  background: #1a1613;
  border-left: 2px solid #4a3b2c;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overscroll-behavior: contain;
}

.logbook-drawer.open .logbook-sheet {
  transform: translateX(0);
}

.logbook-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #3a2e22;
}

.logbook-subtitle {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #9b8c78;
}

.logbook-header h2 {
  font-size: 1.05rem;
  color: #d9a441;
  margin: 0.15rem 0;
}

.logbook-range {
  font-size: 0.72rem;
  color: #8f8474;
}

.close-drawer-btn {
  padding: 0.2rem 0.6rem;
  font-size: 1.2rem;
  line-height: 1;
}

.logbook-controls {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #3a2e22;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  background: #0d0b09;
  color: #f3e9d2;
  border: 1px solid #4a3b2c;
  border-radius: 4px;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
}

.search-box input:focus {
  outline: none;
  border-color: #d9a441;
}

.clear-search-btn {
  position: absolute;
  right: 0.35rem;
  background: transparent;
  border: none;
  color: #b59e7a;
  padding: 0.1rem 0.35rem;
  font-size: 1rem;
}

.clear-search-btn:hover {
  background: transparent;
  color: #f3e9d2;
}

.category-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.filter-pill {
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}

.filter-pill.active {
  background: #d9a441;
  color: #141210;
  border-color: #d9a441;
  font-weight: 700;
}

.logbook-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.station-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: #2e261f;
  color: #f3e9d2;
  border: 1px solid #5c4936;
  border-radius: 4px;
  cursor: pointer;
}

.station-card:hover {
  background: #3d3228;
}

.station-card.active-tuning {
  border-color: #d9a441;
  background: #2b2218;
}

.card-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-name {
  font-size: 0.88rem;
  color: #f3e9d2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-cat {
  font-size: 0.74rem;
  color: #9b8c78;
}

.card-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  color: #8f8474;
  background: #231d17;
  border: 1px solid #4a3b2c;
  transition: transform 0.12s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.card-fav:hover {
  border-color: #d9a441;
  color: #ffb84d;
}

.card-fav:active {
  transform: scale(0.92);
}

.card-fav svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.card-fav.is-fav {
  color: #141210;
  background: #d9a441;
  border-color: #ffb84d;
}

.card-fav.is-fav svg {
  fill: currentColor;
}

.card-freq {
  font-size: 0.82rem;
  color: #ffb84d;
  font-weight: 700;
}

.card-format {
  font-size: 0.68rem;
  color: #8f8474;
}

.logbook-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #9b8c78;
  font-size: 0.85rem;
}

.logbook-footer {
  padding: 0.65rem 1.15rem;
  border-top: 1px solid #3a2e22;
  font-size: 0.72rem;
  color: #8f8474;
}

@media (max-width: 560px) {
  .logbook-sheet {
    width: 100vw;
    border-left: none;
  }

  .logbook-header,
  .logbook-controls,
  .logbook-list,
  .logbook-footer {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .search-box input {
    font-size: 1rem;
  }

  .category-filters {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-filters::-webkit-scrollbar {
    display: none;
  }

  .logbook-list {
    -webkit-overflow-scrolling: touch;
  }

  .station-card {
    padding: 0.6rem 0.65rem;
  }
}
