.youtube-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 9px;
  scrollbar-width: none;
}

.youtube-tabs::-webkit-scrollbar {
  display: none;
}

.youtube-tabs button,
.youtube-actions button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-text);
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.youtube-tabs button.active,
.youtube-actions button {
  border-color: var(--primary);
  background: var(--button);
  color: var(--primary-text);
}

.youtube-list {
  display: grid;
  gap: 2px;
  overflow: hidden;
  transition: max-height 420ms ease;
}

.youtube-item {
  border-bottom: 1px dashed var(--border);
}

.youtube-item.is-new {
  animation: youtubeItemSlideIn 420ms ease both;
}

.youtube-item-head {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.youtube-item.no-thumb .youtube-item-head {
  grid-template-columns: minmax(0, 1fr);
}

.youtube-item-head img {
  width: 116px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgb(15 23 42 / 9%);
}

.youtube-item-head span {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  padding-right: 4px;
}

.youtube-item-head strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.youtube-item-head small {
  color: var(--muted-text);
  font-size: 12px;
}

.youtube-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.youtube-actions button {
  min-height: 40px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.youtube-actions.is-expanded {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.youtube-frame-wrap {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  margin: 14px 0 0;
  border-radius: 0;
  background: var(--header);
  aspect-ratio: 16 / 9;
}

.youtube-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.notice-modal.youtube-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 80vh;
  max-height: 80vh;
  padding: 0 0 16px;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}

.youtube-modal .modal-head {
  align-items: flex-start;
  flex: 0 0 auto;
  padding: 16px 16px 0;
}

.youtube-modal .modal-head h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.youtube-modal .modal-head p {
  color: var(--muted-text);
  font-size: 11px;
}

.youtube-modal .notice-modal-body {
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 14px 16px 0;
  font-size: 13px;
  line-height: 1.6;
}

.youtube-modal-backdrop {
  align-items: end;
  justify-items: stretch;
  padding: 20vh 0 0;
}

.youtube-modal-backdrop:not([hidden]) .youtube-modal {
  animation: youtubeSheetUp 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes youtubeItemSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 420px) {
  .youtube-tabs button,
  .youtube-actions button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .youtube-item-head {
    gap: 10px;
    padding: 10px 0;
  }

  .youtube-item-head strong {
    font-size: 13px;
  }

  .youtube-item-head small {
    font-size: 12px;
  }

  .youtube-item .youtube-item-head {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .youtube-item-head img {
    width: 96px;
  }
}

@media (max-width: 340px) {
  .youtube-item .youtube-item-head {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .youtube-item-head img {
    width: 82px;
    border-radius: 8px;
  }
}
