/* Approved variant A: compact cards, shared composer and separate plan sections. */
body.ui-readable .care-contacts {
  gap: 14px;
  max-width: none;
}
body.ui-readable .care-contact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border: 1px solid #dce5dd;
  border-radius: 16px;
  min-width: 0;
}
.contact-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.contact-identity > div {
  min-width: 0;
}
body.ui-readable .contact-identity small {
  font-size: 13px;
  display: block;
  color: #617169;
}
body.ui-readable .contact-identity h2 {
  font-size: 18px;
  margin: 4px 0 0;
  overflow-wrap: normal;
  word-break: normal;
}
.contact-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 50px;
  overflow: hidden;
  background: #e3eee6;
}
.contact-avatar .contact-illustration {
  width: 100%;
  height: 100%;
}
.contact-initials {
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
  color: #245744;
}
body.ui-readable .care-contact > p {
  font-size: 15px;
  line-height: var(--ui-leading);
  margin: 0;
  color: #617169;
}
body.ui-readable .care-contact .contact-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 11px;
  background: #245744;
  color: #fff;
  border: 0;
  white-space: nowrap;
  margin: 0;
}
body.ui-readable .care-contact .contact-secondary {
  display: block;
  align-self: flex-start;
  min-height: 40px;
  margin: 0;
  padding: 5px 0;
  font-size: 14px;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  color: #245744;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.chat-question-context {
  font-size: 13px;
  color: #52645c;
  border-left: 2px solid #96b7a5;
  padding: 4px 8px;
  margin-bottom: 6px;
}
body.ui-readable .message-composer {
  margin: 0;
  min-width: 0;
}
body.ui-readable .compose-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 50px;
  padding: 4px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #cbd8d0;
}
body.ui-readable .compose-bar:focus-within {
  border-color: #4b8068;
  box-shadow: 0 0 0 2px #24574415;
}
body.ui-readable .compose-bar textarea {
  flex: 1;
  min-width: 0;
  width: 0;
  height: 40px;
  min-height: 40px !important;
  max-height: 104px;
  padding: 10px 4px;
  margin: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  resize: none;
  font: 400 16px/21px var(--ui-font);
  overflow-y: auto;
  overflow-wrap: anywhere;
}
body.ui-readable .compose-bar :is(.compose-icon, .emoji-picker summary, .compose-send) {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  flex: 0 0 40px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  margin: 0;
}
body.ui-readable .compose-bar .emoji-picker {
  width: 40px;
  flex: 0 0 40px;
  margin: 0;
}
body.ui-readable .compose-bar .compose-send {
  background: #245744;
  color: white;
}
body.ui-readable .compose-bar:not([data-ready='true']) .compose-send {
  display: none;
}
body.ui-readable .compose-bar[data-ready='true'] [data-voice-record]:not(.recording) {
  display: none;
}
.voice-status:empty {
  display: none;
}
body.ui-readable .compose-bar .compose-send:focus-visible,
body.ui-readable .compose-bar .compose-icon:focus-visible,
body.ui-readable .compose-bar summary:focus-visible {
  outline: 2px solid #245744;
  outline-offset: 2px;
}
body.ui-readable .journey-balances {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 12px;
  width: 100%;
}
body.ui-readable .journey-balances .currency-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 62px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dce5dd;
  border-radius: 12px;
  color: #203d34;
  text-align: left;
}
body.ui-readable .journey-balances .currency-card span {
  min-width: 0;
}
body.ui-readable .journey-balances .currency-card strong {
  font-size: 16px;
  line-height: var(--ui-leading);
  white-space: normal;
  overflow-wrap: normal;
  display: block;
}
body.ui-readable .journey-balances .currency-card small {
  display: block;
  font-size: 13px;
  line-height: var(--ui-leading);
  margin-top: 3px;
  white-space: normal;
}
body.ui-readable .ws-plan-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  background: none;
  width: 100%;
  overflow: visible;
}
body.ui-readable .ws-plan-sections button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #dce5dd;
  border-radius: 10px;
  background: #fff;
  white-space: nowrap;
  font-size: 15px;
  color: #245744;
}
body.ui-readable .ws-plan-sections button.selected {
  background: #245744;
  border-color: #245744;
  color: white;
}
.ws-plan-sections .di {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
@media (max-width: 380px) {
  body.ui-readable .ws-plan-sections button {
    flex-direction: column;
    justify-content: center;
    font-size: 12px !important;
    padding: 8px 4px !important;
    gap: 5px;
  }
}
@media (max-width: 650px) {
  :root {
    --ui-body: 1rem;
    --ui-control: 1rem;
    --ui-caption: 0.875rem;
    --ui-heading: 1.75rem;
    --ui-section: 1.375rem;
    --ui-card: 1.125rem;
  }
  body.ui-readable .main {
    padding-left: 12px;
    padding-right: 12px;
  }
  body.ui-readable .care-contacts {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0;
  }
  body.ui-readable .care-contact {
    padding: 16px;
  }
  body.ui-readable .contact-identity h2 {
    font-size: 16px;
  }
  body.ui-readable .care-contact > p {
    font-size: 14px;
  }
  body.ui-readable .care-contact .contact-primary {
    font-size: 14px;
  }
  body.ui-readable .home-goals {
    gap: 12px;
  }
  body.ui-readable :is(.month-goal, .personal-prize) {
    padding: 14px;
    gap: 10px;
    border-radius: 16px;
  }
  body.ui-readable :is(.goal-copy, .prize-copy) h2 {
    font-size: 21px;
    line-height: var(--ui-leading);
    margin: 4px 0;
    overflow-wrap: normal;
    word-break: normal;
  }
  body.ui-readable :is(.goal-copy, .prize-copy) p {
    font-size: 13px;
    line-height: var(--ui-leading);
  }
  body.ui-readable :is(.goal-copy, .prize-copy) .text-button {
    font-size: 13px;
    padding: 4px 0;
    min-height: 36px;
    white-space: nowrap;
  }
  body.ui-readable :is(.goal-symbol, .prize-symbol) {
    width: 36px;
    height: 40px;
    flex: 0 0 36px;
  }
  .goal-symbol svg,
  .prize-symbol svg {
    width: 34px;
    height: 34px;
  }
  body.ui-readable .personal-prize .progress-portrait {
    width: 78px;
    height: auto;
    margin: 0;
    flex: 0 0 78px;
  }
  body.ui-readable .progress-portrait > div {
    height: 93px;
    width: 57px;
  }
  body.ui-readable .progress-portrait figcaption {
    font-size: 11px;
    line-height: var(--ui-leading);
    text-align: center;
  }
  body.ui-readable .journey-balances {
    gap: 8px;
  }
  body.ui-readable .journey-balances .currency-card {
    gap: 5px;
    padding: 10px 8px;
    align-items: flex-start;
  }
  body.ui-readable .journey-balances .currency-card strong {
    font-size: 13px;
  }
  body.ui-readable .journey-balances .currency-card small {
    font-size: 11px;
    white-space: nowrap;
  }
  body.ui-readable .journey-balances .currency-icon {
    width: 17px;
    height: 20px;
    flex: 0 0 17px;
  }
  body.ui-readable .mountain-journey {
    height: 310px;
    min-height: 0;
    border-radius: 16px;
  }
  body.ui-readable .journey-heading {
    top: 10px;
    left: 10px;
  }
  body.ui-readable .journey-heading h2 {
    font-size: 18px;
    white-space: nowrap;
    padding: 8px 10px;
  }
  body.ui-readable .journey-day {
    right: 10px;
    bottom: 10px;
    font-size: 13px;
    padding: 7px 9px;
  }
  body.ui-readable .journey-day strong {
    font-size: 13px;
  }
  body.ui-readable .md-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body.ui-readable .md-heading h2 {
    font-size: 23px;
  }
  body.ui-readable .md-heading p {
    font-size: 14px;
  }
  body.ui-readable .ws-plan-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.ui-readable .ws-plan-sections button {
    font-size: 13px;
    padding: 10px 8px;
    gap: 6px;
  }
  body.ui-readable .ws-plan-sections .di {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
  body.ui-readable .ws-filter-line {
    gap: 14px;
  }
  body.ui-readable .ws-legend {
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px;
  }
  body.ui-readable .ws-panel {
    padding: 14px;
    min-width: 0;
  }
  body.ui-readable .ws-heading h2 {
    font-size: 21px;
  }
  body.ui-readable .ws-tabs button {
    font-size: 14px;
  }
}
@media (max-width: 900px) {
  body.ui-readable .client-messages {
    display: flex;
    flex-direction: column;
    min-height: 360px;
  }
  .workspace-chat.client-messages .chat-sidebar,
  .workspace-chat.client-messages.is-conversation .chat-sidebar {
    display: block;
    height: auto;
    flex: 0 0 auto;
    border-bottom: 1px solid #dce5dd;
  }
  .client-messages .chat-folder-tabs {
    display: none;
  }
  .workspace-chat.client-messages .chatlist {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
  }
  body.ui-readable .client-messages .chat-contact {
    display: flex;
    flex: 1 0 145px;
    width: auto;
    max-width: 260px;
    min-height: 46px;
    padding: 8px;
    gap: 7px;
    border: 1px solid #dce5dd;
    border-radius: 11px;
  }
  .client-messages .chat-contact :is(.chat-preview, .chat-contact-role, time) {
    display: none;
  }
  body.ui-readable .client-messages .chat-contact-copy strong {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    overflow-wrap: normal;
  }
  .client-messages .chat-contact .chat-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  body.ui-readable .client-messages .chat-contact-meta {
    position: static;
    margin-left: auto;
    flex: none;
  }
  .workspace-chat.client-messages .chat-conversation {
    display: flex;
    height: auto;
    min-height: 0;
    flex: 1;
  }
  .client-messages .chat-back {
    display: none;
  }
  .workspace-chat .chat-thread-header .chat-avatar {
    display: flex;
    width: 36px;
    height: 36px;
  }
  body.ui-readable .chat-thread-title h2 {
    font-size: 16px;
    white-space: normal;
    overflow: visible;
    overflow-wrap: normal;
  }
  body.ui-readable .chat-thread-title > span {
    font-size: 12px;
  }
  body.ui-readable .workspace-chat .messages {
    padding: 12px;
  }
  body.ui-readable .workspace-chat .bubble {
    font-size: 16px;
    line-height: var(--ui-leading);
    padding: 10px 12px;
  }
  body.ui-readable .workspace-chat .bubble small {
    font-size: 11px;
  }
  body.ui-readable .workspace-chat .chat-conversation > form {
    padding: 8px;
  }
}

/* Five adherence categories stay on one compact row; narrow screens scroll it. */
body.ui-readable .ws-plan-sections {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  align-items: center;
  padding-bottom: 4px;
}
body.ui-readable .ws-plan-sections button {
  flex: 0 0 auto;
  flex-direction: row;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px !important;
  font-size: 14px !important;
  white-space: nowrap;
}
body.ui-readable .ws-plan-sections .nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
body.ui-readable .ws-plan-sections .nav-icon svg {
  width: 20px;
  height: 20px;
}
body.ui-readable .ws-statistics .ws-adherence .ws-mini-cell,
body.ui-readable .ws-statistics .ws-adherence .ws-mini-header {
  white-space: nowrap;
  min-width: 110px;
  width: 110px;
  padding: 6px 8px;
}
.ws-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.workspace-page .ws-mini-stat .ws-mini-count {
  display: inline-block;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  margin: 0;
  min-height: 30px;
  min-width: 19px;
  padding: 3px 2px;
  font: inherit;
  font-weight: 600;
  line-height: var(--ui-leading);
  cursor: help;
}
.ws-mini-count.done {
  color: #287153;
}
.ws-mini-count.missed {
  color: #ad443e;
}
.ws-mini-count.pending,
.ws-mini-count.unplanned {
  color: #62766b;
}
.ws-mini-count:hover,
.ws-mini-count:focus-visible {
  background: #edf4ef !important;
  outline: 1px solid #8ca697;
  outline-offset: 1px;
}
