@media (max-width: 1199.98px) {
  .sv-forum-overview-stats > div {
    min-width: 62px;
    padding-right: 10px;
    padding-left: 10px;
  }
}

@media (max-width: 991.98px) {
  body:not(.sv-no-bottom-nav) {
    padding-bottom: calc(var(--sv-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  #body {
    min-height: calc(100vh - var(--sv-mobile-header-height));
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .container {
    width: min(100% - 24px, var(--sv-content-width));
  }

  .sv-header,
  .sv-header-inner {
    height: var(--sv-mobile-header-height);
    min-height: var(--sv-mobile-header-height);
  }

  .sv-header-inner {
    gap: 4px;
  }

  .sv-header-inner > .sv-icon-button:first-child {
    margin-left: -5px;
  }

  .sv-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .sv-brand-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .sv-brand-copy { margin-left: 0; }

  .sv-brand-copy strong {
    max-width: min(50vw, 230px);
    font-size: 14px;
  }

  .sv-header-actions {
    margin: 0 -5px 0 0;
    gap: 0;
  }

  .sv-icon-button,
  .sv-avatar-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .sv-home-page #body {
    padding-top: 0;
  }

  .sv-valley-hero {
    height: 180px;
    margin-top: calc(var(--sv-mobile-header-height) * -1);
    padding-top: var(--sv-mobile-header-height);
  }

  .sv-valley-hero-copy {
    max-width: 78%;
    padding: 13px 0 10px;
  }

  .sv-hero-stats {
    position: static;
    margin-top: 9px;
  }

  .sv-valley-hero h1 {
    font-size: 22px;
  }

  .sv-valley-hero-copy > p {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .sv-forum-overview {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sv-forum-overview-stats {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--sv-line);
  }

  .sv-forum-overview-stats > div {
    flex: 1 1 0;
  }

  .sv-thread-panel .threadlist > .thread,
  .threadlist > .thread {
    min-height: 70px;
    padding: 10px 12px;
  }

  .sv-thread-panel .threadlist > .thread > a,
  .threadlist > .thread > a {
    margin: 1px 10px 0 0 !important;
  }

  .sv-thread-panel .threadlist > .thread > a img.avatar-3,
  .threadlist > .thread > a img.avatar-3 {
    width: 38px;
    height: 38px;
  }

  .threadlist .subject {
    font-size: 14px;
  }

  .card-thread,
  .card-postlist,
  #body .row > .main > .card:not(.sv-thread-panel) {
    box-shadow: none;
  }
}

@media (max-width: 767.98px) {
  .sv-header-plugin-actions .nav-link {
    justify-content: center;
    width: 38px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .sv-header-plugin-actions .nav-link i {
    font-size: 18px;
  }

  .sv-header-user-hooks .nav-link {
    width: 38px;
    height: 38px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .sv-header-user-hooks .nav-link i {
    font-size: 18px;
  }

  .sv-header-user-hooks.sv-has-theme-search > li:has(.icon-search) {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .sv-forum-grid {
    grid-template-columns: 1fr;
  }

  .sv-forum-item {
    min-height: 62px;
  }

  .breadcrumb.d-none.d-md-flex {
    display: flex !important;
  }

  .breadcrumb-item:last-child {
    display: none;
  }

  .sv-forum-overview {
    padding: 14px;
  }

  .sv-forum-overview-icon {
    width: 46px;
    height: 46px;
  }

  .sv-forum-overview h1 {
    font-size: 18px;
  }

  .sv-forum-brief {
    -webkit-line-clamp: 1;
  }

  .sv-forum-tabbar {
    padding-right: 5px;
    padding-left: 5px;
  }

  .sv-forum-create {
    width: 34px;
    flex: 0 0 34px;
    padding: 0;
    justify-content: center;
  }

  .sv-forum-create span {
    display: none;
  }

  .card-thread > .card-body {
    padding: 15px 14px;
  }

  .card-thread h4,
  .card-thread .card-title {
    font-size: 18px;
  }

  .card-thread > .card-body > .d-flex .small {
    align-items: flex-start;
    gap: 6px;
  }

  .card-thread > .card-body > .d-flex .small > div:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card-postlist > .card-body {
    padding: 0 14px;
  }

  .card-postlist .postlist > li {
    padding: 14px 0;
  }

  .card-postlist .postlist > li > a:first-child {
    margin-right: 10px !important;
  }

  .card-postlist .postlist > li > a:first-child img.avatar-3 {
    width: 36px;
    height: 36px;
  }

  .card-postlist .postlist .d-flex.justify-content-between.small.text-muted {
    align-items: flex-start;
    gap: 6px;
  }

  .card-postlist .postlist .d-flex.justify-content-between.small.text-muted > div:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card-postlist .postlist .d-flex.justify-content-between.small.text-muted > div:last-child {
    min-width: max-content;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: 14px;
  }

  #body {
    padding-top: 8px;
  }

  .container {
    width: calc(100% - 20px);
  }

  .sv-home-page #body {
    padding-top: 0;
  }

  .sv-valley-hero {
    height: 180px;
    margin-bottom: 10px;
    border-bottom: 2px solid rgba(216, 162, 52, 0.75);
  }

  .sv-valley-hero-art {
    object-position: 56% 50%;
  }

  .sv-valley-hero-copy {
    max-width: 92%;
  }

  .sv-valley-hero h1 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 19px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sv-valley-hero-copy > p {
    display: none;
  }

  .sv-hero-stats {
    margin-top: 4px;
    padding: 3px 2px;
  }

  .sv-hero-stats > div {
    min-width: 52px;
    padding: 0 6px;
  }

  .sv-hero-stats dt {
    font-size: 8px;
    line-height: 1.15;
  }

  .sv-hero-stats dd {
    font-size: 13px;
    line-height: 1.05;
  }

  .sv-announcement {
    min-height: 38px;
    margin-bottom: 9px;
    padding: 7px 34px 7px 21px;
  }

  .sv-announcement span {
    font-size: 12px;
  }

  .sv-feed-header {
    min-height: 41px;
    padding: 0 3px;
  }

  .sv-feed-tabs {
    min-height: 40px;
  }

  .sv-feed-tab {
    min-height: 40px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 12px;
  }

  .sv-feed-tab::after {
    right: 10px;
    left: 10px;
  }

  .sv-thread-panel,
  .card-postlist {
    width: calc(100% + 20px);
    margin-left: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .sv-thread-panel .threadlist > .thread,
  .threadlist > .thread {
    min-height: 66px;
    padding: 9px 10px;
  }

  body.sv-density-compact .threadlist > .thread {
    min-height: 61px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .sv-thread-panel .threadlist > .thread > input[type="checkbox"],
  .threadlist > .thread > input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 5px !important;
  }

  .sv-thread-panel .threadlist > .thread > a,
  .threadlist > .thread > a {
    margin-right: 8px !important;
  }

  .sv-thread-panel .threadlist > .thread > a img.avatar-3,
  .threadlist > .thread > a img.avatar-3 {
    width: 35px;
    height: 35px;
  }

  .threadlist .username,
  .threadlist .date {
    font-size: 11px;
  }

  .threadlist .thread > .flex-grow-1 > .d-flex > div:first-child {
    max-width: calc(100vw - 132px);
  }

  .threadlist .thread > .flex-grow-1 > .d-flex > .text-muted {
    min-width: 34px;
  }

  .sv-thread-badge {
    max-width: 62px;
  }

  .sv-forum-overview,
  .sv-forum-tabbar {
    width: 100%;
    margin-left: 0;
    border-right: 1px solid var(--sv-line);
    border-left: 1px solid var(--sv-line);
    border-radius: 6px;
  }

  .sv-forum-overview {
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px 10px;
  }

  .sv-forum-overview-icon {
    width: 42px;
    height: 42px;
  }

  .sv-forum-overview h1 {
    font-size: 17px;
  }

  .sv-forum-moderators {
    margin-top: 5px;
  }

  .sv-forum-overview-stats {
    padding-top: 9px;
  }

  .sv-forum-overview-stats dt {
    font-size: 10px;
  }

  .sv-forum-overview-stats dd {
    font-size: 15px;
  }

  .sv-forum-tabbar {
    min-height: 42px;
    margin-bottom: 11px;
  }

  .sv-forum-tabs a {
    padding: 0 10px;
    font-size: 12px;
  }

  .sv-forum-tabs a::after {
    right: 10px;
    left: 10px;
  }

  .sv-forum-empty {
    min-height: 132px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 24px 18px;
  }

  .card-thread > .card-body {
    padding: 15px 14px;
  }

  .card-thread > .card-body > .d-flex > a:first-child .avatar-3 {
    width: 38px;
    height: 38px;
    margin-right: 10px !important;
  }

  .card-thread h4,
  .card-thread .card-title {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.42;
  }

  .card-thread > .card-body > hr {
    margin: 12px 0 14px;
  }

  .card-thread .message,
  .card-postlist .postlist .message,
  #quick_reply_form .message {
    font-size: 14px;
    line-height: 1.78;
  }

  .card-thread .plugin {
    margin-top: 17px !important;
    padding-top: 10px;
  }

  .card-postlist > .card-body {
    padding: 0 10px;
  }

  #quick_reply_form,
  .card-postlist .newpost form,
  .card-postlist .newpost .message {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .pagination {
    gap: 3px;
  }

  .page-link {
    min-width: 34px;
    min-height: 34px;
    padding: 5px;
  }

  .sv-forum-sheet .offcanvas-header,
  .sv-forum-sheet .offcanvas-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .sv-my-profile-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    min-height: 0;
    padding: 14px;
  }

  .sv-my-avatar {
    width: 54px;
    height: 54px;
  }

  .sv-my-profile-copy strong {
    font-size: 16px;
  }

  .sv-my-profile-stats {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 11px;
    border-top: 1px solid var(--sv-line);
  }

  .sv-my-profile-stats > span {
    flex: 1 1 0;
  }

  .sv-my-profile-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .sv-my-actions {
    margin-top: 10px;
  }

  .sv-my-actions a {
    min-height: 88px;
    padding: 10px 3px;
  }

  .sv-my-actions .bi {
    font-size: 20px;
  }

  .sv-my-actions strong {
    margin-top: 5px;
    font-size: 11px;
  }

  .sv-my-logout {
    min-height: 44px;
    margin-top: 14px;
  }
}

@media (max-width: 359.98px) {
  .sv-brand-copy strong {
    max-width: 116px;
  }

  .sv-header-actions .sv-icon-button:first-child {
    display: none !important;
  }

  body.sv-mobile-thread-classic .sv-thread-badge {
    display: none;
  }

  .sv-forum-tabs a {
    padding-right: 9px;
    padding-left: 9px;
  }
}

@media (max-width: 767.98px) {
  body.sv-mobile-thread-enhanced .threadlist > .thread,
  body.sv-mobile-thread-enhanced .sv-thread-panel .threadlist > .thread {
    min-height: 82px;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body.sv-mobile-thread-enhanced.sv-density-compact .threadlist > .thread {
    min-height: 74px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 {
    position: relative;
    min-height: 52px;
    padding-right: 44px;
  }

  body.sv-mobile-thread-enhanced .threadlist .subject {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 5px;
    line-height: 1.35;
  }

  body.sv-mobile-thread-enhanced .threadlist .subject > [class^="icon-top-"],
  body.sv-mobile-thread-enhanced .threadlist .subject > [class*=" icon-top-"] {
    position: absolute;
    top: 2px;
    left: 0;
    margin: 0;
    line-height: 1.42;
  }

  body.sv-mobile-thread-enhanced .threadlist .subject > [class^="icon-top-"] ~ a:first-of-type,
  body.sv-mobile-thread-enhanced .threadlist .subject > [class*=" icon-top-"] ~ a:first-of-type {
    padding-left: 18px;
  }

  body.sv-mobile-thread-enhanced .threadlist .subject > a:first-of-type {
    width: 100%;
    max-width: 100%;
    flex: 1 0 100%;
    color: var(--sv-ink);
    line-height: 1.42;
    overflow-wrap: anywhere;
  }

  body.sv-mobile-thread-enhanced.sv-mobile-title-one .threadlist .subject > a:first-of-type {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.sv-mobile-thread-enhanced.sv-mobile-title-two .threadlist .subject > a:first-of-type {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.sv-mobile-thread-enhanced.sv-mobile-title-all .threadlist .subject > a:first-of-type {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body.sv-mobile-thread-enhanced .threadlist .sv-thread-badge,
  body.sv-mobile-thread-enhanced .threadlist .sv-thread-type-badge,
  body.sv-mobile-thread-enhanced .threadlist .xqa-thread-badge {
    display: inline-flex;
    min-height: 19px;
    max-width: min(100%, 118px);
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 2px 6px;
    overflow: hidden;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    vertical-align: 0;
    white-space: nowrap;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex {
    position: static;
    min-height: 18px;
    align-items: center;
    margin-top: 5px !important;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > div:first-child {
    display: flex;
    width: 100%;
    max-width: none;
    min-width: 0;
    align-items: center;
    padding-right: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > div:first-child > span {
    min-width: 0;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > div:first-child > span > .text-grey:last-child,
  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > div:first-child > .date {
    display: none !important;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > .text-muted {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 34px;
    line-height: 1;
  }

  body.sv-mobile-thread-enhanced .threadlist .thread > .flex-grow-1 > .d-flex > .text-muted span:last-child {
    min-width: 34px;
    height: 22px;
    padding: 0 6px;
  }

  body.sv-mobile-thread-enhanced .threadlist .sv-thread-mobile-time {
    position: absolute;
    right: 0;
    bottom: 0;
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding-left: 5px;
    color: var(--sv-muted);
    background: var(--sv-paper);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 17px;
    white-space: nowrap;
  }

  body.sv-mobile-thread-enhanced .threadlist .sv-thread-mobile-time .bi {
    font-size: 10px;
  }
}

@media print {
  .sv-header,
  .sv-bottom-nav,
  .sv-valley-hero,
  .sv-home-aside,
  .sv-feed-compose,
  .sv-forum-create,
  .sv-my-logout {
    display: none !important;
  }

  body,
  #body,
  .card,
  .threadlist > .thread {
    color: #000;
    background: #fff;
    box-shadow: none;
  }

  .container {
    width: 100%;
    max-width: none;
  }
}
