@font-face {
  font-family: "Manrope";
  src: url("./fonts/manrope-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
                 U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                 U+2000-206F, U+20AC, U+2122, U+2190, U+2191,
                 U+2192, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  src: url("./fonts/manrope-cyrillic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1,
                 U+2116;
}

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;

  --bg: #0b1220;
  --bg-glow:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 26%),
    radial-gradient(circle at bottom center, rgba(99, 102, 241, 0.08), transparent 28%);
  --surface: rgba(15, 23, 42, 0.88);
  --surface-strong: rgba(15, 23, 42, 0.96);
  --surface-soft: rgba(30, 41, 59, 0.76);
  --surface-soft-2: rgba(51, 65, 85, 0.42);
  --surface-elevated: rgba(17, 24, 39, 0.94);

  --text: #e5eefb;
  --muted: #93a4bd;
  --muted-2: #6b7a92;

  --link: #cfe3ff;
  --link-hover: #eef6ff;
  --heading-link: #dbeafe;
  --heading-link-hover: #f8fbff;

  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(96, 165, 250, 0.36);

  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-soft-2: rgba(96, 165, 250, 0.18);

  --ok-soft: rgba(34, 197, 94, 0.12);
  --ok-line: rgba(34, 197, 94, 0.35);
  --ok-text: #bbf7d0;

  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-line: rgba(245, 158, 11, 0.35);
  --warn-text: #fde68a;

  --err-soft: rgba(239, 68, 68, 0.12);
  --err-line: rgba(239, 68, 68, 0.35);
  --err-text: #fecaca;

  --thumb-bg: #172235;
  --mark-bg: rgba(245, 158, 11, 0.2);
  --mark-text: #fff2c6;

  --header-bg: rgba(11, 18, 32, 0.78);
  --footer-bg: rgba(11, 18, 32, 0.68);

  --search-icon: #dbeafe;

  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 22px 56px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.38);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #f5f7fb;
    --bg-glow:
      radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 34%),
      radial-gradient(circle at top right, rgba(16, 185, 129, 0.06), transparent 24%),
      radial-gradient(circle at bottom center, rgba(99, 102, 241, 0.05), transparent 28%);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-soft: rgba(241, 245, 249, 0.92);
    --surface-soft-2: rgba(226, 232, 240, 0.56);
    --surface-elevated: rgba(255, 255, 255, 0.96);

    --text: #121826;
    --muted: #5b6475;
    --muted-2: #7a8393;

    --link: #1f5bd8;
    --link-hover: #1648b3;
    --heading-link: #174bb8;
    --heading-link-hover: #123d97;

    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(31, 91, 216, 0.22);

    --accent: #2563eb;
    --accent-strong: #1f5bd8;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --accent-soft-2: rgba(37, 99, 235, 0.14);

    --ok-soft: rgba(34, 197, 94, 0.1);
    --ok-line: rgba(34, 197, 94, 0.22);
    --ok-text: #166534;

    --warn-soft: rgba(245, 158, 11, 0.12);
    --warn-line: rgba(245, 158, 11, 0.24);
    --warn-text: #92400e;

    --err-soft: rgba(239, 68, 68, 0.1);
    --err-line: rgba(239, 68, 68, 0.22);
    --err-text: #b91c1c;

    --thumb-bg: #dde4ee;
    --mark-bg: #fff1a8;
    --mark-text: #5f4300;

    --header-bg: rgba(251, 252, 254, 0.84);
    --footer-bg: rgba(255, 255, 255, 0.76);

    --search-icon: #1f2937;

    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 22px 56px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 28px 72px rgba(15, 23, 42, 0.14);
  }
}

html,
body {
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6; 
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(135deg, rgba(59, 130, 246, 0.05), transparent 32%);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .18s ease, opacity .18s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(96, 165, 250, 0.28);
  color: #f8fbff;
}

:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.12);
}

::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.24);
  border: 2px solid transparent;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.42);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-logo-picture {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.site-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 150px;
  max-height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.16));
}

.home-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 18px 104px;
}

.home-logo {
  margin-bottom: 34px;
  display: flex;
  justify-content: center;
}

.home-search {
  width: 100%;
  max-width: 760px;
}

.home-leader-note {
  margin: 12px 8px 0;
  padding: 11px 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.search-form:hover,
.search-form:focus-within {
  border-color: var(--line-strong);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.08),
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 46px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 400;
  caret-color: var(--accent);
}

.search-input::placeholder {
  color: var(--muted-2);
}

.search-button {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.12)),
    var(--surface-soft);
  text-indent: -1000em;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(96, 165, 250, 0.14),
    0 8px 20px rgba(0, 0, 0, 0.12);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background-color .16s ease;
}

.search-button::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  background-color: var(--search-icon);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.search-button:hover {
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 24px rgba(37, 99, 235, 0.18);
  filter: brightness(1.04);
}

.search-button:active {
  transform: scale(0.98);
}

.results {
  width: 100%;
  max-width: 980px;
  margin-top: 34px;
}

.results-title {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.result-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 44%);
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  background: var(--surface-strong);
}

.result-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

.result-link:hover {
  background: transparent;
  text-decoration: none;
}

.result-thumb {
  flex: 0 0 196px;
  width: 196px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--thumb-bg);
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.result-text {
  flex: 1 1 auto;
  min-width: 0;
}

.result-title-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--heading-link);
  line-height: 1.35;
  margin-bottom: 8px;
}

.result-card:hover .result-title-text {
  color: var(--heading-link-hover);
}

.result-meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0 4px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.not-found {
  margin-top: 24px;
  padding: 16px 18px;
  color: var(--err-text);
  font-size: 16px;
  text-align: center;
  background: var(--err-soft);
  border: 1px solid var(--err-line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.watch-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.watch-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 14px 22px;
  min-height: 78px;
  height: 78px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  box-sizing: border-box;
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.watch-logo {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}

.watch-search-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 720px;
  max-width: calc(100% - 360px);
  min-width: 280px;
  transform: translate(-50%, -50%);
  z-index: 2;
  margin: 0;
}

.watch-search-wrap .search-form {
  min-height: 56px;
  margin: 0;
  padding-left: 18px;
}

.yt-layout {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 22px 44px;
}

.yt-player-wrap {
  width: 100%;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(0, 0, 0, 0.32)),
    #000;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9;
  position: relative;
  border: 1px solid var(--line);
}

.yt-player,
.yt-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.yt-player video {
  display: block;
  object-fit: contain;
  background: #000;
}

.yt-info {
  position: relative;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.yt-info::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%),
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 38%);
}

.yt-info > * {
  position: relative;
  z-index: 1;
}

.yt-title-row {
  display: grid;
  grid-template-columns: minmax(44px, 52px) 1fr minmax(44px, 52px);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.yt-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.yt-nav--prev {
  justify-content: flex-start;
}

.yt-nav--next {
  justify-content: flex-end;
}

.yt-title {
  margin: 0;
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.95rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  word-break: break-word;
}

.yt-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.yt-arrow-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.08),
    var(--shadow-sm);
}

.yt-arrow-btn svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.yt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
}

.yt-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.yt-meta-item--stack {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: normal;
}

.yt-meta-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.1;
}

.yt-meta-item strong {
  color: var(--text);
  font-weight: 700;
}

.yt-meta-item--stack strong {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}

.yt-divider {
  height: 1px;
  margin: 14px 0 18px;
  background: var(--line);
  border: 0;
}

.yt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.yt-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.yt-btn--primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: rgba(96, 165, 250, 0.7);
  color: #eff6ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.yt-btn--primary:hover {
  background: linear-gradient(180deg, #4f8ff7, #2563eb);
  border-color: rgba(147, 197, 253, 0.86);
  color: #fff;
}

.yt-btn--secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.yt-btn--secondary:hover {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--line-strong);
}

.yt-btn--primary .yt-btn-meta {
  color: rgba(225, 235, 248, 0.72);
  font-size: 13px;
  font-weight: 600;
  opacity: 1;
}

.footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  backdrop-filter: blur(14px);
}

.desktop-only {
  display: block;
}

/* tag_admin.php */

.tag-admin-page {
  flex: 1;
  width: 100%;
}

.tag-admin-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.tag-admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.tag-admin-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tag-admin-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.tag-admin-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tag-admin-grid {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.tag-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 18px;
  backdrop-filter: blur(16px);
}

.tag-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%),
    linear-gradient(135deg, rgba(59, 130, 246, 0.07), transparent 42%);
}

.tag-panel > * {
  position: relative;
  z-index: 1;
}

.tag-panel--main {
  min-height: 720px;
}

.tag-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.tag-panel-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

.tag-panel-note {
  color: var(--muted);
  font-size: 13px;
}

.tag-admin-search {
  min-height: 56px;
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 980px;
  overflow: auto;
  padding-right: 2px;
}

.tag-video-card,
.tag-catalog-card,
.tag-current-card,
.tag-selected-video,
.tag-form-wrap,
.tag-current-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.tag-video-card,
.tag-catalog-card {
  display: block;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.tag-video-card:hover,
.tag-video-card.is-active,
.tag-catalog-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  background: var(--surface-strong);
}

.tag-video-id,
.tag-selected-id {
  color: var(--heading-link);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.tag-video-title,
.tag-selected-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.tag-video-date,
.tag-selected-date,
.tag-catalog-meta,
.tag-current-meta,
.tag-current-aliases,
.tag-catalog-aliases {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tag-selected-video,
.tag-form-wrap,
.tag-current-wrap {
  padding: 18px;
  margin-bottom: 16px;
}

.tag-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--text);
}

.tag-current-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-current-card {
  padding: 14px;
}

.tag-current-name,
.tag-catalog-title {
  color: var(--heading-link);
  font-size: 16px;
  font-weight: 800;
}

.tag-current-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.tag-inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-inline-input,
.tag-field input,
.tag-field select,
.tag-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-elevated);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.tag-inline-input:focus,
.tag-field input:focus,
.tag-field select:focus,
.tag-field textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
  background: var(--surface-strong);
}

.tag-inline-input::placeholder,
.tag-field input::placeholder,
.tag-field textarea::placeholder {
  color: var(--muted-2);
}

.tag-inline-input {
  flex: 1 1 220px;
}

.tag-field {
  display: grid;
  gap: 8px;
}

.tag-field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.tag-form {
  display: grid;
  gap: 14px;
}

.tag-form-sep {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.tag-form-actions {
  display: flex;
  justify-content: flex-start;
}

.tag-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tag-admin-alert {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  color: var(--text);
}

.tag-admin-alert--success {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok-text);
}

.tag-admin-alert--error {
  border-color: var(--err-line);
  background: var(--err-soft);
  color: var(--err-text);
}

.tag-btn,
.tag-admin-links a,
.tag-current-actions button,
.tag-current-actions a,
.tag-form-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease, color .16s ease;
}

.tag-btn:hover,
.tag-admin-links a:hover,
.tag-current-actions button:hover,
.tag-current-actions a:hover,
.tag-form-actions button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: var(--line-strong);
  color: var(--heading-link-hover);
}

.tag-btn:active,
.tag-admin-links a:active,
.tag-current-actions button:active,
.tag-current-actions a:active,
.tag-form-actions button:active {
  transform: scale(0.98);
}

.tag-btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: rgba(96, 165, 250, 0.7);
  color: #eff6ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.tag-btn-primary:hover {
  background: linear-gradient(180deg, #4f8ff7, #2563eb);
  border-color: rgba(147, 197, 253, 0.86);
  color: #fff;
}

.tag-btn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--err-text);
  background: var(--err-soft);
}

.tag-btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(252, 165, 165, 0.56);
  color: var(--err-text);
}

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: var(--heading-link);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tag-chip--muted {
  background: var(--surface-soft-2);
  border-color: var(--line);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .tag-admin-grid {
    grid-template-columns: 1fr;
  }

  .tag-panel--main {
    min-height: auto;
  }
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none;
  }

  .watch-header {
    gap: 14px;
    padding: 12px 16px;
  }

  .watch-search-wrap {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .watch-header {
    height: auto;
    min-height: auto;
    padding: 12px;
    display: block;
  }

  .watch-logo {
    display: none;
  }

  .watch-search-wrap {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    transform: none;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .watch-header {
    position: static;
    display: block;
    padding: 12px;
    min-height: auto;
  }

  .watch-logo {
    display: none;
  }

  .watch-search-wrap {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .watch-search-wrap .search-form,
  .search-form {
    min-height: 56px;
    padding: 6px 8px 6px 16px;
  }

  .search-input {
    font-size: 17px;
  }

  .yt-layout {
    padding: 16px 12px 32px;
  }

  .yt-player-wrap {
    border-radius: 18px;
  }

  .yt-info {
    padding: 16px;
    border-radius: 20px;
  }

  .result-link {
    gap: 12px;
    padding: 14px;
  }

  .result-thumb {
    flex: 0 0 144px;
    width: 144px;
    height: 82px;
  }
}

@media (max-width: 640px) {
  .site-logo {
    max-width: 150px;
    max-height: 40px;
  }

  .home-page {
    padding-top: 32px;
  }

  .home-leader-note {
    font-size: 12px;
    margin-top: 9px;
    padding: 10px 12px;
  }

  .result-link {
    flex-direction: column;
  }

  .result-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    flex-basis: auto;
  }

  .yt-title-row {
    grid-template-columns: 40px 1fr 40px;
    gap: 8px;
  }

  .yt-arrow-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .yt-meta-item {
    max-width: 100%;
    white-space: normal;
  }

  .yt-meta-item--stack {
    flex: 1 1 100%;
  }

  .yt-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tag-admin-shell {
    padding: 16px 12px 28px;
  }

  .tag-admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tag-admin-title {
    font-size: 24px;
  }

  .tag-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .tag-inline-form {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .home-search,
  .results {
    width: 100%;
  }

  .search-form {
    min-height: 54px;
  }

  .search-input {
    font-size: 16px;
  }

  .search-button {
    width: 44px;
    height: 44px;
  }

  .yt-title {
    font-size: 1rem;
  }
}