:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --border: #d8dde3;
  --text: #12161c;
  --text-muted: #5a6570;
  --link: #1a1f26;
  --sidebar-bg: #ffffff;
  --topbar-bg: #ffffff;
  --accent: #2a4a6b;
  --accent-hover: #1e3854;
  --accent-soft: rgba(42, 74, 107, 0.1);
  --success: #1f6b3a;
  --error: #9b2c2c;
  --info: #2a4a6b;
  --shadow: rgba(18, 22, 28, 0.08);
  --hero-grad: linear-gradient(135deg, #e8eef5 0%, #f4f6f8 55%, #dfe8f2 100%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b10;
  --bg-alt: #0d1219;
  --bg-card: #101722;
  --bg-elevated: #141d29;
  --border: #243040;
  --text: #edf1f5;
  --text-muted: #8d98a5;
  --link: #edf1f5;
  --sidebar-bg: #0a0e14;
  --topbar-bg: #0a0e14;
  --accent: #5f8ab8;
  --accent-hover: #7aa3cc;
  --accent-soft: rgba(95, 138, 184, 0.15);
  --success: #4ade80;
  --error: #f87171;
  --info: #7aa3cc;
  --shadow: rgba(0, 0, 0, 0.4);
  --hero-grad: linear-gradient(135deg, #0f1824 0%, #070b10 50%, #121c2a 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { max-width: 100%; }

/* App layout */
.app-body { overflow-x: hidden; }

.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand:hover { text-decoration: none; }

.sidebar-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  align-content: start;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 0.75rem 0.35rem;
  margin: 0;
}

.sidebar-categories {
  margin: 0.15rem 0;
}

.sidebar-link--summary {
  list-style: none;
  cursor: pointer;
}

.sidebar-link--summary::-webkit-details-marker { display: none; }

.sidebar-subnav {
  display: grid;
  gap: 0.1rem;
  padding: 0.25rem 0 0.35rem 0.35rem;
  margin-left: 0.5rem;
  border-left: 1px solid var(--border);
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-sublink:hover,
.sidebar-sublink.is-active {
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}

.sidebar-sublink-icon {
  width: 1rem;
  text-align: center;
  opacity: 0.75;
  font-size: 12px;
}

.sidebar-footer .sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 13px;
  color: var(--text);
  padding: 0 0.5rem 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}

.sidebar-icon {
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 0.75rem;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  font-family: inherit;
  font-size: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  color: var(--text);
}

.topbar-search {
  flex: 1;
  max-width: 640px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.content-area {
  padding: 1.25rem;
  flex: 1;
}

/* Search */
.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-form input[type="search"],
.search-form select {
  font-family: inherit;
  font-size: 13px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text);
  min-width: 0;
}

.search-form input[type="search"]:focus,
.search-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.page-search { margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-filters select { min-width: 140px; }
.search-result-count { font-size: 13px; color: var(--text-muted); margin-bottom: 1rem; }

.theme-toggle {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--text); }

/* Hero */
.hero {
  background: var(--hero-grad);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-text {
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 1.25rem;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-stats strong {
  color: var(--text);
  font-size: 1.1rem;
  display: block;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.category-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}

.category-card--large { min-height: 100px; }

.category-card-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

.category-card-name {
  font-weight: 600;
  font-size: 14px;
}

.category-card-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Creator grid */
.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.creator-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.creator-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.creator-card-name { font-weight: 600; font-size: 14px; }
.creator-card-meta { font-size: 11px; color: var(--text-muted); }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-card);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.filter-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text-muted);
}

.filter-sort select {
  font-family: inherit;
  font-size: 13px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
}

.shorts-row--wrap {
  flex-wrap: wrap;
  overflow-x: visible;
}

/* About page */
.about-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 800px;
}

.about-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.about-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.about-card p { color: var(--text-muted); }

.about-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
}

.about-list li::before {
  content: '→ ';
  color: var(--accent);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section { margin-bottom: 2.25rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 { font-size: 1.15rem; font-weight: 600; }
.section-head a { font-size: 13px; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-elevated); }
.btn-block { width: 100%; }
.btn.is-liked, .like-btn.is-liked { color: var(--error); border-color: var(--error); }

/* Flash */
.flash-list { list-style: none; margin-bottom: 1rem; display: grid; gap: 0.5rem; }
.flash { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); font-size: 13px; }
.flash-success { border-color: var(--success); color: var(--success); }
.flash-error { border-color: var(--error); color: var(--error); }
.flash-info { border-color: var(--info); color: var(--info); }

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
  text-decoration: none;
}

.video-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb--short { aspect-ratio: 9 / 16; max-height: 280px; }

.video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11px;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.video-thumb-icon {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 50%;
}

.video-thumb-icon::after {
  content: '';
  display: block;
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent var(--text-muted);
  margin: 14px 0 0 18px;
}

.video-card-body { padding: 0.85rem 0.95rem 1rem; }
.video-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

/* Shorts row */
.shorts-row {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.short-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

.short-card:hover { text-decoration: none; }

.short-card-thumb {
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  position: relative;
}

.short-card-title {
  font-size: 12px;
  font-weight: 600;
  margin-top: 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.short-card-meta { font-size: 11px; color: var(--text-muted); }

/* Shorts full feed */
.shorts-body { overflow: hidden; background: #000; }

.shorts-app { height: 100vh; display: flex; flex-direction: column; }

.shorts-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
}

.shorts-back, .shorts-brand { color: #fff; text-decoration: none; font-weight: 600; }
.shorts-feed {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.short-slide {
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.short-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.short-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 5rem 1rem 2rem;
  pointer-events: none;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.55));
}

.short-info, .short-actions { pointer-events: auto; }

.short-info { max-width: 70%; color: #fff; }
.short-author { color: #fff; font-weight: 700; text-decoration: none; }
.short-title { font-size: 1rem; margin: 0.35rem 0; }
.short-desc {
  font-size: 13px;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.short-category {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 11px;
  background: rgba(255,255,255,0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.short-actions {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
}

.short-action-btn {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}

.short-action-icon { font-size: 1.35rem; }
.short-action-btn.is-liked .short-action-icon { color: #ff6b8a; }

.shorts-empty {
  margin: auto;
  text-align: center;
  color: #fff;
  padding: 2rem;
}

/* Watch page */
.watch-layout {
  display: grid;
  gap: 1.5rem;
  max-width: 1400px;
}

@media (min-width: 1000px) {
  .watch-layout { grid-template-columns: 1fr 340px; align-items: start; }
}

.video-player-wrap {
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-player { width: 100%; display: block; max-height: 72vh; }

.video-details h1 { font-size: 1.35rem; font-weight: 600; margin: 1rem 0 0.65rem; }

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.watch-stats, .watch-buttons { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; font-size: 13px; color: var(--text-muted); }

.category-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.channel-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.channel-bar-meta { flex: 1; min-width: 0; }
.channel-bar-name { font-weight: 600; display: block; color: var(--text); text-decoration: none; }
.channel-bar-subs { font-size: 12px; color: var(--text-muted); }

.video-description { white-space: pre-wrap; line-height: 1.6; }

.watch-sidebar .related-list { display: grid; gap: 0.65rem; }
.sidebar-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.85rem; }

.related-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.65rem;
  padding: 0.45rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.related-item:hover { background: var(--bg-card); text-decoration: none; }

.related-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-title { font-size: 13px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-meta { font-size: 11px; color: var(--text-muted); margin-top: 0.2rem; }

/* Channel */
.channel-header { margin-bottom: 1.25rem; }

.channel-banner {
  height: 120px;
  border-radius: 16px;
  background: var(--hero-grad);
  border: 1px solid var(--border);
  margin-bottom: -36px;
}

.channel-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 0 1rem;
}

.channel-meta { flex: 1; min-width: 220px; }
.channel-meta h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.channel-stats-line, .channel-joined { font-size: 13px; color: var(--text-muted); }
.channel-bio { margin-top: 0.5rem; max-width: 60ch; }
.channel-bio--muted { color: var(--text-muted); }

.channel-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin: 1.25rem 0;
}

.channel-tab {
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.channel-tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.channel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--md { width: 40px; height: 40px; font-size: 16px; }
.avatar--lg { width: 80px; height: 80px; font-size: 28px; border: 3px solid var(--bg); }

/* Forms */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 0.35rem; }
.page-header p { color: var(--text-muted); }

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 640px;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 0.35rem; }
.form-footer { margin-top: 1.25rem; }
.form-link { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 0.75rem; }

.upload-type-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.upload-type-option input { position: absolute; opacity: 0; pointer-events: none; }

.upload-type-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--bg);
}

.upload-type-option input:checked + .upload-type-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-type-card strong { display: block; margin-bottom: 0.25rem; }
.upload-type-card small { color: var(--text-muted); font-size: 12px; }

.container-narrow { max-width: 480px; margin: 0 auto; }

/* Comments */
.comments-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.comments-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.comment-form { margin-bottom: 1.25rem; }
.comment-login-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 1rem; }
.comment-list { list-style: none; display: grid; gap: 0.85rem; }
.comment-item { padding: 0.85rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.comment-header { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.comment-author { font-weight: 600; font-size: 13px; color: var(--text); }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-delete-form { margin-left: auto; }
.comment-delete-form button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-family: inherit; font-size: 11px; }
.comment-body { white-space: pre-wrap; font-size: 14px; }
.comment-empty { font-size: 13px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--text-muted);
}

.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 280px;
  }

  body.sidebar-open .sidebar { transform: translateX(0); }

  .menu-toggle { display: inline-flex; }

  .upload-type-picker { grid-template-columns: 1fr; }

  .short-overlay { padding: 4.5rem 0.75rem 1.25rem; }
  .short-info { max-width: 78%; }
}

@media (min-width: 768px) {
  .short-video { max-width: 420px; }
}
