/* =============================================================================
   CommunityHub Reddit-inspired skin
   ============================================================================= */

:root {
  color-scheme: light;

  --color-primary:        #ff4500;
  --color-primary-light:  #fff3ed;
  --color-primary-dark:   #a92d00;
  --color-primary-hover:  #e13d00;
  --color-secondary:      #0079d3;
  --color-accent:         #ffb000;

  --color-bg:             #dae0e6;
  --color-card:           #ffffff;
  --color-border:         #cccfd3;
  --color-border-light:   #edeff1;

  --color-text-primary:   #1a1a1b;
  --color-text-secondary: #4a4f55;
  --color-text-muted:     #7c858d;
  --color-link:           #0079d3;
  --color-link-hover:     #005fa8;

  --button-shine:         transparent;
  --reddit-nav:           #ffffff;
  --reddit-vote-bg:       #f6f7f8;
  --reddit-hover:         #f8f9fa;
  --reddit-input:         #f6f7f8;
  --reddit-overlay:       rgba(26, 26, 27, 0.64);

  --radius-xs:    2px;
  --radius-sm:    4px;
  --radius-md:    4px;
  --radius-lg:    6px;
  --radius-xl:    8px;

  --shadow-xs:    none;
  --shadow-sm:    none;
  --shadow-md:    0 2px 10px rgba(26, 26, 27, 0.08);
  --shadow-lg:    0 12px 32px rgba(26, 26, 27, 0.18);
  --shadow-focus: 0 0 0 3px rgba(255, 69, 0, 0.22);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --color-primary:        #ff6a33;
  --color-primary-light:  rgba(255, 106, 51, 0.14);
  --color-primary-dark:   #ffb199;
  --color-primary-hover:  #ff7a47;
  --color-secondary:      #4aa3ff;
  --color-accent:         #f7b955;

  --color-bg:             #0b1416;
  --color-card:           #1a1a1b;
  --color-border:         #343536;
  --color-border-light:   #272729;

  --color-text-primary:   #d7dadc;
  --color-text-secondary: #b7bbbf;
  --color-text-muted:     #818384;
  --color-link:           #4aa3ff;
  --color-link-hover:     #7dbdff;

  --reddit-nav:           #1a1a1b;
  --reddit-vote-bg:       #151516;
  --reddit-hover:         #222426;
  --reddit-input:         #272729;
  --reddit-overlay:       rgba(0, 0, 0, 0.74);

  --shadow-md:            0 2px 16px rgba(0, 0, 0, 0.34);
  --shadow-lg:            0 18px 42px rgba(0, 0, 0, 0.48);
  --shadow-focus:         0 0 0 3px rgba(255, 106, 51, 0.28);
}

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(255, 106, 51, 0.04), transparent 260px),
    var(--color-bg);
}

a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }

.ch-container { max-width: 1180px; }

.ch-layout-3col,
.ch-layout-2col-right { gap: 16px; }

.ch-card,
.ch-widget,
.ch-empty-state,
.ch-forum-posts,
.ch-article-card,
.ch-featured-strip,
.ch-submit-form,
.ch-auth-card,
.ch-modal,
.ch-shop-detail,
.ch-shop-item,
.ch-task-card,
.ch-trade-form-card,
.ch-trade-list-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.ch-card:hover,
.ch-article-card:hover,
.ch-shop-item:hover,
.ch-task-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-border));
  box-shadow: var(--shadow-md);
}

.ch-card-header,
.ch-modal-header {
  background: var(--color-card);
  border-bottom-color: var(--color-border);
}

.ch-card-title,
.ch-sidebar-title,
.ch-widget-title {
  color: var(--color-text-primary);
  letter-spacing: 0;
}

.ch-widget-title {
  border-bottom: 1px solid var(--color-border);
}

.ch-sidebar-right .ch-widget {
  overflow: hidden;
  margin-bottom: 12px;
}

.ch-sidebar-right .ch-widget-title {
  min-height: 42px;
  margin: 0;
  padding: 11px 14px;
  background: var(--reddit-vote-bg);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1;
}

.ch-sidebar-right .ch-widget-title .ch-icon {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.ch-sidebar-right .ch-widget-list li {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color 0.15s ease;
}

.ch-sidebar-right .ch-widget-list li:hover,
.ch-sidebar-right .ch-widget-list li.is-active,
.ch-sidebar-right .ch-widget-list li.is-current {
  background: var(--reddit-hover);
}

.ch-sidebar-right .ch-widget-list li a {
  min-height: 42px;
  color: var(--color-text-primary);
  font-weight: 600;
}

.ch-sidebar-right .ch-widget-list li a:hover {
  color: var(--color-primary);
}

.ch-sidebar-right .ch-widget-count {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--reddit-vote-bg);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ch-sidebar-right .ch-blog-topic-list li.is-active .ch-widget-count {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.ch-sidebar-right .ch-blog-trending-list li {
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 8px 12px;
}

.ch-sidebar-right .ch-blog-trending-list li a {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  white-space: normal;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.ch-sidebar-right .ch-trending-rank {
  width: 24px;
  height: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  margin-top: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--reddit-vote-bg);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ch-sidebar-right .ch-blog-trending-list li:hover .ch-trending-rank,
.ch-sidebar-right .ch-blog-trending-list li.is-current .ch-trending-rank {
  background: var(--color-primary-light);
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-border));
  color: var(--color-primary);
}

.ch-quick-links-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.ch-sidebar-right .ch-quick-links-list li {
  min-height: 0;
  padding: 0;
  border-bottom: 0;
}

.ch-quick-link {
  width: 100%;
  min-height: 38px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ch-quick-link-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--reddit-vote-bg);
  color: var(--color-text-muted);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ch-quick-link-icon .ch-icon {
  width: 15px;
  height: 15px;
}

.ch-quick-link-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-quick-link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  color: var(--color-primary);
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ch-quick-link:hover {
  background: var(--reddit-hover);
  color: var(--color-primary);
}

.ch-quick-link:hover .ch-quick-link-icon {
  background: var(--color-primary-light);
  border-color: color-mix(in srgb, var(--color-primary) 34%, var(--color-border));
  color: var(--color-primary);
}

.ch-quick-link:hover .ch-quick-link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.ch-text-secondary,
.ch-text-muted,
.ch-empty-desc,
.ch-article-excerpt,
.ch-about-text,
.ch-submit-sub,
.ch-auth-sub { color: var(--color-text-secondary) !important; }

.ch-btn {
  height: 34px;
  border-radius: var(--radius-pill);
  border-color: var(--color-border);
  box-shadow: none;
  font-weight: 700;
  transform: none;
}

.ch-btn::before { display: none; }

.ch-btn:hover {
  transform: none;
  box-shadow: none;
}

.ch-btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.ch-btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

.ch-btn-outline {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.ch-btn-outline:hover,
.ch-btn-ghost:hover {
  background: var(--reddit-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ch-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
}

.ch-btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.ch-btn-sm { height: 30px; }
.ch-btn-lg { height: 42px; }

.ch-badge,
.ch-cat-chip,
.ch-thread-cat-link,
.ch-article-cat-pill,
.ch-featured-cat,
.ch-invite-badge {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--reddit-vote-bg);
  color: var(--color-text-secondary);
  box-shadow: none;
}

.ch-badge-warning,
.ch-thread-pin {
  background: color-mix(in srgb, var(--color-accent) 16%, var(--color-card));
  color: #a35c00;
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
}

.ch-badge-danger,
.ch-flag-hot {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}

/* Header */
.ch-nav {
  background: var(--reddit-nav);
  border-bottom: 1px solid var(--color-border);
}

.ch-nav-sticky.is-scrolled { box-shadow: 0 1px 0 var(--color-border); }

.ch-logo-text {
  color: var(--color-text-primary);
  font-size: 18px;
  font-weight: 800;
}

.ch-logo-mark {
  position: relative;
  border-radius: 50%;
  background: transparent;
}

.ch-logo-mark::after {
  content: none;
}

.ch-nav-menu li a,
.ch-nav-menu-fallback a {
  color: var(--color-text-secondary);
  border-bottom: 0;
}

.ch-nav-menu li a:hover,
.ch-nav-menu li.current-menu-item > a,
.ch-nav-menu li.current-page-ancestor > a,
.ch-nav-menu-fallback a:hover {
  color: var(--color-primary);
  border-bottom: 0;
  background: var(--reddit-hover);
}

.ch-search-form {
  background: var(--reddit-input);
  border-color: var(--color-border);
}

.ch-search-form:focus-within {
  background: var(--color-card);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-focus);
}

.ch-compose-menu,
.ch-user-menu,
.ch-nav-cards-menu,
.ch-notif-dropdown,
.ch-mobile-nav {
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg);
}

.ch-compose-item:hover,
.ch-user-menu a:hover,
.ch-nav-cards-item:hover,
.ch-language-option:hover,
.ch-notif-item:hover,
.ch-mobile-menu a:hover {
  background: var(--reddit-hover) !important;
  color: var(--color-primary) !important;
}

.ch-theme-toggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.ch-theme-toggle:hover {
  background: var(--reddit-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ch-theme-toggle .ch-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.ch-theme-toggle svg { pointer-events: none; }

.ch-theme-toggle-mobile {
  width: 100%;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.ch-mobile-overlay.is-visible { background: var(--reddit-overlay); }

/* Forum feed */
.ch-forum-page,
.ch-blog-body,
.ch-blog-single,
.ch-index-main,
.ch-rankings-page,
.ch-tasks-page,
.ch-shop-page,
.ch-trade-page,
.ch-synthesis-page,
.ch-backpack-page {
  color: var(--color-text-primary);
}

.ch-tabs,
.ch-forum-tabs,
.ch-blog-tabs-wrap,
.ch-shop-tabs,
.ch-rankings-tabs {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 6px;
}

.ch-tab,
.ch-blog-tab {
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
}

.ch-tab:hover,
.ch-blog-tab:hover {
  background: var(--reddit-hover);
  color: var(--color-text-primary);
}

.ch-tab.is-active,
.ch-blog-tab.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 34%, transparent);
}

.ch-cat-nav,
.ch-card-links .ch-card-body { gap: 4px; }

.ch-cat-item {
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
}

.ch-cat-item:hover,
.ch-cat-item.is-active {
  background: var(--reddit-hover);
  color: var(--color-primary);
}

.ch-forum-posts {
  overflow: hidden;
}

.ch-forum-posts-header {
  background: var(--reddit-vote-bg);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.ch-thread-row {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.ch-thread-row:hover {
  background: var(--reddit-hover);
}

.ch-thread-row.is-pinned {
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-card));
}

.ch-thread-icon {
  align-self: stretch;
  width: 42px;
  height: auto;
  min-height: 46px;
  background: var(--reddit-vote-bg);
  border-right: 1px solid var(--color-border-light);
  border-radius: 0;
  color: var(--color-primary);
}

.ch-thread-vote-icon {
  width: 22px;
  height: 22px;
}

.ch-thread-title a,
.ch-article-title a,
.ch-related-title,
.ch-hot-title,
.ch-trending-title {
  color: var(--color-text-primary);
}

.ch-thread-title a:hover,
.ch-article-title a:hover,
.ch-related-title:hover,
.ch-hot-title:hover,
.ch-trending-title:hover {
  color: var(--color-link);
}

.ch-thread-stat strong,
.ch-stat-number,
.ch-currency-value {
  color: var(--color-text-primary);
}

.ch-thread-stat span,
.ch-thread-meta,
.ch-thread-last-time,
.ch-article-meta {
  color: var(--color-text-muted);
}

/* Blog feed */
.ch-blog-landing-head {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

.ch-blog-landing-copy h1 {
  color: var(--color-text-primary);
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
}

.ch-blog-kicker {
  color: var(--color-primary);
  letter-spacing: 0.04em;
}

.ch-blog-search-card {
  background: var(--reddit-vote-bg);
  border: 1px solid var(--color-border);
  box-shadow: none;
}

.ch-blog-landing-stats span {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ch-blog-search-card input,
.ch-blog-search-card input:focus {
  background: transparent;
  color: var(--color-text-primary);
}

.ch-article-card,
.ch-featured-strip {
  border-radius: var(--radius-md);
}

.ch-article-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--color-primary) 32%, var(--color-border));
}

.ch-article-thumb,
.ch-featured-media,
.ch-shop-item-img,
.ch-shop-detail-media {
  background: var(--reddit-vote-bg);
}

.ch-article-cat-pill {
  background: color-mix(in srgb, var(--color-card) 88%, transparent);
  backdrop-filter: blur(8px);
}

.ch-article-readmore,
.ch-article-stat {
  color: var(--color-text-secondary);
}

.ch-article-stat {
  background: var(--reddit-vote-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.ch-article-stat:hover,
.ch-article-stat.is-liked {
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 42%, var(--color-border));
  background: var(--color-primary-light);
}

/* Inputs and forms */
.ch-input,
.ch-submit-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  background: var(--reddit-input);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.ch-input:focus,
.ch-submit-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

::placeholder {
  color: var(--color-text-muted);
}

/* Card system and dialogs */
.ch-modal-overlay {
  background: var(--reddit-overlay);
  backdrop-filter: blur(8px);
}

.ch-modal-close {
  background: var(--reddit-vote-bg);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

body.ch-private-message-open {
  overflow: hidden;
}

.ch-private-message-overlay {
  align-items: center;
  justify-content: center;
}

.ch-private-message-modal {
  width: min(540px, calc(100vw - 32px));
  max-width: 540px;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.ch-private-message-modal .ch-modal-header {
  min-height: 52px;
  padding: 0 16px;
  background: var(--color-card);
}

.ch-private-message-modal .ch-modal-title {
  font-size: 16px;
  font-weight: 800;
}

.ch-private-message-modal .ch-modal-header .ch-modal-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
}

.ch-private-message-modal .ch-modal-header .ch-modal-close:hover,
.ch-private-message-modal .ch-modal-header .ch-modal-close:focus-visible {
  background: var(--reddit-hover);
  border-color: var(--color-border);
  color: var(--color-text-primary);
  outline: none;
}

.ch-private-message-modal .ch-modal-body {
  padding: 16px;
}

.ch-message-recipient {
  min-height: 22px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.3;
}

.ch-message-recipient-label {
  color: var(--color-text-muted);
  font-weight: 800;
}

.ch-message-recipient-name {
  color: var(--color-text-secondary);
  font-weight: 800;
}

.ch-private-message-modal #ch-private-message-body {
  display: block;
  min-height: 118px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  line-height: 1.45;
}

.ch-private-message-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: nowrap;
}

.ch-private-message-actions .ch-btn {
  flex: 0 0 auto;
  min-width: 132px;
}

.ch-private-message-actions .ch-btn-ghost {
  border-color: var(--color-border);
}

.ch-draw-stage,
.ch-furnace-stage {
  border: 1px solid var(--color-border);
}

html[data-theme="dark"] .ch-trade-page .ch-backpack-header {
  background:
    linear-gradient(135deg, rgba(26, 26, 27, 0.96), rgba(11, 20, 22, 0.94)),
    linear-gradient(90deg, rgba(255, 106, 51, 0.14), rgba(74, 163, 255, 0.08));
  border-color: var(--color-border);
  box-shadow: none;
}

html[data-theme="dark"] .ch-trade-page .ch-backpack-header .ch-page-headline {
  color: var(--color-text-primary);
}

html[data-theme="dark"] .ch-trade-page .ch-album-subtitle {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .ch-trade-page .ch-empty-state {
  background: var(--reddit-vote-bg);
  border-color: var(--color-border);
}

.ch-gallery-page.ch-backpack-page {
  background: transparent;
}

.ch-backpack-page .ch-gallery-progress,
.ch-backpack-page .ch-gallery-controls,
.ch-album-card {
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: none;
}

.ch-album-card.is-unowned,
.ch-card-back-tile {
  background-color: var(--reddit-vote-bg);
}

html[data-theme="dark"] .ch-album-card.is-unowned {
  background: #121314;
}

html[data-theme="dark"] .ch-album-card.is-unowned img {
  filter: grayscale(1) saturate(0) contrast(0.78) brightness(0.94);
}

.ch-card-focus-overlay {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.ch-card-focus-actions .ch-btn {
  border-width: 2px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.ch-card-focus-actions .ch-btn:hover {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.ch-card-focus-actions .ch-btn-primary {
  background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary));
  border-color: color-mix(in srgb, var(--color-primary) 82%, #fff);
}

.ch-card-focus-actions .ch-btn-outline {
  background: linear-gradient(180deg, #228be6, #0079d3);
  border-color: #5db7ff;
  color: #fff;
}

.ch-card-focus-actions .ch-btn-ghost {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.ch-card-focus-actions .ch-btn:disabled {
  background: rgba(129, 131, 132, 0.28);
  border-color: rgba(129, 131, 132, 0.34);
  color: rgba(255, 255, 255, 0.6);
  text-shadow: none;
  box-shadow: none;
}

html[data-theme="dark"] .ch-card-item-card img,
html[data-theme="dark"] .ch-article-thumb img,
html[data-theme="dark"] .ch-featured-media img,
html[data-theme="dark"] .ch-shop-item-img img,
html[data-theme="dark"] .ch-shop-detail-media img {
  filter: brightness(0.86) saturate(0.92);
}

html[data-theme="dark"] .ch-card-focus-card img,
html[data-theme="dark"] .ch-result-card-img img,
html[data-theme="dark"] .ch-card-detail-face img {
  filter: none;
}

.ch-toast {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .ch-layout-3col,
  .ch-layout-2col-right {
    grid-template-columns: 1fr;
  }

  .ch-thread-icon {
    width: 36px;
    min-height: 42px;
  }
}

@media (max-width: 768px) {
  .ch-theme-toggle:not(.ch-theme-toggle-mobile) {
    display: none;
  }

  .ch-forum-posts .ch-forum-posts-header,
  .ch-forum-posts-header {
    display: none;
  }

  .ch-thread-row {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
  }

  .ch-thread-icon {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
  }

  .ch-tabs,
  .ch-forum-tabs,
  .ch-blog-tabs-wrap,
  .ch-shop-tabs,
  .ch-rankings-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 600px) {
  .ch-private-message-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .ch-private-message-modal {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 52px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  .ch-private-message-modal .ch-modal-header {
    padding-inline: 14px;
  }

  .ch-private-message-modal .ch-modal-body {
    padding: 14px;
  }

  .ch-private-message-modal #ch-private-message-body {
    min-height: 132px;
  }

  .ch-private-message-actions {
    flex-direction: column;
  }

  .ch-private-message-actions .ch-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .ch-forum-single-page .ch-breadcrumbs {
    padding-block: 12px;
    line-height: 1.35;
  }

  .ch-forum-single-header,
  .ch-forum-single-body,
  .ch-comment-area.ch-card {
    border-radius: var(--radius-md);
  }

  .ch-forum-single-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }

  .ch-forum-single-meta {
    gap: 6px 8px;
  }

  .ch-forum-single-meta .ch-stat {
    width: auto;
  }

  .ch-single-content {
    overflow-wrap: anywhere;
  }

  .ch-forum-action-bar {
    padding-top: 12px;
  }

  .ch-forum-action-bar .ch-btn {
    flex: 1 1 auto;
    height: 34px;
  }

  .ch-forum-action-bar .ch-share-btn {
    flex-basis: 100%;
  }

  .ch-related-grid {
    grid-template-columns: 1fr;
  }

  .ch-post-card-reward {
    align-items: start;
    padding: 14px;
    margin: 16px 0;
    line-height: 1.45;
  }

  .ch-post-card-reward .ch-icon {
    margin-top: 2px;
  }

  .ch-comment-list {
    gap: 10px !important;
  }

  .ch-comment-inner {
    gap: 10px !important;
  }
}
