.ciapi-customer-message {
  background-color: #cce9ff;
}

.ciapi-agent-message {
  background-color: #f3f2f1;
}

@media (-ms-high-contrast: active), (forced-colors: active) {
  .ciapi-customer-message {
    border: 1px solid CanvasText;
    background-color: Canvas;
    color: CanvasText;
  }
  .ciapi-agent-message {
    border: 1px solid CanvasText;
    background-color: Canvas;
    color: CanvasText;
  }
}
.ciapi-agent-container {
  padding: 16px 15px 0 15px;
  clear: both;
  overflow-wrap: anywhere;
}

.ciapi-agent-message {
  max-width: 80%;
  margin: 0 auto 2rem auto;
  padding: 0.5rem 1.3rem;
  border-radius: 10px;
  line-height: 1.4em;
  color: #0b0c0c;
  min-width: 5em;
  position: relative;
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  text-align: left;
  page-break-inside: avoid;
}

.msg-opacity {
  opacity: 0;
}

.ciapi-agent-message:focus {
  box-shadow: 0 0 0 0.3157894737em #fd0;
  border-width: calc(0.3157894737em + 0.1em);
  outline: none;
  padding: calc(0.8421052632em - 0.1em) calc(1.0526315789em - 0.1em);
}

.video-message {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.iframe-wrap {
  position: relative;
  width: calc(100% + 40px);
  height: 7rem;
  padding-bottom: 60px;
  overflow: hidden;
  margin-left: -20px;
  margin-bottom: -16px;
  border-radius: 15px;
  border: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.timestamp-outer {
  page-break-inside: avoid;
}

.ciapi-customer-message {
  background-color: #cce9ff;
}

.ciapi-agent-message {
  background-color: #f3f2f1;
}

@media (-ms-high-contrast: active), (forced-colors: active) {
  .ciapi-customer-message {
    border: 1px solid CanvasText;
    background-color: Canvas;
    color: CanvasText;
  }
  .ciapi-agent-message {
    border: 1px solid CanvasText;
    background-color: Canvas;
    color: CanvasText;
  }
}
.ciapi-customer-container {
  padding: 16px 15px;
  clear: both;
  overflow-wrap: anywhere;
}

.ciapi-customer-message {
  max-width: 80%;
  margin: 0 auto 2rem auto;
  padding: 0.5rem 1.3rem;
  border-radius: 10px;
  line-height: 1.4em;
  color: #0b0c0c;
  min-width: 5em;
  position: relative;
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  text-align: left;
  float: right;
  page-break-inside: avoid;
}

.timestamp-outer {
  page-break-inside: avoid;
}

.ciapi-system-container {
  margin-bottom: 0.5em !important;
  clear: both;
}

.ciapi-system-message {
  color: #505a5f !important;
  margin-left: 10px;
  margin-right: 10px;
  margin-top: 1.2em !important;
  margin-bottom: 1.2em !important;
  text-align: center;
  border-radius: 1.0526315789em;
  border: 0.3157894737em solid #505a5f;
  line-height: 1.4em;
  min-width: 5em;
  padding: 15px 5px;
}

.c2cButton .fixed {
  width: 200px;
  padding: 10px;
  color: #fff;
  text-align: center;
  margin-bottom: 0px;
}

.c2cButton .fixed.ready {
  background-color: #00703c;
  font-weight: 600;
  margin-bottom: 0px;
  margin-top: 1.25rem;
}

.c2cButton .fixed.ready:hover {
  background-color: #005a30;
  cursor: pointer;
}

.c2cButton .fixed.busy,
.c2cButton .fixed.outofhours,
.c2cButton .fixed.chatactive {
  background-color: #00703c;
  font-weight: 600;
  margin-top: 1.25rem;
}

@media screen and (max-width: 640px) {
  .c2cButton .fixed.ready {
    margin-top: 1rem;
  }
  .c2cButton .fixed.busy {
    margin-top: 1rem;
    margin-bottom: 0px;
  }
}
@media screen and (max-width: 500px) {
  .c2cButton .fixed.busy {
    margin-top: 12px;
  }
}
.c2cButton .anchored {
  width: 200px;
  padding: 10px;
  color: #fff;
  text-align: center;
}

.c2cButton .anchored.ready {
  background-color: #008670;
}

.c2cButton .anchored.ready:hover {
  background-color: #005A30;
  cursor: pointer;
}

.c2cButton .anchored.busy,
.c2cButton .anchored.outofhours,
.c2cButton .anchored.chatactive {
  background-color: grey;
}

#endChatPopup h2 {
  margin-bottom: 0.5em;
}

#endChatPopup {
  animation-name: slideIn;
  animation-duration: 0.25s;
  /* animation-delay: 0s; */
}

#endChatPopup {
  position: absolute;
  top: 20%;
  left: 5%;
  right: 5%;
  width: auto;
  background-color: #fff;
  border: 5px solid #0b0c0c;
  padding: 1.5em 1.75em 0 1.75em;
  margin-top: 2px;
  z-index: 100002;
}

#endChatPopup:focus {
  outline: 3px solid #fd0;
}

.backdrop {
  z-index: 100001;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
}

@media screen and (max-height: 350px) {
  #endChatPopup {
    padding-top: 0.2em;
  }
  #endChatPopup h2 {
    margin-bottom: 0.2em;
  }
  #confirmEndChat {
    margin-bottom: 10px;
  }
  #cancelEndChat {
    margin-bottom: 10px;
  }
}
#ciapiSkinContainer {
  box-sizing: border-box;
  background-color: #fff;
}

#ciapiSkinHeader {
  background-color: #fff;
  border-bottom-color: rgb(177, 180, 182);
  border-bottom-style: solid;
  border-bottom-width: 2px;
  display: flex;
  flex-flow: wrap;
  justify-content: space-between;
  flex-direction: row;
  padding: 0.5rem 0;
}

#ciapiSkinHeader .govuk-button,
#ciapiSkinHeader > div {
  margin-bottom: 0; /*we are handling margin with the gap in flexbox*/
}

#print .govuk-button--secondary {
  background-size: 1em;
  background-color: #f3f2f1;
  background-position: 0 50%; /*we have removed the hard-coded height so need the image to be aware of its context*/
}

#print .govuk-button--secondary:hover,
#sound .govuk-button--secondary:hover {
  background-color: #dbdad9;
}

#print .govuk-button--secondary:focus,
#sound .govuk-button--secondary:focus {
  background-color: #ffdd00;
}

#sound .govuk-button--secondary {
  padding: 10px 10px 5px;
  background-color: #f3f2f1;
  background-position: 0 50%; /*we have removed the hard-coded height so need the image to be aware of its context*/
}

#toggleSound {
  text-align: left !important;
}

@media screen and (max-width: 320px) {
  #print .govuk-button--secondary {
    padding: 0.3em 0em;
  }
  #sound .govuk-button--secondary {
    padding-left: 0em;
    padding-top: 0.3em;
  }
}
#systemMessageBanner {
  width: 100%;
  border-bottom: 1px solid black;
  color: black;
  background-color: #cce9ff;
  text-align: center;
  padding: 5px 0;
}

@media screen and (max-width: 500px) {
  #systemMessageBanner {
    padding: 2px 0;
  }
}
#ciapiChatComponents {
  display: flex;
  flex-direction: column;
}

#skipToTopLink:focus {
  box-shadow: none !important;
  text-decoration: underline !important;
}

#skipToBottom {
  margin-left: 5px;
  margin-right: 5px;
}

#skipToBottomLink:focus {
  box-shadow: none !important;
  text-decoration: underline !important;
}

::-webkit-scrollbar {
  background: #fff;
}

::-webkit-scrollbar-thumb {
  background: #8f8f8f;
}

.ciapiSkinChatTranscript {
  flex-grow: 1;
  background-color: #fff;
  box-sizing: border-box;
  overflow: auto;
  padding: 0;
  position: relative;
  border: 4px solid transparent;
  position: relative;
  width: 100%;
  scrollbar-gutter: stable;
}

.ciapiSkinChatTranscript:focus {
  box-shadow: 0 0 0 3px #fd0;
  border-color: #000;
  outline: none;
}

.ciapi-customer-container {
  padding-bottom: 44px !important;
}

.skipToTopWithScroll {
  position: relative;
  bottom: 0;
  margin-left: 5px;
  margin-right: 5px;
  clear: both;
}

.skipToTopWithOutScroll {
  position: absolute;
  margin-left: 5px;
  margin-right: 5px;
  width: 96%;
  clear: both;
  bottom: 1.3rem;
}

#ciapiSkinFooter {
  flex-grow: 0;
  border-top: 3px solid rgb(11, 12, 12);
  padding-top: 1rem;
}

#ciapiInput {
  width: 69%;
  float: left;
}
#ciapiInput textarea {
  height: 4em;
  resize: none;
  margin-bottom: 0;
}

#ciapiSend {
  width: 84px;
  float: left;
  padding-left: 0.25em;
}

#errorSummary, #errorQ1, #errorQ2, #errorQ3, #errorQ4, #errorQ5, #needed-error, #easy-error, #service-error, #score-error, #contact-error {
  display: none;
}

.print-only {
  display: none;
}

.timestamp-outer {
  clear: both;
}

.ciapi-agent-message ul li {
  padding: 5px 0;
}

@media print {
  .govuk-grid-column-two-thirds {
    width: 100%;
  }
  .ciapi-customer-container {
    display: flow-root;
    width: 100%;
  }
  .print-overflow-visible {
    overflow: visible;
    border-bottom: 0;
  }
  .print-only {
    display: block;
  }
  .govuk-header__container {
    border-bottom: none;
  }
  .govuk-header__logo {
    display: inline-block;
  }
  .govuk-header__content {
    display: inline-block;
  }
  .timestamp-outer {
    margin-bottom: 1.5em;
  }
  .timestamp-outer:has(.ciapi-customer-container) {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 0;
  }
  .ciapi-customer-container, .ciapi-agent-container {
    padding: 0 !important;
    margin: 0 !important;
  }
  .print-float-left {
    padding: 0;
    margin-bottom: 1em;
  }
  .print-timestamp {
    margin: -1em 0 0 0;
  }
}
@media (max-width: 40.0625em) {
  .govuk-grid-column-one-third .app-related-items {
    margin-top: 2em;
  }
}
#ciapiSkinContainer {
  height: max(600px, 37rem);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: max-content minmax(50%, 90%) auto;
}

#surveyQuestionList {
  margin-top: 30px;
}

#ciapiClose {
  clear: both;
  padding-top: 1rem;
}

#HMRC_CIAPI_Anchored_1 {
  position: fixed;
  bottom: 0;
  right: 50px;
}

.info {
  text-align: center;
  color: #505a5f;
  border-radius: 30px;
  border: 5px solid #505a5f;
  padding: 0.6em 8px 0.7em 8px;
  width: 65%;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2em;
  margin-bottom: 2em;
}

.info img {
  width: 1.25em;
  vertical-align: bottom;
  padding: 0 0.5em 0.2em 0;
}

#postChatSurveyWrapper {
  height: calc(100% - 2em - 5px);
  overflow-y: scroll;
  padding: 1em;
  border-bottom: 2px solid #000;
}

#postPCSPageWrapper {
  height: calc(100% - 2em - 5px);
  border: 0px solid red;
  border-top: 2px solid #b1b4b6;
  border-bottom: 2px solid #000;
  padding-right: 14px;
  padding: 1em;
}
#postPCSPageWrapper h1 {
  color: white !important;
  font-size: 48px;
}

@media (max-width: 575.98px) {
  .ciapiSkinChatTranscript:focus {
    margin-bottom: 1.2em !important;
  }
}
#heading_chat_ended:focus, #legend_give_feedback:focus, #heading_end_chat_popup:focus {
  outline: 0;
}

.ciapi-agent-message:has(iframe.video-message) {
  min-width: 50%;
}

@media only screen and (max-width: 768px) {
  .ciapi-agent-message:has(iframe.video-message) {
    min-width: 80%;
  }
}