/* CORVASEC FIX66.73 — Mobile Community Theme
   Mobile-only presentation layer. Desktop/classic forum remains unchanged. */

@media (max-width: 860px) {
  body.hybrid-forum-shell {
    --cvm-gap: 12px;
    --cvm-radius: 14px;
    --cvm-touch: 44px;
    overflow-x: hidden;
  }

  body.hybrid-forum-shell .hybrid-extension-main,
  body.hybrid-forum-shell .forum-shell,
  body.hybrid-forum-shell .forum-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.hybrid-forum-shell .forum-shell {
    padding-inline: 10px !important;
    padding-bottom: 78px !important;
  }

  body.hybrid-forum-shell .forum-main {
    padding: 10px 0 0 !important;
  }

  /* Community utility navigation: scrollable, thumb-friendly chips. */
  body.hybrid-forum-shell .forum-utilitybar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 0 !important;
    overflow: hidden !important;
  }

  body.hybrid-forum-shell .forum-primary-nav {
    display: flex !important;
    flex: 1 1 auto !important;
    gap: 6px !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  body.hybrid-forum-shell .forum-primary-nav::-webkit-scrollbar { display: none; }
  body.hybrid-forum-shell .forum-primary-nav a {
    flex: 0 0 auto !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    scroll-snap-align: start;
  }

  body.hybrid-forum-shell .forum-header-actions {
    flex: 0 0 auto !important;
    gap: 5px !important;
  }
  body.hybrid-forum-shell .forum-header-actions .forum-icon-link,
  body.hybrid-forum-shell .forum-header-actions .forum-button {
    min-width: 40px !important;
    min-height: 40px !important;
  }

  /* Breadcrumb/title band. */
  body.hybrid-forum-shell .forum-titlebar {
    display: block !important;
    padding: 9px 11px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  body.hybrid-forum-shell .forum-titlebar > div {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    white-space: nowrap !important;
  }
  body.hybrid-forum-shell .forum-titlebar > div::-webkit-scrollbar { display: none; }
  body.hybrid-forum-shell .forum-titlebar > span {
    display: none !important;
  }

  /* Shared headings/cards/forms. */
  body.hybrid-forum-shell .forum-page-heading {
    padding: 8px 2px 4px !important;
    margin-bottom: 8px !important;
  }
  body.hybrid-forum-shell .forum-page-heading h1 {
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.05 !important;
  }
  body.hybrid-forum-shell .forum-page-heading p {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body.hybrid-forum-shell .forum-card,
  body.hybrid-forum-shell .forum-form-card,
  body.hybrid-forum-shell .forum-side-card {
    border-radius: var(--cvm-radius) !important;
  }

  body.hybrid-forum-shell input:not([type="checkbox"]):not([type="radio"]),
  body.hybrid-forum-shell select,
  body.hybrid-forum-shell textarea,
  body.hybrid-forum-shell button,
  body.hybrid-forum-shell .forum-button {
    font-size: 16px !important;
  }
  body.hybrid-forum-shell input:not([type="checkbox"]):not([type="radio"]),
  body.hybrid-forum-shell select,
  body.hybrid-forum-shell button,
  body.hybrid-forum-shell .forum-button {
    min-height: var(--cvm-touch) !important;
  }
  body.hybrid-forum-shell textarea {
    min-height: 150px !important;
    line-height: 1.55 !important;
  }

  body.hybrid-forum-shell .forum-form-grid,
  body.hybrid-forum-shell .forum-search-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.hybrid-forum-shell .forum-form-grid > *,
  body.hybrid-forum-shell .forum-search-form > * {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  body.hybrid-forum-shell .forum-form-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  body.hybrid-forum-shell .forum-form-actions > * {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Forum home. */
  body.hybrid-forum-shell .forum-home-welcome {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: var(--cvm-radius) !important;
  }
  body.hybrid-forum-shell .forum-home-welcome-copy {
    align-items: flex-start !important;
  }
  body.hybrid-forum-shell .forum-home-inline-search {
    width: 100% !important;
  }
  body.hybrid-forum-shell .forum-home-inline-search input {
    width: 100% !important;
  }

  body.hybrid-forum-shell .forum-home-category {
    border-radius: var(--cvm-radius) !important;
    overflow: hidden !important;
    margin-bottom: 10px !important;
  }
  body.hybrid-forum-shell .forum-home-category > summary {
    min-height: 54px !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 2px 8px !important;
    align-items: center !important;
    padding: 10px 12px !important;
  }
  body.hybrid-forum-shell .forum-home-category-title { grid-column: 1; }
  body.hybrid-forum-shell .forum-home-category-desc {
    grid-column: 1 !important;
    white-space: normal !important;
    line-height: 1.35 !important;
  }
  body.hybrid-forum-shell .forum-home-category-toggle {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
  }
  body.hybrid-forum-shell .forum-home-column-head { display: none !important; }

  body.hybrid-forum-shell .forum-home-board-row {
    display: grid !important;
    grid-template-columns: 38px minmax(0,1fr) !important;
    gap: 6px 10px !important;
    padding: 12px !important;
  }
  body.hybrid-forum-shell .forum-home-board-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 38px !important;
    height: 38px !important;
  }
  body.hybrid-forum-shell .forum-home-board-copy {
    grid-column: 2 !important;
    min-width: 0 !important;
  }
  body.hybrid-forum-shell .forum-home-board-copy > a {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }
  body.hybrid-forum-shell .forum-home-board-copy p,
  body.hybrid-forum-shell .forum-home-subforums {
    font-size: 12px !important;
    line-height: 1.45 !important;
  }
  body.hybrid-forum-shell .forum-home-lastpost {
    grid-column: 1 / -1 !important;
    margin-top: 4px !important;
    padding: 9px 10px !important;
    border-radius: 9px !important;
    text-align: left !important;
  }
  body.hybrid-forum-shell .forum-home-lastpost-title {
    display: block !important;
    font-size: 12px !important;
    white-space: normal !important;
  }

  body.hybrid-forum-shell .forum-home-community-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.hybrid-forum-shell .forum-home-stat-metrics {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
  body.hybrid-forum-shell .forum-home-lower-links {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Board view: table rows become readable topic cards. */
  body.hybrid-forum-shell .forum-classic-actionline {
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  body.hybrid-forum-shell .forum-classic-actionline-left,
  body.hybrid-forum-shell .forum-classic-actionline-right {
    width: 100% !important;
  }
  body.hybrid-forum-shell .forum-classic-actionline-right {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  body.hybrid-forum-shell .forum-classic-new-topic {
    margin-left: auto !important;
    min-height: 42px !important;
    padding-inline: 14px !important;
    border-radius: 10px !important;
  }
  body.hybrid-forum-shell .forum-classic-board-head {
    padding: 14px !important;
    border-radius: var(--cvm-radius) !important;
  }
  body.hybrid-forum-shell .forum-classic-board-head h1 {
    font-size: 26px !important;
    line-height: 1.08 !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-head,
  body.hybrid-forum-shell .forum-classic-darkhead { display: none !important; }

  body.hybrid-forum-shell .forum-classic-topic-list,
  body.hybrid-forum-shell .forum-classic-subforums {
    border-radius: var(--cvm-radius) !important;
    overflow: hidden !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-row {
    display: grid !important;
    grid-template-columns: 34px minmax(0,1fr) !important;
    grid-template-areas:
      "icon copy"
      "stats stats"
      "last last" !important;
    gap: 6px 10px !important;
    padding: 12px !important;
    min-height: 0 !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-row .forum-classic-topic-icon {
    grid-area: icon !important;
    width: 32px !important;
    height: 32px !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-copy {
    grid-area: copy !important;
    min-width: 0 !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-copy strong {
    font-size: 15px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-copy small {
    display: block !important;
    margin-top: 4px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-stat {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    min-height: 24px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
  }
  body.hybrid-forum-shell .forum-classic-topic-row > .forum-classic-topic-stat:nth-child(3)::before { content: "Replies "; opacity: .7; }
  body.hybrid-forum-shell .forum-classic-topic-row > .forum-classic-topic-stat:nth-child(4)::before { content: "Views "; opacity: .7; }
  body.hybrid-forum-shell .forum-classic-topic-row > .forum-classic-topic-stat:nth-child(3) { grid-area: stats !important; justify-self: start !important; }
  body.hybrid-forum-shell .forum-classic-topic-row > .forum-classic-topic-stat:nth-child(4) { grid-area: stats !important; justify-self: start !important; margin-left: 82px !important; }
  body.hybrid-forum-shell .forum-classic-lastpost {
    grid-area: last !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 8px !important;
    align-items: center !important;
    padding-top: 7px !important;
    border-top: 1px solid color-mix(in srgb,currentColor 12%,transparent) !important;
    text-align: left !important;
  }
  body.hybrid-forum-shell .forum-classic-lastpost strong,
  body.hybrid-forum-shell .forum-classic-lastpost small {
    font-size: 11px !important;
  }

  body.hybrid-forum-shell .forum-classic-subforum-row {
    display: grid !important;
    grid-template-columns: 34px minmax(0,1fr) !important;
    gap: 4px 10px !important;
    padding: 11px 12px !important;
  }
  body.hybrid-forum-shell .forum-classic-subforum-row strong,
  body.hybrid-forum-shell .forum-classic-subforum-row small {
    grid-column: 2 !important;
  }

  /* Thread view. */
  body.hybrid-forum-shell .forum-thread-breadcrumbs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none;
    padding-bottom: 3px !important;
  }
  body.hybrid-forum-shell .forum-thread-breadcrumbs::-webkit-scrollbar { display: none; }
  body.hybrid-forum-shell .forum-thread-prebar,
  body.hybrid-forum-shell .forum-thread-toolsbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  body.hybrid-forum-shell .forum-thread-reply-launch,
  body.hybrid-forum-shell .forum-thread-tools-right {
    width: 100% !important;
  }
  body.hybrid-forum-shell .forum-thread-blue-button {
    min-height: 42px !important;
    width: 100% !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }
  body.hybrid-forum-shell .forum-thread-pager {
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none;
  }
  body.hybrid-forum-shell .forum-thread-tools-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  body.hybrid-forum-shell .forum-thread-tools-right > * {
    min-height: 40px !important;
  }
  body.hybrid-forum-shell .forum-thread-post {
    border-radius: var(--cvm-radius) !important;
    overflow: hidden !important;
    margin-bottom: 12px !important;
  }
  body.hybrid-forum-shell .forum-thread-author {
    grid-template-columns: 48px minmax(0,1fr) !important;
    padding: 9px 10px !important;
  }
  body.hybrid-forum-shell .forum-thread-avatar {
    width: 48px !important;
    height: 48px !important;
  }
  body.hybrid-forum-shell .forum-thread-author-stats {
    grid-template-columns: repeat(4,minmax(0,1fr)) !important;
    gap: 0 !important;
  }
  body.hybrid-forum-shell .forum-thread-post-title {
    padding: 8px 12px !important;
    min-height: 0 !important;
    font-size: 12px !important;
  }
  body.hybrid-forum-shell .forum-thread-post .forum-post-body {
    padding: 13px 12px !important;
    font-size: 15px !important;
    line-height: 1.62 !important;
    overflow-wrap: anywhere !important;
  }
  body.hybrid-forum-shell .forum-thread-post .forum-post-body img,
  body.hybrid-forum-shell .forum-thread-post .forum-post-body video,
  body.hybrid-forum-shell .forum-thread-post .forum-post-body iframe {
    max-width: 100% !important;
    height: auto !important;
  }
  body.hybrid-forum-shell .forum-thread-post .forum-post-body pre,
  body.hybrid-forum-shell .forum-thread-post .forum-post-body code {
    max-width: 100% !important;
    overflow-x: auto !important;
  }
  body.hybrid-forum-shell .forum-thread-quote {
    margin: 8px 10px 0 !important;
    padding: 9px 10px !important;
  }
  body.hybrid-forum-shell .forum-thread-post-actions {
    display: block !important;
    padding: 7px 9px !important;
  }
  body.hybrid-forum-shell .forum-thread-post-buttons {
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 2px !important;
    scrollbar-width: none;
  }
  body.hybrid-forum-shell .forum-thread-post-buttons::-webkit-scrollbar { display: none; }
  body.hybrid-forum-shell .forum-thread-action {
    min-height: 38px !important;
    flex: 0 0 auto !important;
    padding-inline: 12px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }
  body.hybrid-forum-shell .forum-thread-reaction-summary {
    display: block !important;
    margin-top: 6px !important;
    white-space: normal !important;
  }
  body.hybrid-forum-shell .forum-thread-reply form {
    padding: 10px !important;
    border-radius: var(--cvm-radius) !important;
  }
  body.hybrid-forum-shell .forum-thread-reply textarea {
    min-height: 150px !important;
    height: auto !important;
  }

  /* Search and lists. */
  body.hybrid-forum-shell .forum-search-results {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.hybrid-forum-shell .forum-recent-topic {
    min-height: 58px !important;
    padding: 10px !important;
  }

  /* Generic mobile safety for account/profile/message/community pages. */
  body.hybrid-forum-shell table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body.hybrid-forum-shell .forum-grid,
  body.hybrid-forum-shell .forum-profile-grid,
  body.hybrid-forum-shell .forum-settings-grid,
  body.hybrid-forum-shell .forum-message-grid {
    grid-template-columns: 1fr !important;
  }

  body.hybrid-forum-shell .forum-notice {
    border-radius: 10px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

}


@media (max-width: 520px) {
  body.hybrid-forum-shell .forum-shell { padding-inline: 7px !important; }
  body.hybrid-forum-shell .forum-header-actions .forum-button { padding-inline: 9px !important; }
  body.hybrid-forum-shell .forum-home-stat-metrics { gap: 6px !important; }
  body.hybrid-forum-shell .forum-form-actions { grid-template-columns: 1fr !important; }
  body.hybrid-forum-shell .forum-classic-new-topic { width: 100% !important; margin-left: 0 !important; justify-content: center !important; }
  body.hybrid-forum-shell .forum-thread-tools-right { grid-template-columns: 1fr !important; }
  body.hybrid-forum-shell .forum-thread-author-stats { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

