@media screen and (max-width: 1024px) {
  #container {
    width: auto !important;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
  }

  #header {
    height: auto !important;
    min-height: 64px;
    padding: 10px !important;
    box-sizing: border-box;
  }

  #header .pull-right,
  #header .pull-left {
    float: none !important;
  }

  #header p {
    max-width: 100% !important;
    width: auto !important;
    margin: 6px 0 !important;
    box-sizing: border-box;
    word-break: break-word;
  }

  #logo {
    max-width: 100%;
    width: auto !important;
    padding: 0 !important;
  }

  #logo img,
  #header #logo img {
    max-width: 100%;
    height: auto;
  }

  #nav,
  #sub_nav {
    height: auto !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }

  #nav li,
  #sub_nav > li,
  #nav .active,
  #nav .inactive {
    display: inline-block !important;
    float: none !important;
    min-width: 0;
  }

  #nav li a,
  #sub_nav > li > a,
  #nav .active a,
  #nav .inactive a {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #content {
    margin: 0 10px !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px 0 16px !important;
    box-sizing: border-box;
  }

  .sidebar,
  .main-content,
  .span4,
  .span8,
  .login-box {
    width: 100% !important;
    display: block !important;
    margin: 0 0 15px !important;
    float: none !important;
    box-sizing: border-box;
  }

  .search-form .search,
  .searchbar .search {
    width: 100% !important;
    box-sizing: border-box;
  }

  table.list,
  #ticketTable,
  table.custom-data,
  .ticket_info {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.list thead th,
  table.list tbody td,
  #ticketTable th,
  #ticketTable td {
    white-space: nowrap;
  }

  #ticketForm td textarea,
  #clientLogin td textarea,
  #ticketForm div textarea,
  #clientLogin div textarea,
  #reply textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #ticketForm input[type="text"],
  #ticketForm input[type="email"],
  #ticketForm input[type="password"],
  #ticketForm select,
  #clientLogin input[type="text"],
  #clientLogin input[type="email"],
  #clientLogin input[type="password"],
  #clientLogin select,
  #reply input[type="text"],
  #reply select {
    max-width: 100%;
    box-sizing: border-box;
  }

  #clientLogin {
    padding: 15px !important;
    background-position: 98% 12px !important;
  }

  #clientLogin .instructions {
    display: block;
    padding: 0 !important;
    margin-top: 10px;
  }

  .thread-entry.avatar,
  .thread-entry.response.avatar,
  .thread-event {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .thread-entry > .avatar,
  .thread-entry.response > .avatar {
    display: none;
  }

  #ticketThread::before,
  .thread-entry.avatar .header:before,
  .thread-entry.avatar .header:after,
  .thread-entry.avatar.message .header:before,
  .thread-entry.avatar.message .header:after,
  .thread-entry.avatar.response .header:before,
  .thread-entry.avatar.response .header:after,
  .thread-entry.avatar.note .header:before,
  .thread-entry.avatar.note .header:after {
    display: none !important;
  }

  .thread-entry .header .title {
    max-width: 100%;
    margin-left: 0;
  }

  .thread-body .attachment-info,
  .freetext-files .file {
    width: 100%;
    display: block;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .sticky.bar.fixed {
    position: static;
    top: auto;
    left: auto;
    width: auto;
    box-shadow: none;
    padding: 8px 0;
  }
}

@media screen and (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    font-size: 13px;
  }

  #nav,
  #sub_nav {
    white-space: normal;
    overflow: visible !important;
    display: block;
    gap: 0;
    padding: 0 !important;
    margin: 8px 0 14px !important;
    line-height: normal;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  #nav li,
  #sub_nav > li,
  #nav .active,
  #nav .inactive {
    display: block !important;
    min-width: 100%;
    margin: 0 0 8px !important;
    padding: 0 !important;
    height: auto;
    float: none !important;
    border: none !important;
    background: transparent !important;
  }

  #nav li a,
  #sub_nav > li > a,
  #nav .active a,
  #nav .inactive a {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 !important;
    text-align: center;
    padding: 0 12px !important;
    line-height: 1.3 !important;
    height: auto !important;
    min-height: 44px;
    border-radius: 8px;
    box-sizing: border-box;
    white-space: normal !important;
    background-position: 0 0 !important;
    background-image: none !important;
    border: 1px solid #cfcfcf;
    background-color: #f7f7f7 !important;
    color: #333 !important;
    transition: none !important;
    font-weight: 500;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  }
  #nav li a:hover,
  #nav li a:focus,
  #nav li a.active {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    text-decoration: none !important;
    position: static !important;
    top: auto !important;
    transform: none !important;
    box-shadow: none !important;
  }
  #nav li a:hover,
  #nav li a:focus {
    background-color: #ececec !important;
    color: #222 !important;
  }
  #nav li a.active {
    background-color: #cfe6f7 !important;
    border-color: #b6d5ec !important;
    font-weight: 500;
  }

  #header p {
    font-size: 12px;
    padding: 6px !important;
  }

  #header {
    text-align: center;
  }

  #header .pull-right {
    float: none !important;
    text-align: center !important;
  }

  #logo,
  #header #logo {
    float: none !important;
    display: inline-block !important;
    margin: 6px auto !important;
    text-align: center;
  }

  #header #logo img {
    margin: 0 auto;
  }

  #nav li a {
    margin-left: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    height: 44px !important;
    line-height: 44px !important;
    display: block !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  #reply {
    padding: 8px;
  }

  #landing_page {
    text-align: center;
  }

  #landing_page .front-page-button,
  #landing_page .blue.button,
  #landing_page .green.button {
    display: block !important;
    margin: 12px auto !important;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    text-align: center;
  }

  #landing_page p {
    text-align: justify;
  }

  #ticketForm > table,
  #ticketForm > table > tbody,
  #ticketForm > table > tbody > tr,
  #ticketForm > table > tbody > tr > td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  #ticketForm > table > tbody > tr > td + td {
    margin-top: 6px;
  }

  #ticketForm td .captcha,
  #clientLogin td .captcha,
  #ticketForm div .captcha,
  #clientLogin div .captcha {
    float: none;
    margin: 0 0 8px 0;
    width: auto;
    max-width: 100%;
  }

  #ticketForm div div.captchaRow,
  #clientLogin div div.captchaRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: normal;
  }

  #ticketForm div div.captchaRow input,
  #clientLogin div div.captchaRow input {
    top: 0;
    width: 160px;
    max-width: 100%;
  }

  .thread-entry .header,
  .thread-entry .thread-body {
    border-radius: 4px;
  }

  #clientLogin {
    background-image: none !important;
    background-color: #f6f6f6;
  }

  #clientLogin > div[style*="display:table-row"] {
    display: block !important;
  }

  #clientLogin > div[style*="display:table-row"] > .login-box,
  #clientLogin > div[style*="display:table-row"] > .instructions,
  #clientLogin > div[style*="display:table-row"] > div[style*="display:table-cell"] {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    box-sizing: border-box;
    box-shadow: none !important;
  }

  #clientLogin input[type="text"],
  #clientLogin input[type="password"] {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  a.external-sign-in {
    display: block;
    width: 100%;
  }

  .external-auth {
    width: 100%;
    margin: 8px 0;
  }

  .external-auth-box {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .external-auth-icon {
    width: auto;
    flex: 0 0 auto;
    padding: 5px 8px;
  }

  .external-auth-name {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
    white-space: normal;
    font-size: 12px;
    padding: 5px 8px;
  }
}
