.panel {
  width: 300px;
  height: 100%;
  background-color: var(--bg-roll-log);
  background-image: var(--texture-surface);
  background-size: 256px 256px;
  background-repeat: repeat;
  border-left: 2px solid rgba(var(--gold-rgb), 0.2);
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
  flex-shrink: 0;
  z-index: 150;
  position: relative;
  box-shadow: -4px 0 16px rgba(var(--shadow-rgb), 0.3);
}

.panel.collapsed {
  width: 40px;
  cursor: pointer;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.15);
}

.title {
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.3);
}

.headerBtns {
  display: flex;
  gap: 0.3rem;
}

.collapseBtn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.collapseBtn:hover {
  color: var(--gold);
}

.mobileOnly {
  display: none;
}

.desktopOnly {
  display: inline-flex;
}

.collapsedContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
  gap: 0.5rem;
}

.collapsedIcon {
  font-size: 1.2rem;
  cursor: pointer;
}

.collapsedLast {
  writing-mode: vertical-rl;
  font-size: 0.7rem;
  color: var(--text-secondary);
  max-height: 100px;
  overflow: hidden;
}

.inputArea {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.15);
}

.input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-inset);
  border: 1px solid rgba(var(--gold-rgb), 0.15);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: "Alegreya", Georgia, serif;
}

.input:focus {
  outline: none;
  border-color: var(--gold);
}

.hint {
  font-size: 0.6rem;
  color: var(--text-faint);
  margin-top: 0.25rem;
  text-align: center;
}

.entries {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--gold-rgb), 0.15) transparent;
}

.entries::-webkit-scrollbar {
  width: 4px;
}

.entries::-webkit-scrollbar-thumb {
  background: rgba(var(--gold-rgb), 0.15);
  border-radius: 2px;
}

.empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  font-style: italic;
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .panel {
    width: 100%;
    height: 200px;
    border-left: none;
    border-top: 2px solid rgba(var(--gold-rgb), 0.2);
    transition: height 0.25s ease;
  }

  /* Peek: header + input + one roll visible */
  .panel:not(.mobileHidden):not(.mobileOpen) {
    height: 200px;
  }

  /* Hidden: just the header bar */
  .panel.mobileHidden {
    height: 36px;
    overflow: hidden;
  }

  /* Open: half the viewport */
  .panel.mobileOpen {
    height: 50vh;
  }

  .panel.collapsed {
    width: 100%;
    height: 36px;
  }

  .collapsedContent {
    flex-direction: row;
    padding: 0.4rem 0.75rem;
  }

  .collapsedLast {
    writing-mode: horizontal-tb;
    max-height: none;
  }

  .mobileOnly {
    display: inline-flex;
  }

  .desktopOnly {
    display: none;
  }
}
