/*
Theme Name: ClipTube
Theme URI: https://buildarity.com/themes/cliptube
Author: Buildarity
Author URI: https://buildarity.com
Description: A powerful, dark-mode video tube theme for WordPress. Features include: video CPT with custom player, user uploads & channels, subscriptions & likes, AI story generator with internal linking, 8-slot ad management system with media library picker, SEO automator with SiteSEO integration, video sitemaps, custom login URL with email 2FA, admin hardening, 18+ age gate, embed/download bar, backlink manager, and full brand customization. Designed & built by Buildarity.
Version: 2.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cliptube
Tags: video, tube, dark, minimal, seo, user-uploads, two-columns, custom-logo, custom-colors, featured-images, threaded-comments, translation-ready
*/

/* === CSS Variables === */
:root {
  --ct-primary: #e63946;
  --ct-primary-hover: #c62e3a;
  --ct-bg: #0f0f0f;
  --ct-surface: #1a1a1a;
  --ct-surface-hover: #252525;
  --ct-border: #2a2a2a;
  --ct-text: #f1f1f1;
  --ct-text-muted: #aaaaaa;
  --ct-radius: 8px;
  --ct-max-width: 1280px;
  --ct-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* prevent horizontal scroll at root */
}
body {
  font-family: var(--ct-font);
  background: var(--ct-bg);
  color: var(--ct-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* prevent any child from causing horizontal scroll */
  width: 100%;
  max-width: 100vw;
}
a { color: var(--ct-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ct-primary-hover); }
img, video { max-width: 100%; height: auto; display: block; }

/* === Layout === */
.ct-wrap {
  max-width: var(--ct-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  /* Ensure content never bleeds to screen edge */
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .ct-wrap { padding: 0 .75rem; }
}

/* === Header === */
.ct-header {
  background: var(--ct-surface);
  border-bottom: 1px solid var(--ct-border);
  position: sticky; top: 0; z-index: 100;
  padding: .75rem 0;
  width: 100%;
  max-width: 100vw;
}
.ct-header .ct-wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.ct-logo { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; font-weight: 700; color: var(--ct-text); }
.ct-logo img { height: 32px; width: auto; }
.ct-logo:hover { color: var(--ct-primary); }
.ct-search { flex: 1; max-width: 480px; position: relative; }
.ct-search input {
  width: 100%; padding: .5rem 2.5rem .5rem 1rem;
  background: var(--ct-bg); border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius); color: var(--ct-text); font-size: .9rem;
  transition: border-color .2s;
}
.ct-search input:focus { outline: none; border-color: var(--ct-primary); }
.ct-search button {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--ct-text-muted); cursor: pointer; font-size: 1rem;
}
.ct-nav { display: flex; align-items: center; gap: .75rem; }
.ct-nav a, .ct-nav button {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; border-radius: var(--ct-radius);
  font-size: .85rem; color: var(--ct-text-muted); border: none; background: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.ct-nav a:hover, .ct-nav button:hover { background: var(--ct-surface-hover); color: var(--ct-text); }
.ct-btn-primary {
  background: var(--ct-primary) !important; color: #fff !important; font-weight: 600;
}
.ct-btn-primary:hover { background: var(--ct-primary-hover) !important; }
.ct-menu-toggle { display: none; background: none; border: none; color: var(--ct-text); font-size: 1.5rem; cursor: pointer; }

/* === Video Grid === */
.ct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 0;
}

/* === Video Card === */
.ct-card { border-radius: var(--ct-radius); overflow: hidden; transition: transform .2s; }
.ct-card:hover { transform: translateY(-2px); }
.ct-card-thumb {
  position: relative; display: block;
  aspect-ratio: 16/9; background: var(--ct-surface); overflow: hidden;
  border-radius: var(--ct-radius);
}
.ct-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ct-card-duration {
  position: absolute; bottom: .5rem; right: .5rem;
  background: rgba(0,0,0,.85); padding: .15rem .4rem;
  border-radius: 4px; font-size: .75rem; font-weight: 600; color: #fff;
  z-index: 3;
}
.ct-card-placeholder {
  width: 100%; height: 100%; background: var(--ct-surface);
  display: flex; align-items: center; justify-content: center;
}
.ct-card-placeholder-icon { font-size: 2rem; color: var(--ct-text-muted); opacity: .4; }
.ct-card-body { padding: .75rem .25rem; display: flex; gap: .75rem; }
.ct-card-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ct-surface); flex-shrink: 0; overflow: hidden; }
.ct-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ct-card-info { min-width: 0; }
.ct-card-title {
  font-size: .9rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ct-card-title a { color: var(--ct-text); }
.ct-card-title a:hover { color: var(--ct-primary); }
.ct-card-meta { font-size: .8rem; color: var(--ct-text-muted); margin-top: .2rem; }
.ct-card-cats {
  display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem;
}
.ct-card-cat-link {
  font-size: .7rem; color: var(--ct-text-muted); background: var(--ct-surface);
  padding: .1rem .45rem; border-radius: 10px; border: 1px solid var(--ct-border);
  transition: all .2s; white-space: nowrap;
}
.ct-card-cat-link:hover { color: #fff; background: var(--ct-primary); border-color: var(--ct-primary); }

/* Hover video preview */
.ct-hover-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 2;
  background: transparent;
  transition: opacity .3s ease;
}

/* === Categories Bar (collapsible — 2 lines then expand) === */
.ct-cats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 0;
  max-height: 5.8rem;       /* ~2 rows of chips */
  overflow: hidden;
  position: relative;
  transition: max-height .3s ease;
}
.ct-cats-bar.ct-cats-expanded {
  max-height: 2000px;       /* effectively unlimited */
}
.ct-cats-bar::-webkit-scrollbar { display: none; }
.ct-cat-chip {
  padding: .35rem .85rem; border-radius: 20px; background: var(--ct-surface);
  border: 1px solid var(--ct-border); font-size: .8rem; color: var(--ct-text-muted);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.ct-cat-chip:hover, .ct-cat-chip.active { background: var(--ct-primary); color: #fff; border-color: var(--ct-primary); }
.ct-cats-toggle {
  display: none;             /* hidden by default, shown by JS if overflow detected */
  align-items: center; justify-content: center;
  width: 100%; padding: .25rem 0; margin-top: .25rem;
  background: transparent; border: none;
  color: var(--ct-primary); font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: color .2s;
}
.ct-cats-toggle:hover { color: var(--ct-primary-hover); }
.ct-cats-toggle.ct-visible { display: flex; }

/* === Single Video === */
.ct-single { padding: 1.5rem 0; }
.ct-single .ct-single-layout { padding: 0 .5rem; }
.ct-single-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; min-width: 0; }
.ct-single-layout > * { min-width: 0; overflow: hidden; }
.ct-main-col { min-width: 0; overflow: hidden; }
.ct-player-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--ct-radius); overflow: hidden; margin-bottom: 1rem;
  max-width: 100%;
  box-sizing: border-box;
}
.ct-player-wrap video, .ct-player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.ct-video-header { margin-bottom: 1rem; }
.ct-video-title { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: .5rem; }
.ct-video-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ct-video-stats { font-size: .85rem; color: var(--ct-text-muted); }
.ct-video-btns { display: flex; gap: .5rem; margin-left: auto; }
.ct-video-btns button, .ct-video-btns a {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .4rem .75rem; border-radius: var(--ct-radius);
  background: var(--ct-surface); border: 1px solid var(--ct-border);
  color: var(--ct-text-muted); font-size: .8rem; cursor: pointer; transition: all .2s;
}
.ct-video-btns button:hover, .ct-video-btns a:hover { background: var(--ct-surface-hover); color: var(--ct-text); }
.ct-channel-row {
  display: flex; align-items: center; gap: .75rem; padding: 1rem 0;
  border-top: 1px solid var(--ct-border); border-bottom: 1px solid var(--ct-border);
}
.ct-channel-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ct-channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ct-channel-name { font-weight: 600; font-size: .9rem; }
.ct-channel-subs { font-size: .8rem; color: var(--ct-text-muted); }
.ct-subscribe-btn {
  margin-left: auto; padding: .45rem 1rem; border-radius: 20px;
  background: var(--ct-primary); color: #fff; border: none; font-size: .85rem;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.ct-subscribe-btn:hover { background: var(--ct-primary-hover); }
.ct-subscribe-btn.subscribed { background: var(--ct-surface); color: var(--ct-text-muted); border: 1px solid var(--ct-border); }
.ct-description { padding: 1rem 0; font-size: .9rem; color: var(--ct-text-muted); line-height: 1.7; position: relative; }
.ct-desc-collapsed .ct-desc-inner { max-height: 4.8em; overflow: hidden; position: relative; }
.ct-desc-collapsed .ct-desc-inner::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2em; background: linear-gradient(transparent, var(--ct-bg)); pointer-events: none; }
.ct-desc-expanded .ct-desc-inner { max-height: none; }
.ct-desc-expanded .ct-desc-inner::after { display: none; }
.ct-desc-toggle { background: none; border: none; color: var(--ct-text); font-size: .85rem; font-weight: 600; cursor: pointer; padding: .5rem 0 0; display: block; }
.ct-desc-toggle:hover { color: var(--ct-primary); }
.ct-desc-hidden { display: none; }

/* Sidebar */
.ct-sidebar { display: flex; flex-direction: column; gap: .75rem; min-width: 0; overflow: hidden; }
.ct-sidebar-card { display: flex; gap: .75rem; min-width: 0; }
.ct-sidebar-thumb {
  width: 168px; min-width: 120px; max-width: 168px; flex-shrink: 0;
  aspect-ratio: 16/9; border-radius: 6px; overflow: hidden;
  background: var(--ct-surface); position: relative; display: block;
}
.ct-sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-sidebar-thumb .ct-card-duration {
  position: absolute; bottom: .35rem; right: .35rem;
  background: rgba(0,0,0,.85); padding: .1rem .35rem;
  border-radius: 3px; font-size: .7rem; font-weight: 600; color: #fff;
  z-index: 3; display: inline-block; line-height: 1.3;
}
.ct-sidebar-thumb .ct-card-placeholder { width: 100%; height: 100%; }
.ct-sidebar-info { min-width: 0; flex: 1; overflow: hidden; }
.ct-sidebar-title { font-size: .85rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ct-sidebar-title a { color: var(--ct-text); }
.ct-sidebar-meta { font-size: .75rem; color: var(--ct-text-muted); margin-top: .2rem; word-break: break-word; }

/* === Comments === */
.ct-comments { padding: 1.5rem 0; }
.ct-comments h3 { font-size: 1rem; margin-bottom: 1rem; }
.ct-comment-form { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.ct-comment-form textarea {
  flex: 1; padding: .75rem; background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius); color: var(--ct-text); font-size: .85rem;
  resize: vertical; min-height: 60px; font-family: var(--ct-font);
}
.ct-comment-form textarea:focus { outline: none; border-color: var(--ct-primary); }
.ct-comment-form button {
  align-self: flex-end; padding: .5rem 1rem; background: var(--ct-primary);
  color: #fff; border: none; border-radius: var(--ct-radius); cursor: pointer;
  font-size: .85rem; font-weight: 600;
}
.ct-comment { display: flex; gap: .75rem; padding: .75rem 0; }
.ct-comment + .ct-comment { border-top: 1px solid var(--ct-border); }
.ct-comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ct-surface); flex-shrink: 0; overflow: hidden; }
.ct-comment-content { min-width: 0; }
.ct-comment-author { font-size: .85rem; font-weight: 600; }
.ct-comment-date { font-size: .75rem; color: var(--ct-text-muted); margin-left: .5rem; }
.ct-comment-text { font-size: .85rem; color: var(--ct-text-muted); margin-top: .25rem; }

/* === Upload Page === */
.ct-upload { max-width: 640px; margin: 2rem auto; }
.ct-upload h1 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.ct-form-group { margin-bottom: 1.25rem; }
.ct-form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.ct-form-group input[type="text"],
.ct-form-group input[type="email"],
.ct-form-group input[type="password"],
.ct-form-group input[type="url"],
.ct-form-group input[type="search"],
.ct-form-group textarea,
.ct-form-group select {
  width: 100%; padding: .6rem .75rem; background: var(--ct-surface);
  border: 1px solid var(--ct-border); border-radius: var(--ct-radius);
  color: var(--ct-text); font-size: .9rem; font-family: var(--ct-font);
}
.ct-form-group input:focus, .ct-form-group textarea:focus, .ct-form-group select:focus {
  outline: none; border-color: var(--ct-primary);
}
.ct-form-row { display: flex; gap: 1rem; }
.ct-field-hint { font-size: .75rem; color: var(--ct-text-muted); margin-top: .25rem; }

/* Dropzone */
.ct-dropzone {
  border: 2px dashed var(--ct-border); border-radius: var(--ct-radius);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.ct-dropzone:hover { border-color: var(--ct-primary); background: rgba(230,57,70,.04); }
.ct-dropzone.ct-dropzone-active { border-color: var(--ct-primary); background: rgba(230,57,70,.08); }
.ct-dropzone-icon { font-size: 2.5rem; margin-bottom: .5rem; opacity: .5; }
.ct-dropzone-main { color: var(--ct-text); font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.ct-dropzone-sub { color: var(--ct-text-muted); font-size: .8rem; }

/* Video preview after file selection */
.ct-upload-preview {
  display: none; /* shown by JS */
  gap: 1rem; padding: 1rem;
  background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius); margin-bottom: 1.25rem;
}
.ct-upload-preview.ct-visible { display: flex; }
.ct-preview-player { width: 240px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: #000; }
.ct-preview-player video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: contain; }
.ct-preview-info { flex: 1; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.ct-preview-filename { font-size: .85rem; font-weight: 600; word-break: break-all; }
.ct-preview-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.ct-badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 4px;
  background: var(--ct-bg); font-size: .75rem; color: var(--ct-text-muted);
  border: 1px solid var(--ct-border);
}
.ct-preview-change {
  background: none; border: 1px solid var(--ct-border); border-radius: var(--ct-radius);
  color: var(--ct-text-muted); padding: .3rem .65rem; font-size: .8rem;
  cursor: pointer; align-self: flex-start; margin-top: auto;
  transition: color .2s, border-color .2s;
}
.ct-preview-change:hover { color: var(--ct-primary); border-color: var(--ct-primary); }

/* Step divider */
.ct-step-divider {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 0; margin-bottom: 1rem;
  border-bottom: 1px solid var(--ct-border);
  font-size: .85rem; color: #4ade80;
}
.ct-step-check { font-size: 1rem; }

/* Progress */
.ct-progress-wrap { margin-bottom: 1rem; }
.ct-progress-track {
  background: var(--ct-surface); border-radius: 6px; overflow: hidden;
  height: 8px; border: 1px solid var(--ct-border);
}
.ct-progress-fill {
  height: 100%; background: var(--ct-primary); width: 0%;
  transition: width .3s ease; border-radius: 6px;
}
.ct-progress-info {
  display: flex; justify-content: space-between; margin-top: .35rem;
  font-size: .8rem; color: var(--ct-text-muted);
}
.ct-upload-submit {
  width: 100%; padding: .7rem; font-size: .95rem;
  border-radius: var(--ct-radius); border: none; cursor: pointer;
  margin-top: .5rem;
}
.ct-upload-submit:disabled { opacity: .6; cursor: not-allowed; }

/* === Profile === */
.ct-profile-header {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 2rem 0; border-bottom: 1px solid var(--ct-border);
}
.ct-profile-avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--ct-surface); }
.ct-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ct-profile-name { font-size: 1.25rem; font-weight: 700; }
.ct-profile-stats { font-size: .85rem; color: var(--ct-text-muted); display: flex; gap: 1rem; margin-top: .25rem; }

/* === Footer === */
.ct-footer {
  margin-top: auto; padding: 1.5rem 0;
  background: var(--ct-surface); border-top: 1px solid var(--ct-border);
  font-size: .8rem; color: var(--ct-text-muted); text-align: center;
}

/* === Auth Forms === */
.ct-auth { max-width: 400px; margin: 3rem auto; }
.ct-auth h1 { font-size: 1.25rem; margin-bottom: 1.5rem; text-align: center; }
.ct-auth .ct-btn-primary { width: 100%; padding: .6rem; font-size: .95rem; border-radius: var(--ct-radius); border: none; cursor: pointer; }
.ct-auth-switch { text-align: center; margin-top: 1rem; font-size: .85rem; color: var(--ct-text-muted); }

/* === Pagination === */
.ct-pagination { display: flex; justify-content: center; gap: .5rem; padding: 2rem 0; }
.ct-pagination a, .ct-pagination span {
  padding: .4rem .75rem; border-radius: var(--ct-radius);
  background: var(--ct-surface); border: 1px solid var(--ct-border);
  font-size: .85rem; color: var(--ct-text-muted);
}
.ct-pagination .current { background: var(--ct-primary); color: #fff; border-color: var(--ct-primary); }

/* === Notices === */
.ct-notice { padding: .75rem 1rem; border-radius: var(--ct-radius); margin-bottom: 1rem; font-size: .85rem; }
.ct-notice-success { background: #0d3320; color: #4ade80; border: 1px solid #166534; }
.ct-notice-error { background: #3b1114; color: #f87171; border: 1px solid #7f1d1d; }

/* === Responsive === */

/* Tablet */
@media (max-width: 900px) {
  .ct-single-layout { grid-template-columns: 1fr; }
  .ct-sidebar-thumb { width: 140px; min-width: 100px; }
  .ct-single .ct-single-layout { padding: 0; }
}

/* Mobile */
@media (max-width: 700px) {
  .ct-search { display: none; }
  .ct-menu-toggle { display: block; }
  .ct-nav { display: none; }
  .ct-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0; width: 100%;
    background: var(--ct-surface); padding: 1rem;
    border-bottom: 1px solid var(--ct-border);
    z-index: 99;
  }
  /* Show mobile-only links inside hamburger */
  .ct-nav.open .ct-nav-mobile-links {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--ct-border); margin-top: .5rem; padding-top: .5rem;
  }
  /* Hide desktop dropdown on mobile — hamburger has the links instead */
  .ct-user-dropdown { display: none; }
  .ct-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
  .ct-video-title { font-size: 1.05rem; }
  .ct-video-actions { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .ct-video-btns { margin-left: 0; flex-wrap: wrap; }
  .ct-profile-header { flex-direction: column; text-align: center; }
  /* Keep sidebar cards as row on mobile */
  .ct-sidebar-card { flex-direction: row; }
  .ct-sidebar-thumb { width: 120px; min-width: 90px; }
  /* Single video — tighten padding */
  .ct-single { padding: 1rem 0; }
  .ct-single .ct-single-layout { padding: 0; }
  .ct-single.ct-wrap { padding: 0; }
  .ct-main-col { overflow: visible; }
  .ct-player-wrap { border-radius: 0; }
  /* Re-add padding to everything inside main-col except the player */
  .ct-main-col > *:not(.ct-player-wrap) { padding-left: 1rem; padding-right: 1rem; }
  .ct-main-col > .ct-pb { padding-left: 0; padding-right: 0; }
  .ct-sidebar { padding: 0 1rem; }
  /* Channel row wrap */
  .ct-channel-row { flex-wrap: wrap; }
  .ct-subscribe-btn { margin-left: 0; width: 100%; text-align: center; }
  /* Embed bar wrap */
  .ct-embed-download-bar { flex-wrap: wrap; }
  .ct-embed-code-wrap { flex-direction: column; }
  .ct-embed-code-wrap textarea { font-size: .7rem; }
  /* Description */
  .ct-description { font-size: .85rem; word-break: break-word; }
  /* Blog grid */
  .ct-blog-grid { grid-template-columns: 1fr; }
  /* Hide card categories on mobile — saves space */
  .ct-card-cats { display: none; }
}

/* Small mobile */
@media (max-width: 500px) {
  .ct-wrap { padding: 0 .75rem; }
  .ct-upload-preview.ct-visible { flex-direction: column; }
  .ct-preview-player { width: 100%; }
  .ct-form-row { flex-direction: column; }
  /* Stack sidebar cards vertically on tiny phones */
  .ct-sidebar-card { flex-direction: column; }
  .ct-sidebar-thumb { width: 100%; max-width: 100%; }
  /* Tighter grid */
  .ct-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .ct-card-title { font-size: .82rem; }
  .ct-card-meta { font-size: .72rem; }
  /* Compact logo on tiny screens */
  .ct-logo span { display: none; }
  /* Adjust single-video inner padding for smaller screens */
  .ct-main-col > *:not(.ct-player-wrap) { padding-left: .75rem; padding-right: .75rem; }
  .ct-sidebar { padding: 0 .75rem; }
  /* Video header tighter */
  .ct-video-title { font-size: .95rem; }
  .ct-video-header { margin-bottom: .5rem; }
  /* Footer tighter */
  .ct-footer { padding: 1.5rem 0 1rem; font-size: .75rem; }
  /* Categories bar scrollable on tiny screens */
  .ct-cats-bar { max-height: 3rem; }
  .ct-cat-chip { font-size: .72rem; padding: .25rem .65rem; }
}

/* === Social Icons (Footer) === */
.ct-social-icons {
  display: flex; justify-content: center; gap: .75rem;
  margin-bottom: .75rem; flex-wrap: wrap;
}
.ct-social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ct-bg); border: 1px solid var(--ct-border);
  color: var(--ct-text-muted); transition: all .2s;
}
.ct-social-link:hover { background: var(--ct-primary); color: #fff; border-color: var(--ct-primary); }
.ct-social-link svg { width: 18px; height: 18px; }

/* === Footer Backlinks === */
.ct-backlinks {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .9rem;
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--ct-border);
}
.ct-backlinks a {
  font-size: .75rem; color: var(--ct-text-muted); transition: color .2s;
}
.ct-backlinks a:hover { color: var(--ct-primary); }

/* === 18+ Age Gate === */
.ct-age-gate {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.ct-age-gate-box {
  background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: 12px; padding: 2.5rem 2rem; text-align: center;
  max-width: 440px; width: 100%;
}
.ct-age-gate-icon { font-size: 3rem; margin-bottom: .75rem; }
.ct-age-gate-box h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.ct-age-gate-box p { font-size: .9rem; color: var(--ct-text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.ct-age-gate-btns { display: flex; flex-direction: column; gap: .5rem; }
.ct-age-gate-btns .ct-btn-primary {
  padding: .65rem 1.5rem; border: none; border-radius: var(--ct-radius);
  font-size: .95rem; font-weight: 600; cursor: pointer;
}
.ct-age-leave {
  font-size: .85rem; color: var(--ct-text-muted); padding: .5rem;
}
.ct-age-leave:hover { color: var(--ct-text); }

/* === Content Placement Slots === */
.ct-pb {
  text-align: center; overflow: hidden;
  margin: .75rem auto;
  display: flex; align-items: center; justify-content: center;
  max-width: 100%; box-sizing: border-box;
}
/* Desktop/mobile slot visibility */
.ct-mob-only { display: none !important; }
@media (max-width: 700px) {
  .ct-desk-only { display: none !important; }
  .ct-mob-only { display: flex !important; }
}
.ct-pb img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ct-pb a { display: inline-block; line-height: 0; }
.ct-pb-ht { margin-bottom: 1rem; }
.ct-pb-ht2 { margin-bottom: 1rem; }
.ct-pb-sr { margin-bottom: 1rem; }
.ct-pb-gt, .ct-pb-gb { max-width: var(--ct-max-width); margin-left: auto; margin-right: auto; padding: .5rem 1rem; }
.ct-feed-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; background: var(--ct-surface); border: 1px dashed var(--ct-border);
  border-radius: var(--ct-radius);
}

/* Video interstitial layer */
.ct-vp-layer {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(0,0,0,.92); display: flex;
  align-items: center; justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: .5rem;
  box-sizing: border-box;
}
.ct-vp-dismiss {
  position: absolute; top: .5rem; right: .5rem; z-index: 21;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1rem; cursor: pointer; transition: background .2s;
  display: none; /* hidden until countdown ends */
}
.ct-vp-dismiss:hover { background: var(--ct-primary); }
.ct-vp-body {
  display: flex; flex-direction: column; align-items: center;
  max-width: 90%; max-height: 90%;
  position: relative;
}
.ct-vp-body img,
.ct-vp-body iframe,
.ct-vp-body > a { max-width: 100%; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ct-vp-body img { height: auto; width: auto; object-fit: contain; display: block; }
.ct-vp-skip {
  background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: .35rem .9rem; border-radius: 4px;
  font-size: .8rem; cursor: pointer; transition: all .2s;
  margin-top: .5rem; flex-shrink: 0;
}
.ct-vp-skip:hover { background: var(--ct-primary); border-color: var(--ct-primary); }
.ct-vp-skip[disabled] { opacity: .5; cursor: not-allowed; }
.ct-vp-timer {
  position: absolute; bottom: .5rem; left: .5rem; z-index: 21;
  color: rgba(255,255,255,.6); font-size: .75rem;
}

/* === Categories Page Grid === */
.ct-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem; padding: 1rem 0 2rem;
}
.ct-category-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem 1rem; background: var(--ct-surface);
  border: 1px solid var(--ct-border); border-radius: var(--ct-radius);
  transition: all .2s; text-align: center;
}
.ct-category-card:hover { border-color: var(--ct-primary); background: var(--ct-surface-hover); transform: translateY(-2px); }
.ct-category-name { font-size: .95rem; font-weight: 600; color: var(--ct-text); }
.ct-category-count { font-size: .75rem; color: var(--ct-text-muted); margin-top: .25rem; }

/* ─── Embed & Download Bar ─── */
.ct-embed-download-bar {
  display: flex; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--ct-border);
}
.ct-edb-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem;
  background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 20px;
  color: var(--ct-text); font-size: .82rem; cursor: pointer; text-decoration: none;
  transition: all .2s;
}
.ct-edb-btn:hover { background: var(--ct-primary); color: #fff; border-color: var(--ct-primary); }
.ct-edb-btn svg { flex-shrink: 0; }

.ct-embed-panel {
  background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 6px;
  padding: .75rem; margin: .5rem 0;
}
.ct-embed-code-wrap {
  display: flex; gap: .5rem; align-items: stretch;
}
.ct-embed-code-wrap textarea {
  flex: 1; background: var(--ct-bg); color: var(--ct-text); border: 1px solid var(--ct-border);
  border-radius: 4px; padding: .5rem; font-family: monospace; font-size: .75rem; resize: vertical;
}
.ct-embed-copy {
  background: var(--ct-primary); color: #fff; border: none; border-radius: 4px;
  padding: .5rem .75rem; cursor: pointer; display: flex; align-items: center;
}
.ct-embed-copy:hover { opacity: .85; }

/* ─── Blog / Stories ─── */
.ct-blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem; padding: 1.25rem 0;
}
.ct-blog-card {
  background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px;
  overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.ct-blog-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.ct-blog-card-body { padding: 1rem; }
.ct-blog-card-title {
  font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; line-height: 1.3;
}
.ct-blog-card-title a { color: var(--ct-text); }
.ct-blog-card-title a:hover { color: var(--ct-primary); }
.ct-blog-card-excerpt {
  font-size: .85rem; color: var(--ct-text-muted); margin: 0 0 .75rem; line-height: 1.5;
}
.ct-blog-card-meta {
  font-size: .75rem; color: var(--ct-text-muted);
}

/* ─── Single Story ─── */
.ct-story-single { max-width: 720px; margin: 0 auto; padding: 1.5rem 0 3rem; }
.ct-story-header { margin-bottom: 1.5rem; }
.ct-story-cats { margin-bottom: .75rem; }
.ct-story-title { font-size: 1.6rem; line-height: 1.3; margin: 0 0 .75rem; }
.ct-story-meta { font-size: .85rem; color: var(--ct-text-muted); }
.ct-story-content { line-height: 1.75; font-size: .95rem; }
.ct-story-content h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; color: var(--ct-text); }
.ct-story-content h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; color: var(--ct-text); }
.ct-story-content p { margin: 0 0 1rem; }
.ct-story-content a { color: var(--ct-primary); text-decoration: underline; }
.ct-story-content a:hover { opacity: .8; }
.ct-story-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.5rem 0; }
.ct-related-stories { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--ct-border); }

/* ─── Contact Page ─── */
.ct-contact-page { max-width: 900px; margin: 0 auto; padding: 2rem 0 3rem; }
.ct-contact-title { font-size: 1.6rem; margin: 0 0 .5rem; }
.ct-contact-sub { color: var(--ct-text-muted); font-size: .9rem; margin: 0 0 2rem; }
.ct-contact-grid { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; }
.ct-contact-form-wrap { min-width: 0; }
.ct-form-row { margin-bottom: 1.25rem; }
.ct-form-row label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--ct-text); }
.ct-req { color: var(--ct-primary); }
.ct-form-row input, .ct-form-row select, .ct-form-row textarea {
  width: 100%; padding: .6rem .75rem; background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: 6px; color: var(--ct-text); font-size: .9rem; transition: border-color .2s;
}
.ct-form-row input:focus, .ct-form-row select:focus, .ct-form-row textarea:focus {
  outline: none; border-color: var(--ct-primary);
}
.ct-form-row textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.ct-char-count { font-size: .75rem; color: var(--ct-text-muted); display: block; text-align: right; margin-top: .25rem; }
.ct-contact-submit { width: 100%; padding: .75rem; font-size: .95rem; cursor: pointer; border: none; }
.ct-contact-submit:disabled { opacity: .6; cursor: not-allowed; }
.ct-cf-result { margin-top: 1rem; padding: .75rem 1rem; border-radius: 6px; font-size: .9rem; }
.ct-cf-ok { background: rgba(0,163,42,.12); color: #00a32a; border: 1px solid rgba(0,163,42,.25); }
.ct-cf-err { background: rgba(214,54,56,.12); color: #d63638; border: 1px solid rgba(214,54,56,.25); }
.ct-contact-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.ct-contact-info-card {
  background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; padding: 1.25rem;
}
.ct-contact-info-card h3 { font-size: .9rem; margin: 0 0 .75rem; color: var(--ct-text); }
.ct-contact-info-card p { font-size: .85rem; color: var(--ct-text-muted); margin: 0 0 .5rem; line-height: 1.5; }
.ct-contact-info-card a { color: var(--ct-primary); text-decoration: none; }
.ct-contact-info-card a:hover { text-decoration: underline; }
.ct-contact-info-card ul { list-style: none; padding: 0; margin: 0; }
.ct-contact-info-card li { padding: .25rem 0; }
.ct-contact-info-card li a { font-size: .85rem; }
@media (max-width: 700px) {
  .ct-contact-grid { grid-template-columns: 1fr; }
  .ct-contact-sidebar { order: -1; }
}

/* ─── Legal Pages ─── */
.ct-legal-page { max-width: 720px; margin: 0 auto; padding: 2rem 0 3rem; }
.ct-legal-page h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
.ct-legal-updated { font-size: .8rem; color: var(--ct-text-muted); margin: 0 0 2rem; }
.ct-legal-content h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; color: var(--ct-text); border-bottom: 1px solid var(--ct-border); padding-bottom: .4rem; }
.ct-legal-content h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
.ct-legal-content p { font-size: .9rem; line-height: 1.7; margin: 0 0 1rem; color: var(--ct-text-muted); }
.ct-legal-content ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.ct-legal-content li { font-size: .9rem; line-height: 1.7; color: var(--ct-text-muted); margin-bottom: .35rem; }
.ct-legal-content a { color: var(--ct-primary); }

/* ═══════════════════════════════════════ */
/* === Profile Tabs === */
/* ═══════════════════════════════════════ */
.ct-profile-info { min-width: 0; }
.ct-profile-bio { font-size: .85rem; color: var(--ct-text-muted); margin-top: .5rem; line-height: 1.5; max-width: 500px; }
.ct-profile-meta-row {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  margin-top: .4rem; font-size: .8rem; color: var(--ct-text-muted);
}
.ct-profile-meta-row a { color: var(--ct-primary); }
.ct-profile-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center;
}
.ct-profile-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--ct-border);
  margin-bottom: 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ct-tab {
  padding: .75rem 1rem; font-size: .85rem; font-weight: 500;
  color: var(--ct-text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.ct-tab:hover { color: var(--ct-text); }
.ct-tab.active { color: var(--ct-primary); border-bottom-color: var(--ct-primary); font-weight: 600; }
.ct-empty-tab {
  color: var(--ct-text-muted); text-align: center; padding: 3rem 0; font-size: .9rem;
}

/* === Follow / Block Buttons === */
.ct-follow-btn {
  padding: .4rem 1rem; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--ct-primary); color: var(--ct-primary);
  background: transparent; cursor: pointer; transition: all .2s;
}
.ct-follow-btn:hover { background: var(--ct-primary); color: #fff; }
.ct-follow-btn.following { background: var(--ct-primary); color: #fff; }
.ct-follow-btn.following:hover { background: transparent; color: var(--ct-primary); }

.ct-block-btn {
  padding: .4rem .85rem; border-radius: 20px; font-size: .78rem;
  border: 1px solid var(--ct-border); color: var(--ct-text-muted);
  background: transparent; cursor: pointer; transition: all .2s;
}
.ct-block-btn:hover { border-color: #ef4444; color: #ef4444; }
.ct-block-btn.blocked { border-color: #ef4444; color: #ef4444; }

.ct-btn-outline {
  padding: .4rem 1rem; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--ct-border); color: var(--ct-text);
  background: transparent; cursor: pointer; transition: all .2s; text-decoration: none;
}
.ct-btn-outline:hover { border-color: var(--ct-primary); color: var(--ct-primary); }

.ct-btn-icon {
  background: transparent; border: 1px solid var(--ct-border);
  color: var(--ct-text-muted); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.ct-btn-icon:hover { border-color: var(--ct-primary); color: var(--ct-primary); }

/* === User List (followers/following) === */
.ct-user-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem; padding: .5rem 0;
}
.ct-user-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius); transition: background .2s;
}
.ct-user-card:hover { background: var(--ct-surface-hover); }
.ct-user-card-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ct-user-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ct-user-card-info { flex: 1; min-width: 0; }
.ct-user-card-name { font-weight: 600; font-size: .9rem; color: var(--ct-text); display: block; }
.ct-user-card-meta { font-size: .78rem; color: var(--ct-text-muted); }

/* === User Comments List === */
.ct-user-comments-list { padding: .5rem 0; }
.ct-user-comment-item {
  padding: .75rem 0; border-bottom: 1px solid var(--ct-border);
}
.ct-user-comment-meta { font-size: .78rem; color: var(--ct-text-muted); margin-bottom: .3rem; }
.ct-user-comment-meta a { color: var(--ct-primary); }
.ct-user-comment-text { font-size: .85rem; color: var(--ct-text); }

/* === Save / Repost Buttons === */
.ct-save-btn, .ct-repost-btn {
  background: transparent; border: 1px solid var(--ct-border);
  color: var(--ct-text); padding: .3rem .7rem; border-radius: 20px;
  font-size: .82rem; cursor: pointer; transition: all .2s;
}
.ct-save-btn:hover, .ct-repost-btn:hover { border-color: var(--ct-primary); color: var(--ct-primary); }
.ct-save-btn[data-saved="1"] { color: #f59e0b; border-color: #f59e0b; }
.ct-repost-btn.active { color: var(--ct-primary); border-color: var(--ct-primary); }

/* === Report Modal === */
.ct-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.ct-modal {
  background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: 12px; width: 100%; max-width: 480px; overflow: hidden;
}
.ct-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--ct-border);
}
.ct-modal-header h3 { font-size: 1rem; margin: 0; }
.ct-modal-close {
  background: transparent; border: none; color: var(--ct-text-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.ct-modal-body { padding: 1.25rem; }
.ct-modal-body .ct-form-group { margin-bottom: 1rem; }
.ct-modal-body label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.ct-modal-body select, .ct-modal-body textarea {
  width: 100%; padding: .5rem .75rem; background: var(--ct-bg); border: 1px solid var(--ct-border);
  border-radius: 6px; color: var(--ct-text); font-size: .85rem; font-family: inherit;
}
.ct-modal-body select:focus, .ct-modal-body textarea:focus { outline: none; border-color: var(--ct-primary); }
.ct-modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1.25rem; border-top: 1px solid var(--ct-border);
}

/* === User Dropdown Menu (Header) === */
.ct-user-dropdown { position: relative; flex-shrink: 0; }
.ct-user-dropdown-trigger {
  display: flex; align-items: center; gap: .4rem; cursor: pointer;
  background: transparent; border: none; color: var(--ct-text); font-size: .85rem; padding: .25rem 0;
}
.ct-user-mini-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.ct-dropdown-arrow { font-size: .65rem; opacity: .6; }
.ct-user-dropdown-menu {
  display: none; position: absolute; top: calc(100% + .5rem); right: 0; z-index: 9999;
  background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px;
  min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.5); overflow: hidden;
}
.ct-dropdown-header {
  display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem;
}
.ct-dropdown-header img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ct-dropdown-header strong { display: block; font-size: .85rem; }
.ct-dropdown-header span { font-size: .75rem; color: var(--ct-text-muted); }
.ct-dropdown-divider { height: 1px; background: var(--ct-border); }
.ct-user-dropdown-menu a {
  display: block; padding: .5rem 1rem; font-size: .82rem; color: var(--ct-text);
  transition: background .15s;
}
.ct-user-dropdown-menu a:hover { background: var(--ct-surface-hover); }

/* Mobile-only nav links (inside hamburger) — hidden on desktop */
.ct-nav-mobile-links { display: none; }

/* === Settings Page === */
.ct-settings { max-width: 560px; margin: 2rem auto; }
.ct-settings h1 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.ct-settings-section {
  margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--ct-border);
}
.ct-settings-section h2 { font-size: .95rem; margin-bottom: 1rem; color: var(--ct-text-muted); }
.ct-settings .ct-form-group { margin-bottom: 1rem; }
.ct-settings .ct-form-group label {
  display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem;
}
.ct-settings .ct-form-group input,
.ct-settings .ct-form-group textarea {
  width: 100%; padding: .5rem .75rem; background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: 6px; color: var(--ct-text); font-size: .85rem; font-family: inherit;
}
.ct-settings .ct-form-group input:focus,
.ct-settings .ct-form-group textarea:focus { outline: none; border-color: var(--ct-primary); }
.ct-settings .ct-form-group input:disabled {
  opacity: .5; cursor: not-allowed;
}
.ct-avatar-edit { display: flex; align-items: center; gap: 1.25rem; }
.ct-avatar-preview { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ct-surface); }
.ct-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.ct-avatar-controls { display: flex; flex-direction: column; gap: .35rem; }

/* === Multi-Category Picker (Upload) === */
.ct-multi-cat {
  display: flex; flex-wrap: wrap; gap: .35rem;
  max-height: 180px; overflow-y: auto;
  padding: .5rem; background: var(--ct-surface); border: 1px solid var(--ct-border);
  border-radius: 6px;
}
.ct-cat-check {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 14px; font-size: .8rem;
  border: 1px solid var(--ct-border); cursor: pointer; transition: all .2s;
  user-select: none;
}
.ct-cat-check:hover { border-color: var(--ct-primary); }
.ct-cat-check input[type="checkbox"] { display: none; }
.ct-cat-check:has(input:checked) {
  background: var(--ct-primary); border-color: var(--ct-primary); color: #fff;
}
/* Fallback for browsers without :has() */
.ct-cat-check.checked {
  background: var(--ct-primary); border-color: var(--ct-primary); color: #fff;
}

/* === Thumbnail Capture Preview === */
.ct-thumb-capture-row { display: flex; align-items: center; }

/* === Responsive additions === */
@media (max-width: 700px) {
  .ct-profile-tabs { gap: 0; padding-bottom: 0; }
  .ct-tab { padding: .6rem .65rem; font-size: .78rem; }
  .ct-user-list { grid-template-columns: 1fr; }
  .ct-profile-actions { flex-wrap: wrap; }
  .ct-settings { padding: 0 .5rem; }
  .ct-avatar-edit { flex-direction: column; align-items: flex-start; }
  .ct-thumb-capture-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
}
@media (max-width: 500px) {
  .ct-tab { padding: .5rem .45rem; font-size: .72rem; }
}
