/* These wrappers leave the existing desktop flex/table layout intact. */
.intranet-account,
.employee-table-scroll {
  display: contents;
}

/* Tablet pilot only: desktop remains the reference from 1200 CSS pixels. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-navbar .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
  }

  .intranet-navbar .navbar-collapse {
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: .5rem;
  }

  .intranet-navbar .nav-link,
  .intranet-navbar .dropdown-item {
    min-height: 44px;
    padding-top: .625rem;
    padding-bottom: .625rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .intranet-navbar .dropdown-menu {
    min-width: 0;
    max-width: 100%;
  }

  .intranet-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
  }

  .intranet-cockpit,
  .intranet-employees,
  .intranet-employee-details {
    overflow-wrap: anywhere;
  }

  .cockpit-summary > .cockpit-company {
    width: 66.666667%;
  }

  .cockpit-summary > .cockpit-spacer {
    display: none;
  }

  .cockpit-company img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
  }

  .cockpit-hints .alert .row > .col-6 {
    width: 100%;
  }

  .cockpit-modules > .col {
    width: 50%;
  }

  .employee-page-header > .col-10,
  .employee-page-header > .col-2,
  .employee-details-layout > .col-10,
  .employee-details-layout > .col-2 {
    width: 100%;
  }

  .employee-page-header > .col-2 {
    text-align: left !important;
  }

  .employee-page-header .d-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 36rem;
  }

  .employee-page-header .btn,
  .intranet-employee-details .dropdown-toggle,
  .intranet-employee-details .nav-tabs .nav-link {
    min-height: 44px;
  }

  .employee-table-scroll {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .intranet-employee-table {
    min-width: 64rem;
  }

  /* The floating clone cannot follow a touch-scrolled table horizontally. */
  .intranet-employee-table.tablesorter-stickyHeader {
    display: none !important;
  }

  .intranet-employees .tablesorter-pager > .d-flex {
    flex-wrap: wrap;
  }

  .intranet-employee-details #employeeTab {
    flex-wrap: wrap;
  }

  .employee-details-layout > .col-2 {
    margin-top: 1rem !important;
    text-align: left !important;
  }

  .employee-master-fields > [class^="col-"] {
    width: 50%;
    padding-bottom: 1rem;
  }

  .employee-master-fields img {
    max-width: 100%;
    height: auto;
  }

  .intranet-employee-details .dropdown-menu {
    max-width: calc(100vw - 3rem);
  }

  .intranet-employee-details .dropdown-item {
    white-space: normal;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .cockpit-summary > .cockpit-company,
  .cockpit-summary > .cockpit-hints {
    width: 100%;
  }

  .cockpit-hints #allHints > .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Employee forms and additional detail tabs: retain every desktop grid class. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-employee-form,
  .employee-form-content {
    overflow-wrap: anywhere;
  }

  .employee-form-content form .row > :is(.col-2, .col-3, .col-4, .col-6) {
    width: 50%;
    min-width: 0;
    margin-bottom: 1rem;
  }

  .employee-form-content .nav-tabs,
  .employee-form-content form.d-flex {
    flex-wrap: wrap;
  }

  .employee-form-content .btn,
  .employee-form-content .nav-link,
  .employee-form-content .form-control:not(textarea),
  .employee-form-content .form-select {
    min-height: 44px;
  }

  .employee-form-content .form-select.w-auto {
    max-width: 100%;
  }

  .employee-form-content .form-check-label {
    white-space: normal;
  }

  .employee-wizard > .employee-page-header > .col-6,
  .employee-wizard > .employee-page-header > .col-4 {
    width: 50%;
  }

  .employee-wizard > .employee-page-header > .col-2:empty {
    display: none;
  }

  .intranet-employee-details .tab-pane > .row > .col-3 {
    width: 50%;
    margin-bottom: 1rem;
  }

  .intranet-employee-details #labor > .row > :is(.col-4, .col-8) {
    width: 50%;
  }

  .intranet-employee-details #bank > .row > .col-6 {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .intranet-employee-details #bank > .row > .col-4:empty {
    display: none;
  }

  .intranet-employee-details #bank .d-grid {
    width: 100%;
  }

  .employee-details-layout > .col-10,
  .employee-detail-table-scroll {
    min-width: 0;
  }

  .employee-detail-table-scroll {
    overflow-x: auto;
  }

  .employee-detail-table-scroll > table {
    min-width: 52rem;
  }

  .intranet-employee-details .tablesorter-stickyHeader {
    display: none !important;
  }

  .intranet-employee-details .tablesorter-pager > .d-flex {
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .employee-form-content form .row > :is(.col-3, .col-4, .col-6),
  .employee-form-content #roles > .row > .col-6,
  .employee-wizard > .employee-page-header > .col-6,
  .employee-wizard > .employee-page-header > .col-4,
  .intranet-employee-details #notice .card-body .row > :is(.col-8, .col-4) {
    width: 100%;
  }

  .intranet-employee-details #notice .card-body .text-end {
    text-align: left !important;
    margin-top: .5rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .employee-form-content form .employee-salary-options > .col-6 {
    width: 50%;
  }

  .intranet-employee-form > .employee-page-header > .col-8,
  .intranet-employee-form > .employee-page-header > .col-4 {
    width: 100%;
  }
}


/* Business data, structure, customer management and employee reports. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-company {
    overflow-wrap: anywhere;
  }

  .company-page-header > .col-10,
  .company-page-header > .col-2 {
    width: 100%;
  }

  .company-page-header .d-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 36rem;
  }

  .intranet-company .nav-tabs,
  .intranet-company .tablesorter-pager > .d-flex {
    flex-wrap: wrap;
  }

  .intranet-company .btn,
  .intranet-company .nav-link,
  .intranet-company .form-control:not(textarea),
  .intranet-company .form-select {
    min-height: 44px;
  }

  .intranet-company form .row > :is(.col-2, .col-3, .col-4, .col-5, .col-6, .col-8) {
    width: 50%;
    min-width: 0;
    margin-bottom: 1rem;
  }

  .intranet-company form .businessFields {
    width: 100%;
  }

  .company-master-data #stamm > .row > .col-3 {
    width: 50%;
    margin-bottom: 1rem;
  }

  .company-master-data #bank > .row > :is(.col-9, .col-3),
  .company-master-data #bank .col-8,
  .company-master-data #bank .d-grid {
    width: 100%;
  }

  .company-structure-data #company > .row > :is(.col-9, .col-3),
  .company-structure-data #company .d-grid {
    width: 100%;
  }

  .company-clients > .row > .col-8,
  .company-suppliers > .row > :is(.col-8, .col-3) {
    width: 100%;
  }

  .company-suppliers > .row > .col-1,
  .company-client-details .col-1:empty {
    display: none;
  }

  .company-client-details > .row > .col-12 > .row > :is(.col-4, .col-2) {
    width: 100%;
  }

  .company-client-details .row-cols-md-3 > .col {
    width: 50%;
  }

  .company-table-scroll {
    min-width: 0;
    overflow-x: auto;
  }

  .company-table-scroll > table {
    min-width: 52rem;
  }

  .intranet-company .tablesorter-stickyHeader {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .intranet-company form .row > :is(.col-2, .col-3, .col-4, .col-5, .col-6, .col-8, .col-md-4),
  .company-master-data #bank .col-7,
  .company-master-data #bank .col-5,
  .company-structure-data #company .col-6,
  .company-client-details .row-cols-md-3 > .col {
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .company-clients.container-fluid.px-2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .intranet-company .company-form-spacer,
  .company-client-details .col-1 {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-company select {
    max-width: 100%;
    min-height: 44px;
  }

  .intranet-company .range-wrap {
    margin-bottom: 2.5rem !important;
  }

  .intranet-company input[type="range"] {
    min-height: 44px;
  }

  .intranet-company .range-wrap .bubble {
    top: 36px;
  }

  .intranet-company .range-wrap .bubble::after {
    top: -4px;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
  }
}


/* Table wrappers add no box to the existing desktop layout. */
.meeting-table-scroll {
  display: contents;
}

/* Calendar and booking layout only; calendar options and booking rules stay intact. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-meeting {
    overflow-wrap: anywhere;
  }

  .calendar-columns,
  .calendar-main,
  .calendar-summary {
    min-width: 0;
    width: 100%;
  }

  .meeting-calendar #calendar-holder {
    width: 100%;
  }

  .calendar-summary > .row,
  .calendar-summary > .row > .col {
    margin-left: 0 !important;
  }

  .meeting-calendar .fc-header-toolbar {
    flex-wrap: wrap;
    gap: .75rem;
  }

  .meeting-calendar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
  }

  .meeting-calendar .fc-toolbar-chunk:nth-child(2) {
    order: -1;
    flex-basis: 100%;
  }

  .intranet-meeting .btn,
  .intranet-meeting .nav-link,
  .intranet-meeting select {
    min-height: 44px;
  }

  .intranet-meeting .nav-tabs {
    flex-wrap: wrap;
  }

  .intranet-meeting select {
    max-width: 100%;
  }

  .meeting-page-header > .col-8,
  .meeting-page-header > .col-4 {
    width: 100%;
    text-align: left !important;
  }

  .meeting-information > .col {
    min-width: 0;
  }

  .meeting-table-scroll {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .meeting-table-scroll > table,
  .meeting-booking-overview .table-responsive > table {
    min-width: 40rem;
  }

  .meeting-table-scroll td form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
  }

  .meeting-booking-form form .row > .col-4 {
    width: 50%;
    margin-bottom: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .meeting-information > .col,
  .meeting-booking-form form .row > .col-4 {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 1rem;
  }
}


/* Forum: full-width reading/editing area, with the same side boxes below it. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .forum-breadcrumb {
    margin-left: 0 !important;
    overflow-wrap: anywhere;
  }

  .intranet-forum,
  .intranet-forum-survey {
    overflow-wrap: anywhere;
  }

  .intranet-forum .forum-page-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .intranet-forum .forum-tablet-layout {
    flex-direction: column !important;
    gap: 1rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-width: 0;
  }

  .intranet-forum .forum-tablet-content,
  .intranet-forum .forum-page-content {
    order: 0;
    width: 100% !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .intranet-forum .forum-tablet-sidebar,
  .intranet-forum .forum-page-sidebar {
    order: 1;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
  }

  .intranet-forum #foren-boxen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 0;
    gap: 1rem;
  }

  .intranet-forum #foren-boxen > .card {
    width: 100% !important;
    height: auto !important;
    min-width: 0;
  }

  .intranet-forum .btn,
  .intranet-forum .nav-link,
  .intranet-forum-survey .btn,
  .intranet-forum-survey select {
    min-height: 44px;
  }

  .intranet-forum .forum-overview-header > :is(.col-2, .col-3, .col-4, .col-6, .col-8) {
    width: 100%;
    text-align: left !important;
    margin-bottom: .5rem;
  }

  .intranet-forum .forum-thread-header > .col-1 {
    width: 80px;
  }

  .intranet-forum .forum-thread-header > .col-6 {
    width: calc(100% - 80px);
  }

  .intranet-forum .forum-thread-header > .col-5 {
    width: 100%;
    text-align: left !important;
    margin-top: .75rem;
  }

  .intranet-forum .forum-post {
    min-width: 0;
  }

  .intranet-forum .forum-post img:not(.rounded-circle),
  .intranet-forum .modal-body img {
    max-width: 100%;
    height: auto;
  }

  .intranet-forum .forum-post .card-header .row > :is(.col-4, .col-8) {
    width: 100%;
    text-align: left !important;
  }

  .intranet-forum .ck-editor {
    max-width: 100%;
    min-width: 0;
  }

  .intranet-forum .ck-toolbar__items {
    flex-wrap: wrap !important;
  }

  .intranet-forum-survey.px-5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .intranet-forum-survey .row > :is(.col-2, .col-3, .col-4, .col-6, .col-8, .col-10, .col-11) {
    min-width: 0;
  }

  .intranet-forum-survey form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
  .intranet-forum-survey form textarea,
  .intranet-forum-survey select,
  .intranet-forum input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .intranet-forum textarea {
    max-width: 100%;
    min-width: 0;
  }

  .intranet-forum-survey textarea {
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .intranet-forum .forum-listing-row > div,
  .intranet-forum-survey .row > :is(.col-2, .col-3, .col-4, .col-6, .col-8, .col-10, .col-11) {
    flex: 0 0 100%;
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-forum .forum-post .card-body {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-forum-survey form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .intranet-forum-survey textarea {
    min-height: 44px;
  }
}


.tablet-desktop-hint {
  display: none;
}

/* Customer surveys: retain the printed form's dimensions and all workflows. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .tablet-desktop-hint {
    display: block;
  }

  .intranet-customer-survey.survey-flow {
    overflow-wrap: anywhere;
  }

  .survey-flow form .row > :is(.col-4, .col-6, .col-8) {
    min-width: 0;
  }

  .intranet-customer-survey .survey-page-header > :is(.col-2, .col-3, .col-8, .col-9, .col-10) {
    width: 100%;
    text-align: left !important;
  }

  .survey-page-header .d-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 44rem;
  }

  .survey-flow .btn,
  .survey-flow .nav-link,
  .survey-flow .form-control:not(textarea),
  .survey-flow select {
    min-height: 44px;
  }

  .survey-flow input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .survey-flow textarea,
  .survey-flow select {
    max-width: 100%;
    min-width: 0;
  }

  .survey-flow .nav,
  .survey-flow .pagination,
  .survey-flow .tablesorter-pager > .d-flex,
  .survey-flow .d-flex.gap-2 {
    flex-wrap: wrap;
  }

  .survey-table-scroll {
    position: relative;
    min-width: 0;
    overflow-x: auto;
  }

  .survey-table-scroll table:not(.tablesorter-stickyHeader) {
    min-width: 64rem;
  }

  .intranet-customer-survey .tablesorter-sticky-wrapper,
  .intranet-customer-survey .tablesorter-stickyHeader {
    display: none !important;
  }

  .survey-paper-host {
    overflow-x: auto;
  }

  .survey-paper-host > .row > .col-lg-8 {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .survey-flow .row > :is(.col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10) {
    width: 100%;
  }

  .survey-flow .text-end {
    text-align: left !important;
  }
}

/* Transparent outside the tablet range, preserving the desktop table layout. */
.tradegroup-table-scroll {
  display: contents;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-tradegroup .row > *,
  .intranet-tradegroup .card,
  .intranet-tradegroup .card-body,
  .intranet-tradegroup .tab-content,
  .intranet-tradegroup .ck-editor {
    min-width: 0;
  }

  .intranet-tradegroup :is(h1, h2, h3, h4, h5, .card-body, .btn, label, th, td) {
    overflow-wrap: anywhere;
  }

  .intranet-tradegroup .nav,
  .intranet-tradegroup .d-flex {
    flex-wrap: wrap;
  }

  .intranet-tradegroup .btn,
  .intranet-tradegroup .nav-link,
  .intranet-tradegroup .form-control:not(textarea),
  .intranet-tradegroup select {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-tradegroup :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  .intranet-tradegroup .ck-editor,
  .intranet-tradegroup .ck-content img,
  .intranet-tradegroup .card-body img {
    max-width: 100%;
  }

  .intranet-tradegroup .ck-toolbar {
    flex-wrap: wrap;
  }

  .intranet-tradegroup form label[for^="terminCheck-"],
  .intranet-tradegroup .tradeGroupCheckBox + label {
    max-width: calc(100% - 2rem);
    padding: .625rem .25rem;
    vertical-align: middle;
  }

  .tradegroup-table-scroll {
    display: block;
    position: relative;
    max-width: 100%;
    overflow-x: auto;
  }

  .tradegroup-admin .tradegroup-table-scroll > table {
    min-width: 48rem;
  }

  .tradegroup-overview .row-cols-lg-3 > *,
  .tradegroup-meeting .row-cols-md-3 > * {
    width: 50%;
  }

  .tradegroup-meeting-admin > .row > .col-4 {
    width: 100%;
    margin-bottom: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .intranet-tradegroup .row > :is(.col-2, .col-4, .col-6, .col-8),
  .tradegroup-overview .row.g-0 > :is(.col-md-4, .col-md-8),
  .tradegroup-meeting .row-cols-md-3 > *,
  .tradegroup-admin .row-cols-md-2 > * {
    width: 100%;
  }

  .tradegroup-overview .row.g-0 > .col-md-4 > img {
    max-height: 12rem;
    object-fit: contain;
  }

  .intranet-tradegroup .text-end {
    text-align: left !important;
  }
}

/* Existing profile/notification table boxes remain unchanged on desktop. */
.account-table-scroll:not(.table-responsive) {
  display: contents;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  :is(.intranet-profile, .intranet-notifications) .row > *,
  :is(.intranet-profile, .intranet-notifications) :is(.card, .card-body, .tab-content, .ck-editor) {
    min-width: 0;
  }

  :is(.intranet-profile, .intranet-notifications) :is(h2, h3, h4, h5, h6, p, a, label, td, th, .text-secondary) {
    overflow-wrap: anywhere;
  }

  :is(.intranet-profile, .intranet-notifications) .nav {
    flex-wrap: wrap;
  }

  :is(.intranet-profile, .intranet-notifications) :is(.btn, .nav-link, select, .form-control:not(textarea)) {
    min-height: 44px;
    white-space: normal;
  }

  :is(.intranet-profile, .intranet-notifications) :is(input, textarea, select, .ck-editor) {
    max-width: 100%;
  }

  .intranet-profile .ck-toolbar {
    flex-wrap: wrap;
  }

  .intranet-profile > .row > [class*="col-md-"] > .d-flex.flex-column {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .intranet-profile > .row > [class*="col-md-"] > .d-flex.flex-column > img.mt-5 {
    margin-top: 0 !important;
  }

  .profile-edit > .row > .col-md-3 {
    width: 100%;
    margin-bottom: 1rem;
  }

  .profile-edit > .row > :is(.col-md-4, .col-md-5) {
    width: 50%;
  }

  :is(.intranet-profile, .intranet-notifications) .account-table-scroll {
    display: block;
    position: relative;
    max-width: 100%;
    overflow-x: auto;
  }

  .intranet-notifications .account-table-scroll > table {
    min-width: 52rem;
  }

  .intranet-notifications .modal-body {
    overflow-x: auto;
    overflow-wrap: anywhere;
  }

  :is(.intranet-notifications .modal-body, .intranet-profile .ck-content) img {
    max-width: 100%;
    height: auto;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .intranet-profile .main-body.m-4 {
    margin: 1rem 0 !important;
  }

  .intranet-profile > .row > :is(.col-md-3, .col-md-4, .col-md-8),
  .intranet-profile .gutters-sm > :is(.col-md-4, .col-md-8),
  .profile-edit > .row > :is(.col-md-4, .col-md-5),
  .intranet-profile form .row > :is(.col-6, .col-md-4, .col-md-6, .col-md-8),
  .intranet-notifications .row > :is(.col-4, .col-6, .col-8) {
    width: 100%;
  }

  .intranet-notifications .text-end {
    text-align: left !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  :is(.intranet-info, .intranet-directory) .row > *,
  :is(.intranet-info, .intranet-directory) :is(.card, .card-body, .tab-content) {
    min-width: 0;
  }

  :is(.intranet-info, .intranet-directory) :is(h2, h3, h4, h5, h6, p, a, .text-secondary) {
    overflow-wrap: anywhere;
  }

  :is(.intranet-info, .intranet-directory) :is(.btn, .nav-link, .page-link, .form-control) {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-directory :is(.nav, .pagination) {
    flex-wrap: wrap;
  }

  .intranet-directory img,
  .intranet-info .info-detail-content img,
  .intranet-info .info-detail-attachments img {
    max-width: 100%;
    height: auto;
  }

  .intranet-directory .search-preview {
    max-width: 100%;
  }

  .intranet-directory .search-preview a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .intranet-info .row-cols-lg-3 > *,
  .directory-list .row-cols-md-3 > * {
    width: 50%;
  }

  .intranet-info .info-detail-image {
    width: 33.333333%;
  }

  .intranet-info .info-detail-content {
    width: 66.666667%;
    overflow-x: auto;
  }

  .intranet-info .info-detail-attachments {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .directory-list > .row > :is(.col-3, .col-4, .col-6, .col-8),
  .directory-company > .row > .col-6,
  .directory-member .gutters-sm > :is(.col-md-4, .col-md-8),
  .intranet-info .info-detail-image,
  .intranet-info .info-detail-content {
    width: 100%;
  }

  .intranet-info .info-detail-content {
    margin-top: 1rem;
  }

  .intranet-directory .text-end {
    text-align: left !important;
  }

  .directory-member .main-body.m-4 {
    margin: 1rem 0 !important;
  }

  .directory-company > .row > .col-6.mt-5.pt-5 {
    margin-top: 1.5rem !important;
    padding-top: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-first .row > *,
  .intranet-first :is(.card, .card-body, .tab-content, .ck-editor),
  .first-tablet-breadcrumb {
    min-width: 0;
  }

  .intranet-first :is(h2, h3, h4, h5, p, a, label, td, th),
  .first-tablet-breadcrumb {
    overflow-wrap: anywhere;
  }

  .intranet-first :is(.nav, .pagination, .modal-footer) {
    flex-wrap: wrap;
  }

  .intranet-first :is(.btn, .nav-link, select, .form-control:not(textarea)) {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-first .badge {
    max-width: 100%;
    white-space: normal;
  }

  .intranet-first :is(input, select, textarea, .ck-editor, img) {
    max-width: 100%;
  }

  .intranet-first .ck-toolbar {
    flex-wrap: wrap;
  }

  .intranet-first .row-cols-md-3 > * {
    width: 50%;
  }

  .intranet-first .table-responsive {
    position: relative;
    min-width: 0;
  }

  .intranet-first .table-responsive > table {
    min-width: 54rem;
  }

  .intranet-first .tablesorter-sticky-wrapper,
  .intranet-first .tablesorter-stickyHeader {
    display: none !important;
  }

  .intranet-first.p-5 {
    padding: 1.5rem !important;
  }

  /* Keep SB columns and their shared comparison headings aligned. */
  .intranet-first.first-evaluation-card {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
  }

  .intranet-first.first-evaluation-card > .tab-pane {
    min-width: 80rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .intranet-first .first-page-header > :is(.col-2, .col-3, .col-9, .col-10),
  .first-evaluation-overview .card .row > :is(.col-md-2, .col-md-3, .col-md-7) {
    width: 100%;
  }

  .intranet-first .first-page-header .text-end {
    text-align: left !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .first-config.px-5 {
    padding-right: 1.5rem !important;
    padding-left: 1.5rem !important;
  }

  .first-config .d-flex,
  .first-config div[data-controller="gs-question"][style],
  .first-config div[data-controller="gs-handlungsfeld"][style] {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .first-config .d-flex > * {
    min-width: 0;
  }

  .first-config-scroll {
    position: relative;
    overflow-x: auto;
  }

  .first-config-scroll > table {
    min-width: 54rem;
  }

  .first-config .tablesorter-pager > .d-flex {
    flex-wrap: wrap;
  }

  .first-catalog-preview #feLoadView > .col-4 {
    width: 100%;
    max-width: 32rem;
  }

  .first-catalog-preview #feLoadView > .col-6 {
    width: 100%;
  }

  .first-catalog-editor #feTabs .tab-pane > .container-fluid > .row > .col-3 {
    width: 40%;
  }

  .first-catalog-editor #feTabs .tab-pane > .container-fluid > .row > .col-9 {
    width: 60%;
  }

  .first-catalog-editor #feTabs ul.p-5 {
    padding: 1rem !important;
  }

  .first-catalog-editor .fe-question .fe-question-question,
  .first-catalog-editor .fe-question .fe-question-remarl {
    width: 100% !important;
    overflow-wrap: anywhere;
  }

  .first-catalog-editor .fe-question .fe-question-meta {
    flex-shrink: 1 !important;
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .first-config .first-page-header > :is(.col-4, .col-6, .col-8),
  .first-catalog-editor #firstEditorBody > .row > .col-4,
  .first-catalog-editor #feTabs .tab-pane > .container-fluid > .row > :is(.col-3, .col-9) {
    width: 100%;
  }

  .first-catalog-editor #firstEditorBody .justify-content-end {
    justify-content: flex-start !important;
  }
}

/* Screen-only additions preserve the report's existing print layout. */
.first-metrics-table-scroll {
  display: contents;
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .first-metrics-table-scroll {
    display: block;
    position: relative;
    max-width: 100%;
    overflow-x: auto;
  }

  .first-metrics-table-scroll > table {
    min-width: 54rem;
  }

  .first-metrics-ledger .first-metrics-table-scroll > table {
    min-width: 76rem;
  }

  .first-metrics-ledger td input:not([type="hidden"]) {
    min-width: 8rem;
  }

  .first-metrics .d-flex {
    flex-wrap: wrap;
  }

  .first-metrics-calendar .col-12.col-md-4.col-lg-2 {
    width: 33.333333%;
  }

  .first-tablet-report :is(.row > *, .d-flex > *, .card, .card-body) {
    min-width: 0;
  }

  .first-tablet-report :is(h1, h2, h3, h4, p, td, th, label, summary, a) {
    overflow-wrap: anywhere;
  }

  .first-tablet-report .d-flex {
    flex-wrap: wrap;
  }

  .first-tablet-report :is(.btn, select, .form-control, summary) {
    min-height: 44px;
    white-space: normal;
  }

  .first-tablet-report :is(select, input, textarea, img) {
    max-width: 100%;
  }

  .first-tablet-report .table-responsive {
    position: relative;
  }

  .first-tablet-report .table-responsive > table {
    min-width: 54rem;
  }

  .first-tablet-report .badge {
    max-width: 100%;
    white-space: normal;
  }
}

@media screen and (min-width: 768px) and (max-width: 991.98px) {
  .first-metrics .row > :is(.col-1, .col-2, .col-3, .col-4, .col-6, .col-7, .col-8, .col-9, .col-10) {
    width: 100%;
  }

  .first-metrics-calendar .col-12.col-md-4.col-lg-2 {
    width: 50%;
  }

  .first-metrics .text-end {
    text-align: left !important;
  }

  .first-tablet-report .ai-demo-chart-row,
  .first-tablet-report .ai-demo-coverage-row {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Meeting administration: keep desktop tables and forms unchanged. */
.meeting-admin-table-scroll {
  display: contents;
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-meeting-admin :is(.row > *, .d-flex > *, .tab-content, .tab-pane, .ck-editor) {
    min-width: 0;
  }

  .intranet-meeting-admin :is(h2, h3, h4, p, label, a, th, td) {
    overflow-wrap: anywhere;
  }

  .intranet-meeting-admin :is(.nav-tabs, .pagination) {
    flex-wrap: wrap;
  }

  .intranet-meeting-admin :is(.btn, .nav-link, .page-link, .form-control, .form-select) {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-meeting-admin :is(input, select, textarea, .ck-editor) {
    max-width: 100%;
  }

  .intranet-meeting-admin .ck-toolbar__items {
    flex-wrap: wrap;
  }

  .intranet-meeting-admin .meeting-admin-table-scroll {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  .intranet-meeting-admin .meeting-admin-table-scroll > table {
    min-width: 64rem;
  }

  .intranet-meeting-admin .meeting-admin-cards > .col {
    width: calc(50% - 1rem);
  }
}

@media screen and (min-width: 768px) and (max-width: 991.98px) {
  .intranet-meeting-admin .row > :is(.col-2, .col-4, .col-5, .col-6, .col-8) {
    width: 100%;
  }

  .intranet-meeting-admin .row > :is(.col-5, .col-6).m-2 {
    width: calc(100% - 1rem);
  }

  .intranet-meeting-admin .text-end {
    text-align: left !important;
  }
}


/* Forum administration: tablet-only layout, including access-group lists. */
.forum-admin-table-scroll {
  display: contents;
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-forum-admin {
    padding-bottom: 3rem;
  }

  .intranet-forum-admin :is(.row > *, .d-flex > *, .card, .card-body, .ck-editor) {
    min-width: 0;
  }

  .intranet-forum-admin :is(h1, h3, h4, h5, p, label, a, td, th, small, strong) {
    overflow-wrap: anywhere;
  }

  .intranet-forum-admin :is(.btn, .form-control, .form-select) {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-forum-admin :is(input, select, textarea, img, video, .ck-editor) {
    max-width: 100%;
  }

  .intranet-forum-admin :is(.ck-toolbar__items, .list-group-item.d-flex, .list-group-item .d-flex) {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .intranet-forum-admin .badge {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .intranet-forum-admin .row > .col-12.m-3 {
    margin-inline: 0 !important;
  }

  .intranet-forum-admin .forum-admin-table-scroll {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .intranet-forum-admin .forum-admin-table-scroll > table {
    min-width: 38rem;
  }

  .forum-admin-thread-list .forum-admin-table-scroll > table {
    min-width: 90rem;
  }

  .intranet-forum-admin .forum-admin-group-form > :is(.col-lg-5, .col-lg-7) {
    width: 100%;
  }
}

@media screen and (min-width: 768px) and (max-width: 991.98px) {
  .intranet-forum-admin .row > :is(.col-2, .col-4, .col-6, .col-8) {
    width: 100%;
  }

  .intranet-forum-admin .text-end {
    text-align: left !important;
  }
}


/* Remaining active administration pages; preserve desktop and print layouts. */
.admin-rest-table-scroll {
  display: contents;
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .intranet-admin-rest {
    padding-bottom: 3rem;
  }

  .intranet-admin-rest :is(.row > *, .d-flex > *, .card, .card-body, fieldset, .tab-content, .tab-pane, .ck-editor) {
    min-width: 0;
  }

  .intranet-admin-rest :is(h1, h2, h3, h4, h5, p, label, legend, a, small, strong, td, th) {
    overflow-wrap: anywhere;
  }

  .intranet-admin-rest :is(.nav-tabs, .pagination, .ck-toolbar__items) {
    flex-wrap: wrap;
  }

  .intranet-admin-rest :is(.btn, .nav-link, .page-link, .form-control, .form-select, summary) {
    min-height: 44px;
    white-space: normal;
  }

  .intranet-admin-rest :is(input, select, textarea, img, .ck-editor) {
    max-width: 100%;
  }

  .intranet-admin-rest .badge {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .intranet-admin-rest .admin-rest-table-scroll {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  .intranet-admin-rest :is(.admin-rest-table-scroll, .table-responsive) > table {
    min-width: 48rem;
  }

  .admin-rest-wide .admin-rest-table-scroll > table {
    min-width: 72rem;
  }

  .intranet-admin-rest .admin-rest-cards > .col {
    width: calc(50% - 1rem);
    gap: .75rem;
  }

  .intranet-admin-rest .row > .col-12.m-3 {
    margin-inline: 0 !important;
  }
}

@media screen and (min-width: 768px) and (max-width: 991.98px) {
  .intranet-admin-rest .row > :is(.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11) {
    width: 100%;
  }

  .intranet-admin-rest .text-end {
    text-align: left !important;
  }
}
