body {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  margin: 1rem auto;
  max-width: 900px;
  padding: 0 1rem;
}

.videos-page {
  max-width: 1000px;
}

form {
  margin-bottom: 1rem;
}

input,
select,
button {
  margin: 0.2rem;
}

code {
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
}

.card,
.filtersorts-page li,
.video-list > li {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.notice {
  background: #fff7d8;
  border-radius: 6px;
  margin-bottom: 1rem;
  padding: 0.7rem;
}

.video-list {
  list-style: none;
  padding: 0;
}

.video-list > li {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
}

.video-thumbnail {
  border-radius: 6px;
  display: block;
  height: auto;
  width: 180px;
}

.video-details {
  flex: 1;
  min-width: 0;
}

.video-details h3 {
  margin: 0 0 1em;
}

.channel-thumbnail {
  border-radius: 50%;
  height: 28px;
  object-fit: cover;
  vertical-align: middle;
  width: 28px;
}

.meta {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.channel-menu,
.subscription-menu {
  position: relative;
}

.channel-menu {
  display: inline-block;
}

.channel-menu summary,
.subscription-menu summary {
  cursor: pointer;
  list-style: none;
}

.channel-menu summary {
  display: inline;
}

.channel-menu summary::-webkit-details-marker,
.subscription-menu summary::-webkit-details-marker {
  display: none;
}

.channel-menu [role="menu"],
.subscription-menu [role="menu"] {
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px #0002;
  padding: 0.3rem;
  position: absolute;
  z-index: 1;
}

.channel-menu [role="menu"] {
  left: 0;
  top: 1.2rem;
  white-space: nowrap;
}

.channel-menu button {
  display: block;
  margin: 0;
  text-align: left;
  width: 100%;
}

.video-list-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.subscription-menu summary::after {
  content: " ▾";
}

.subscription-menu [role="menu"] {
  max-height: 24rem;
  min-width: 18rem;
  overflow-y: auto;
  padding: 0.4rem;
  right: 0;
  top: 2.2rem;
  z-index: 2;
}

.subscription-entry {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem;
}

.subscription-entry:hover {
  background: #f4f4f4;
}

.video-description {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.video-description-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-description[data-expanded="true"] .video-description-text {
  display: block;
  grid-column: 1 / -1;
}

.description-toggle {
  background: none;
  border: 0;
  color: #06c;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.sync-page ul {
  padding-left: 1.2rem;
}

@media (max-width: 600px) {
  .video-list > li {
    display: block;
  }

  .video-thumbnail {
    margin-bottom: 1rem;
    width: 100%;
  }
}
