.lyrics-history-shell {
  max-width: 1380px;
}

.lyrics-history-workspace {
  display: grid;
  gap: 18px;
}

.lyrics-history-filter-panel,
.lyrics-history-list-panel,
.lyrics-history-restore-panel {
  background: rgba(8, 25, 36, 0.88);
}

.lyrics-history-panel-head {
  align-items: center;
}

.lyrics-history-count {
  min-width: 44px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(104, 213, 255, 0.13);
  color: #bcecff;
  font-weight: 800;
  text-align: center;
}

.lyrics-history-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.lyrics-history-filter-field {
  grid-column: span 2;
}

.lyrics-history-range-field {
  grid-column: span 3;
  min-width: 0;
}

.lyrics-history-date-time-input-shell {
  position: relative;
  display: block;
}

.lyrics-history-date-time-input-shell input {
  min-height: 44px;
  padding-right: 44px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.lyrics-history-date-time-input-shell input[readonly] {
  color: #edf8f6;
}

.lyrics-history-date-time-input-shell svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  stroke: #9eb7ba;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transform: translateY(-50%);
}

.lyrics-history-date-time-input-shell:focus-within svg {
  stroke: #bcecff;
}

.lyrics-history-date-time-popover {
  position: fixed;
  inset: auto;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(104, 213, 255, 0.38);
  border-radius: 12px;
  background: #081924;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.34);
  color: #edf8f6;
}

.lyrics-history-date-time-popover[hidden] {
  display: none;
}

.lyrics-history-date-time-popover.is-fallback-open {
  display: block;
}

.lyrics-history-picker-head,
.lyrics-history-calendar-toolbar,
.lyrics-history-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lyrics-history-picker-head h3 {
  margin: 0;
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-size: 1.125rem;
  line-height: 1.25;
}

.lyrics-history-picker-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #d8f5ff;
  font-size: 1.5rem;
  line-height: 1;
}

.lyrics-history-picker-icon-btn:hover,
.lyrics-history-picker-icon-btn:focus-visible {
  border-color: rgba(104, 213, 255, 0.58);
  background: rgba(104, 213, 255, 0.12);
}

.lyrics-history-picker-endpoints {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.lyrics-history-picker-endpoint {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(3, 12, 17, 0.46);
  color: #edf8f6;
  text-align: left;
}

.lyrics-history-picker-endpoint[aria-pressed="true"] {
  border-color: rgba(104, 213, 255, 0.68);
  background: rgba(104, 213, 255, 0.12);
}

.lyrics-history-picker-endpoint span {
  color: #9eb7ba;
  font-size: 0.875rem;
  font-weight: 800;
}

.lyrics-history-picker-endpoint strong {
  overflow: hidden;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyrics-history-picker-arrow {
  color: #9eb7ba;
}

.lyrics-history-calendar-toolbar {
  margin-top: 16px;
}

.lyrics-history-calendar-toolbar p {
  margin: 0;
  color: #9eb7ba;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

.lyrics-history-calendar-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.lyrics-history-calendar-month h4 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  line-height: 1.25;
  text-align: center;
}

.lyrics-history-calendar-weekdays,
.lyrics-history-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.lyrics-history-calendar-weekdays span {
  display: grid;
  place-items: center;
  min-height: 32px;
  color: #9eb7ba;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
}

.lyrics-history-calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #edf8f6;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lyrics-history-calendar-day:hover,
.lyrics-history-calendar-day:focus-visible {
  background: rgba(104, 213, 255, 0.13);
  outline: 2px solid rgba(104, 213, 255, 0.62);
  outline-offset: -2px;
}

.lyrics-history-calendar-day.is-inside {
  border-radius: 4px;
  background: rgba(104, 213, 255, 0.12);
  color: #d8f5ff;
}

.lyrics-history-calendar-day.is-start,
.lyrics-history-calendar-day.is-end,
.lyrics-history-calendar-day.is-start-end {
  background: #68d5ff;
  color: #06131c;
  font-weight: 800;
}

.lyrics-history-calendar-day[aria-current="date"]::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(50%);
}

.lyrics-history-calendar-day:disabled {
  cursor: default;
  opacity: 0.28;
}

.lyrics-history-picker-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-history-picker-times input {
  min-height: 44px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lyrics-history-picker-error {
  margin: 12px 0 0;
  color: #ffb6b2;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
}

.lyrics-history-picker-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.lyrics-history-quick-ranges {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  min-width: 0;
}

.lyrics-history-quick-ranges > span {
  flex: 0 0 auto;
  color: rgba(225, 236, 242, 0.78);
  font-size: 0.84rem;
  font-weight: 700;
}

.lyrics-history-quick-range-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lyrics-history-quick-range-buttons .ghost-btn {
  min-height: 40px;
  padding: 8px 12px;
}

.lyrics-history-quick-range-buttons .ghost-btn.is-active {
  border-color: rgba(104, 213, 255, 0.62);
  background: rgba(104, 213, 255, 0.13);
  color: #d8f5ff;
}

.lyrics-history-filter-actions {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.lyrics-history-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.lyrics-history-selection-bar > div {
  display: grid;
  gap: 3px;
}

.lyrics-history-selection-bar span {
  color: rgba(225, 236, 242, 0.74);
  font-size: 0.9rem;
}

.lyrics-history-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.lyrics-history-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.lyrics-history-table th,
.lyrics-history-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.lyrics-history-table th {
  color: rgba(225, 236, 242, 0.82);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lyrics-history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lyrics-history-table tbody tr.is-selected {
  background: rgba(104, 213, 255, 0.09);
}

.lyrics-history-check-cell {
  width: 44px;
  text-align: center !important;
}

.lyrics-history-check-cell input {
  width: 18px;
  height: 18px;
}

.lyrics-history-actor,
.lyrics-history-song {
  display: grid;
  gap: 3px;
}

.lyrics-history-actor span,
.lyrics-history-song span,
.lyrics-history-time-secondary {
  color: rgba(225, 236, 242, 0.68);
  font-size: 0.82rem;
}

.lyrics-history-action-badge,
.lyrics-history-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(104, 213, 255, 0.12);
  color: #bcecff;
  font-weight: 800;
  font-size: 0.78rem;
}

.lyrics-history-state-badge.is-conflict {
  background: rgba(255, 129, 125, 0.13);
  color: #ffb6b2;
}

.lyrics-history-state-badge.is-ready {
  background: rgba(117, 225, 168, 0.13);
  color: #aef0ca;
}

.lyrics-history-diff {
  margin: 0;
}

.lyrics-history-diff summary {
  cursor: pointer;
  color: #bcecff;
  font-weight: 700;
}

.lyrics-history-diff pre {
  max-width: 560px;
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #06131c;
  color: #dbe8ee;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.lyrics-history-restore-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.lyrics-history-restore-summary span {
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 700;
}

.lyrics-history-restore-items {
  display: grid;
  gap: 8px;
}

.lyrics-history-restore-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.lyrics-history-restore-item strong,
.lyrics-history-restore-item span {
  display: block;
}

.lyrics-history-restore-item span {
  margin-top: 3px;
  color: rgba(225, 236, 242, 0.7);
  font-size: 0.85rem;
}

.lyrics-history-reason-field {
  margin-top: 18px;
}

.lyrics-history-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.lyrics-history-confirm-row .panel-copy {
  margin: 0;
}

@media (max-width: 1050px) {
  .lyrics-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lyrics-history-filter-field,
  .lyrics-history-range-field {
    grid-column: span 1;
  }

  .lyrics-history-action-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .lyrics-history-filters {
    grid-template-columns: 1fr;
  }

  .lyrics-history-action-field {
    grid-column: span 1;
  }

  .lyrics-history-date-time-popover {
    inset: auto 0 0 0;
    width: 100%;
    max-height: min(88vh, 760px);
    padding: 16px;
    border-radius: 12px 12px 0 0;
  }

  .lyrics-history-calendar-months {
    grid-template-columns: 1fr;
  }

  .lyrics-history-calendar-month:nth-child(2) {
    display: none;
  }

  .lyrics-history-picker-endpoints {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .lyrics-history-picker-arrow {
    display: none;
  }

  .lyrics-history-quick-ranges {
    align-items: stretch;
    flex-direction: column;
  }

  .lyrics-history-quick-range-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lyrics-history-quick-range-buttons .ghost-btn {
    width: 100%;
  }

  .lyrics-history-selection-bar,
  .lyrics-history-confirm-row {
    align-items: stretch;
    flex-direction: column;
  }

  .lyrics-history-filter-actions {
    justify-content: stretch;
  }

  .lyrics-history-filter-actions button,
  .lyrics-history-selection-bar button,
  .lyrics-history-confirm-row button {
    width: 100%;
  }

  .lyrics-history-picker-actions button {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
