/* Approved client-card mockups. Kept local: diary-history and client food
   deliberately retain their existing typography, columns and presentation. */
.workspace-page,
.workspace-client-head {
  --ws-ink: #142039;
  --ws-muted: #718096;
  --ws-green: #234c3c;
  --ws-line: #e1e8ec;
  color: var(--ws-ink);
  font-family: var(--ui-font);
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
  min-width: 0;
}
.workspace-page {
  background: #fff;
  border: 1px solid #edf1f1;
  border-radius: 9px;
  padding: 24px;
  margin: 20px 0;
}
.workspace-page *,
.workspace-client-head * {
  box-sizing: border-box;
}
.workspace-page h1,
.workspace-page h2,
.workspace-page h3,
.workspace-client-head h1 {
  font-family: var(--ui-font);
  color: var(--ws-ink);
  letter-spacing: -0.025em;
  line-height: var(--ui-leading);
  margin: 0;
}
.workspace-page h1 {
  font-size: 28px;
  font-weight: 650;
  margin-bottom: 20px;
}
.workspace-page h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 18px;
}
.workspace-page h3 {
  font-size: var(--ui-body);
  font-weight: 600;
  margin: 0 0 12px;
}
.workspace-page p {
  margin: 8px 0 14px;
}
.workspace-page small,
.workspace-page .muted,
.workspace-client-head p {
  color: var(--ws-muted);
}
.workspace-page button,
.workspace-page input,
.workspace-page select,
.workspace-page textarea,
.workspace-page .button,
.workspace-client-head button,
.workspace-client-head .button {
  font: inherit;
  border-radius: 5px;
  line-height: var(--ui-leading);
}
.workspace-page button,
.workspace-page .button,
.workspace-client-head button {
  padding: 9px 15px;
  border: 1px solid #d4dfe3;
  background: white;
  color: var(--ws-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  vertical-align: middle;
  cursor: pointer;
}
.workspace-page button:hover,
.workspace-page .button:hover,
.workspace-client-head button:hover {
  background: #f1f7f4;
  border-color: #8dac9e;
}
.workspace-page .primary,
.workspace-client-head .primary {
  background: #234c3c;
  color: white;
  border-color: #234c3c;
}
.workspace-page .primary:hover,
.workspace-client-head .primary:hover {
  background: #17634e;
  color: white;
}
.workspace-page button:disabled {
  opacity: 0.5;
  cursor: default;
}
.workspace-page :focus-visible,
.workspace-client-head :focus-visible {
  outline: 3px solid #89bba6;
  outline-offset: 3px;
}
.workspace-page .danger,
.workspace-client-head .danger {
  color: #ab352e;
  border-color: #f2c6c1;
  background: #fff6f5;
}
.workspace-page .ws-link,
.workspace-client-head .ws-link {
  border: 0;
  background: transparent;
  padding: 3px 0;
  color: #245e4a;
  text-decoration: underline;
  text-underline-offset: 4px;
  box-shadow: none;
  border-radius: 0;
}
.workspace-page input,
.workspace-page select,
.workspace-page textarea {
  background: #fff;
  color: var(--ws-ink);
  border: 1px solid #d6e0e5;
  min-height: 40px;
  padding: 9px 12px;
  max-width: 100%;
}
.workspace-page label {
  font-size: var(--ui-caption);
  color: var(--ws-muted);
}
.workspace-page .di,
.workspace-client-head .di {
  width: 21px;
  height: 21px;
  flex: none;
}
.workspace-page .ws-symbol .di {
  width: 28px;
  height: 28px;
  color: #245e4a;
}
.workspace-client-head {
  margin: 20px 0 0;
}
.ws-crumb {
  font-size: var(--ui-caption);
  color: var(--ui-muted);
  text-decoration: none;
}
.ws-client-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 22px 0 24px;
}
.ws-client-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.workspace-client-head h1 {
  font-size: 32px;
  font-weight: 500;
  margin: 0;
}
.workspace-client-head p {
  margin: 6px 0 0;
}
.ws-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.ws-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.workspace-page .ws-heading h1,
.workspace-page .ws-heading h2 {
  margin: 0;
}
.ws-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--ws-line);
  margin: 0 0 18px;
  overflow-x: auto;
}
.ws-tabs button {
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  padding: 13px 12px !important;
  border-radius: 0 !important;
  white-space: nowrap;
  background: transparent !important;
  font-weight: 400;
}
.ws-tabs button.selected {
  color: #17563e !important;
  border-bottom-color: #17684d !important;
  font-weight: 600;
}
.ws-segments {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ws-segments button {
  padding: 7px 17px;
  border: 0;
  background: transparent;
  white-space: nowrap;
  font-size: var(--ui-caption);
}
.ws-segments button.selected {
  background: #e4f2ec;
  color: #174d38;
  font-weight: 600;
}
.workspace-page > .ws-segments {
  margin-bottom: 24px;
}
.ws-statistics .ws-segments {
  gap: 0;
  border: 1px solid #e1e8ec;
  border-radius: 5px;
  overflow: hidden;
}
.ws-statistics .ws-segments button {
  border-radius: 0;
  border-right: 1px solid #e1e8ec;
  background: #f6f8f8;
}
.ws-statistics .ws-segments button.selected {
  background: #234c3c;
  color: #fff;
}
.ws-panel {
  padding: 20px;
  border: 1px solid #e0e8ed;
  border-radius: 5px;
  margin: 0 0 16px;
  min-width: 0;
}
.ws-empty {
  padding: 20px 4px;
  color: var(--ui-muted);
}
.ws-scroll {
  overflow: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
}
.workspace-page .ws-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ui-font);
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
  table-layout: auto;
  margin: 0;
}
.workspace-page .ws-table th {
  background: #f5f8f9;
  font-weight: 400;
  color: #50617a;
  text-align: left;
  white-space: normal;
}
.workspace-page .ws-table td,
.workspace-page .ws-table th {
  padding: 13px 15px;
  border: 1px solid #e4ebee;
  vertical-align: middle;
}
.workspace-page .ws-table tbody th {
  background: #fff;
  color: var(--ws-ink);
  font-weight: 500;
}
.workspace-page .ws-table small {
  display: block;
  font-size: var(--ui-caption);
  margin-top: 3px;
}
.workspace-page .ws-table tr.selected > td {
  background: #eef7f3;
}
.workspace-page .ws-table .ws-expanded > td {
  padding: 0;
  background: #eef7f3;
}
.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 15px;
  background: #e0f1e9;
  color: #245e4a;
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
  padding: 5px 12px;
  white-space: nowrap;
}
.ws-badge.lilac {
  background: #eee9fb;
  color: #645299;
}
.ws-badge.muted {
  background: #eff2f5;
  color: var(--ui-muted);
}
.ws-badge.amber {
  background: #fff0d9;
  color: #976413;
}
.ws-filter-line {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.ws-filter-line select {
  width: auto;
  min-width: 175px;
  margin: 0;
}
.ws-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 480px;
  margin-bottom: 16px;
}
.ws-filter-line .ws-search {
  margin: 0;
}
.ws-search input {
  width: 100%;
  margin: 0;
}
.ws-search .di {
  color: var(--ui-muted);
}
.ws-thumb {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.ws-thumb.ws-symbol {
  background: #ecf7f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ws-name-photo {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 180px;
}
.ws-regimen {
  padding: 20px;
  background: #fff;
  border: 1px solid #e1e9ed;
  border-radius: 5px;
  margin: 8px;
}
.ws-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 14px 0 20px;
}
.ws-details > div {
  min-width: 0;
}
.ws-details dt,
.ws-goal-values dt {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  margin-bottom: 4px;
}
.ws-details dd,
.ws-goal-values dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ws-regimen .medicine-reference {
  margin: 18px 0;
}
.ws-disclosure {
  border: 1px solid #e0e8ed;
  border-radius: 5px;
  margin-bottom: 12px;
  padding: 0;
  background: #fff;
}
.ws-disclosure > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  font-weight: 500;
}
.ws-disclosure > summary::after {
  content: '⌄';
  margin-left: auto;
  color: var(--ui-muted);
}
.ws-disclosure[open] > summary {
  border-bottom: 1px solid #e0e8ed;
}
.ws-disclosure > form,
.ws-disclosure > p,
.ws-disclosure > .ws-scroll,
.ws-disclosure > .ws-tools {
  margin: 16px;
}
.ws-disclosure > .card {
  border: 0;
  box-shadow: none;
  margin: 0;
  background: #fff;
}
.ws-disclosure .medicine-calendar {
  padding: 20px;
}
.workspace-page .compatibility-panel h2 {
  display: none;
}
.ws-disclosure .compatibility-panel {
  padding: 18px;
}
.ws-chain {
  padding: 0;
}
.ws-chain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px;
}
.ws-chain-head h2 {
  font-size: 20px;
  margin: 0;
}
.ws-chain-head p {
  color: var(--ui-muted);
  margin: 5px 0 0;
}
.ws-meal-table {
  min-width: 900px;
}
.ws-meal-table th:first-child {
  min-width: 100px;
}
.ws-meal-table td {
  vertical-align: top !important;
  padding: 12px !important;
}
.ws-meal {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 200px;
}
.ws-meal .ws-thumb {
  width: 70px;
  height: 65px;
  object-fit: cover;
}
.ws-meal strong {
  display: block;
  line-height: var(--ui-leading);
}
.ws-meal p {
  font-size: var(--ui-caption);
  color: var(--ui-muted);
  margin: 4px 0;
  line-height: var(--ui-leading);
}
.ws-meal .ws-link {
  font-size: var(--ui-caption);
}
.ws-meal .ws-menu summary {
  padding: 0 5px;
  font-size: var(--ui-caption);
}
.ws-menu {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.ws-menu summary {
  list-style: none;
  border: 1px solid #d8e1e6;
  border-radius: 5px;
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ws-menu summary::-webkit-details-marker {
  display: none;
}
.ws-menu > div {
  position: absolute;
  z-index: 10;
  right: 0;
  top: 100%;
  width: 255px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d8e1e6;
  box-shadow: 0 8px 24px #17203916;
  border-radius: 6px;
}
.ws-menu > div button {
  display: block;
  width: 100%;
  text-align: left;
  justify-content: start;
  margin: 0 0 5px;
  white-space: normal;
}
.ws-table .ws-menu > div {
  position: relative;
  top: 0;
  right: 0;
  min-width: 185px;
  width: auto;
}
.ws-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 18px;
}
.ws-profile-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 32px;
  margin: 0;
}
.ws-profile-values > div {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 12px;
  font-size: var(--ui-caption);
}
.ws-profile-values dt {
  color: #50617a;
}
.ws-profile-values dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ws-profile-part {
  border-top: 1px solid #e1e8ec;
  padding-top: 22px;
  margin-top: 22px;
}
.ws-profile-part h3 {
  font-size: 20px;
}
.ws-profile-values + .ws-disclosure {
  margin-top: 20px;
}
.ws-goal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}
.ws-goal h3 {
  font-size: 23px;
  color: #235840;
  font-weight: 600;
}
.ws-goal img {
  width: 180px;
  height: 145px;
  object-fit: cover;
  border-radius: 6px;
}
.ws-goal-values {
  display: flex;
  gap: 25px;
  margin: 18px 0;
}
.ws-goal-values > div + div {
  padding-left: 25px;
  border-left: 1px solid #e1e8ec;
}
.ws-goal-values dd {
  font-size: 19px;
  font-weight: 600;
}
.ws-note {
  padding: 18px;
  background: #f5f8fa;
  border-radius: 5px;
  min-height: 72px;
}
.ws-profile-grid .unified-profile .profile-access {
  display: none;
}
.ws-profile-grid .unified-profile {
  padding: 16px;
}
.ws-profile-grid .unified-profile .formgrid {
  grid-template-columns: 1fr 1fr;
}
.ws-profile-grid .profile-access {
  margin-top: 20px;
}
.ws-period-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 16px 0;
}
.ws-date-range {
  position: relative;
  z-index: 5;
}
.ws-date-range > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border: 1px solid #d6e0e7;
  cursor: pointer;
  border-radius: 5px;
  list-style: none;
}
.ws-date-range > summary::after {
  content: '⌄';
  margin-left: 15px;
}
.ws-date-range form {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  padding: 18px;
  min-width: 340px;
  border: 1px solid #d6e0e7;
  border-radius: 6px;
  box-shadow: 0 8px 24px #17203916;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ws-date-range label {
  flex: 1;
}
.ws-date-range input {
  width: 100%;
  margin: 5px 0;
}
.workspace-page .ws-paid {
  color: var(--ui-muted);
  text-decoration: none;
  border-left: 1px solid #d6e0e7;
  padding: 0 0 0 20px;
}
.ws-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--ui-caption);
  color: var(--ui-muted);
}
.ws-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ws-dot {
  width: 26px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
  font-family: var(--ui-font);
  flex-shrink: 0;
}
.ws-dot.done {
  color: #17684d;
  background: #e2f5e9;
}
.ws-dot.missed {
  color: #c44449;
  background: #ffedf0;
}
.ws-dot.pending {
  color: var(--ui-muted);
  background: #f6f8f9;
}
.ws-statistics .ws-table.ws-adherence td,
.ws-statistics .ws-table.ws-adherence th {
  text-align: center;
  padding: 10px 5px;
}
.ws-statistics .ws-table.ws-adherence th:first-child {
  text-align: left;
  min-width: 180px;
  max-width: 220px;
  padding: 13px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.ws-adherence td {
  min-width: 44px;
}
.ws-adherence .ws-name-photo {
  min-width: 0;
  gap: 9px;
}
.ws-adherence .ws-thumb {
  width: 35px;
  height: 42px;
}
.workspace-page .ws-cell {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  min-width: 32px;
}
.ws-not-planned {
  color: var(--ui-muted);
}
.ws-stat-detail {
  border-top: 1px solid #e1e8ec;
  padding-top: 20px;
  margin-top: 20px;
}
.ws-stat-detail p {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ws-statistics .ws-panel {
  padding: 16px;
}
.ws-weight-summary {
  display: flex;
  justify-content: space-around;
  border: 1px solid #e1e8ec;
  border-radius: 5px;
  padding: 12px 8px;
  font-size: var(--ui-caption);
  gap: 10px;
}
.ws-weight-summary strong {
  font-size: var(--ui-body);
  color: #21593f;
}
.ws-weight-chart {
  width: 100%;
  height: auto;
  max-height: 300px;
  display: block;
  margin-top: 12px;
}
.ws-weight-chart text {
  font: var(--ui-caption) var(--ui-font);
  fill: #50617a;
}
.ws-health-days {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 5px 0 15px;
}
.workspace-page .ws-health-day {
  min-width: 64px;
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  gap: 8px;
  font-size: var(--ui-caption);
}
.ws-health-day small {
  font-size: var(--ui-caption);
  margin-left: 3px;
}
.ws-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 15px;
}
.ws-observations {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}
.ws-observations > nav {
  border: 1px solid #e0e8ed;
  border-radius: 5px;
  padding: 8px 0;
  align-self: start;
}
.ws-observations > nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  border-left: 3px solid transparent;
  background: transparent;
  font-size: var(--ui-caption);
}
.ws-observations > nav button.selected {
  background: #edf6f1;
  border-left-color: #237554;
}
.ws-observations > nav .ws-calendar-link {
  border-top: 1px solid #e0e8ed;
  margin-top: 12px;
  color: #32694f;
}
.ws-observations > .ws-panel {
  margin: 0;
}
.ws-statistics .analytics-empty {
  padding: 20px 0;
  margin: 0;
  color: var(--ui-muted);
}
.ws-statistics .analytics-section-head {
  align-items: center;
  margin-bottom: 18px;
}
.ws-statistics .analytics-section-head h2 {
  margin: 0;
}
.ws-statistics .analytics-metric,
.ws-statistics .analytics-finding {
  box-shadow: none;
  border-radius: 5px;
  background: white;
}
.ws-statistics .analytics-table {
  font: var(--ui-caption) var(--ui-font);
}
.ws-statistics .analytics-table th {
  background: #f5f8f9;
}
.ws-ai-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.ws-ai-grid > aside button {
  display: block;
  text-align: left;
  width: 100%;
  margin-bottom: 8px;
}
.ws-ai-text {
  white-space: pre-wrap;
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
}
.ws-analytic-choice {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.ws-analytic-choice select {
  min-width: 220px;
  width: auto;
}
.ws-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin: 20px 0;
}
.ws-comparison > div + div {
  border-left: 1px solid #dce5e9;
  padding-left: 25px;
}
.ws-comparison dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf1f2;
  padding: 9px 0;
}
.ws-comparison dd {
  margin: 0;
  font-weight: 600;
}
.ws-observation-history details {
  margin: 8px 0;
}
.ws-event-date {
  background: #f3f6f8;
  border-radius: 5px;
  padding: 8px 14px;
  margin: 20px 0 0;
  font-weight: 600;
}
.ws-events {
  margin: 0;
}
.ws-events .ws-table th {
  background: transparent;
}
.ws-event-count {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.ws-symptom-detail {
  margin-top: 18px;
}
.ws-note-neutral {
  padding: 10px 14px;
  background: #f4f6fb;
  border-radius: 5px;
  color: #64718b;
  font-size: var(--ui-caption);
  margin: 14px 0;
}
body.workspace-staff .sidebar {
  background: #f6f9f7;
  border-right: 1px solid #e1e8e6;
}
.workspace-staff .sidebar .brand {
  font-size: 40px;
  color: #234c3c;
}
.workspace-staff .sidebar .nav {
  font-family: var(--ui-font);
}
.workspace-staff .main > .topbar {
  background: none;
  border: 0;
  height: auto;
  min-height: 35px;
  margin-bottom: 5px;
}
.workspace-staff .sidebar footer small {
  display: none;
}
.workspace-staff .nav details summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #34475d;
}
.workspace-staff .nav details a {
  margin-left: 15px;
  font-size: var(--ui-caption);
}
.workspace-staff .nav details {
  margin: 5px 0;
}
.workspace-staff .nav a {
  border-radius: 5px;
}
.workspace-staff .nav svg {
  width: 21px;
  height: 21px;
}
.workspace-staff .nav-group {
  display: none;
}
@media (max-width: 1100px) {
  .ws-profile-grid {
    grid-template-columns: 1fr;
  }
  .ws-profile-grid > aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .ws-goal img {
    width: 140px;
    height: 120px;
  }
  .ws-observations {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .workspace-page {
    padding: 18px;
  }
  .ws-tabs {
    gap: 8px;
  }
  .ws-client-name h1 {
    font-size: 26px;
  }
  .ws-ai-grid {
    grid-template-columns: 1fr;
  }
  .ws-ai-grid > aside {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .ws-ai-grid > aside h2 {
    width: 100%;
  }
  .ws-ai-grid > aside button {
    width: auto;
  }
}
@media (max-width: 700px) {
  .workspace-page {
    padding: 15px 12px;
    margin: 12px 0;
  }
  .workspace-page h1 {
    font-size: 24px;
  }
  .workspace-page h2 {
    font-size: 20px;
  }
  .ws-client-line,
  .ws-chain-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }
  .workspace-client-head h1 {
    font-size: 24px;
  }
  .ws-client-name {
    gap: 8px;
  }
  .ws-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .ws-tabs {
    gap: 4px;
  }
  .ws-tabs button {
    padding: 10px 8px !important;
    font-size: var(--ui-caption);
  }
  .ws-panel {
    padding: 15px 10px;
  }
  .ws-profile-values {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ws-profile-grid > aside {
    display: block;
  }
  .ws-details {
    grid-template-columns: 1fr;
  }
  .ws-goal {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ws-goal img {
    width: 100%;
    max-width: 260px;
    height: 130px;
  }
  .ws-goal-values {
    gap: 14px;
  }
  .ws-goal-values > div + div {
    padding-left: 14px;
  }
  .ws-goal-values dd {
    font-size: var(--ui-body);
  }
  .ws-period-row {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }
  .workspace-page .ws-paid {
    border: 0;
    padding: 5px 0;
  }
  .ws-date-range > summary {
    font-size: var(--ui-caption);
  }
  .ws-date-range form {
    min-width: 280px;
    width: min(330px, 80vw);
  }
  .ws-weight-summary {
    flex-direction: column;
    padding: 10px 14px;
  }
  .ws-observations {
    display: block;
  }
  .ws-observations > nav {
    display: flex;
    overflow-x: auto;
    margin-bottom: 15px;
    padding: 0;
  }
  .ws-observations > nav button {
    width: auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }
  .ws-observations > nav button.selected {
    border-left: 0;
    border-bottom-color: #237554;
  }
  .ws-observations > nav .ws-calendar-link {
    margin: 0;
    border: 0;
  }
  .ws-filter-line select {
    width: 100%;
    min-width: 0;
  }
  .ws-filter-line .ws-search {
    min-width: 100%;
    max-width: none;
  }
  .ws-legend {
    gap: 10px;
    font-size: var(--ui-caption);
  }
  .ws-statistics .ws-segments {
    flex-wrap: wrap;
  }
  .ws-segments button {
    padding: 8px 12px;
  }
  .ws-comparison {
    gap: 15px;
  }
  .ws-comparison > div + div {
    padding-left: 15px;
  }
  .ws-comparison dl > div {
    display: block;
  }
  .ws-menu > div {
    right: 0;
    max-width: 80vw;
  }
  .ws-foot {
    flex-wrap: wrap;
  }
  .ws-profile-grid .unified-profile .formgrid {
    grid-template-columns: 1fr;
  }
  .workspace-page .ws-table {
    font-size: var(--ui-caption);
  }
  .workspace-page .ws-table td,
  .workspace-page .ws-table th {
    padding: 10px;
  }
  .ws-statistics .ws-table.ws-adherence th:first-child {
    min-width: 140px;
    max-width: 160px;
  }
  .ws-adherence-scroll {
    max-height: 70vh;
  }
  .ws-analytic-choice select {
    min-width: 0;
    width: 100%;
  }
}

.workspace-page [hidden] {
  display: none !important;
}

.ws-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0;
}
.ws-compare-grid > div {
  border: 1px solid #e0e8ed;
  border-radius: 6px;
  padding: 20px;
}
.ws-large-number {
  font-size: 35px;
  color: #236349;
}
.ws-large-number small {
  font-size: 20px;
  font-weight: 400;
}
.ws-note {
  background: #f4f7f7;
  padding: 12px 15px;
  border-radius: 5px;
  color: #617287;
}
.ws-summary-text {
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
  white-space: pre-wrap;
  margin: 22px 0;
}
.ws-summary {
  border: 1px solid #e0e8ed;
  padding: 20px;
  border-radius: 5px;
}
.ws-summary-link {
  background: none;
  border: 0;
  border-bottom: 1px solid #e0e8ed;
  padding: 18px 12px !important;
  border-radius: 0 !important;
}
.ws-summary-link strong {
  font-weight: 500;
}
.ws-summary-link small {
  display: block;
  margin-top: 7px;
}
.ws-summary-link .ws-badge {
  margin-left: 8px;
}
.ws-summary-link.selected {
  background: #eef6f2;
  border-left: 3px solid #236349;
}
.ws-ai-grid > .ws-panel {
  margin: 0;
}
.workspace-page #analysis-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ws-filter-line label {
  min-width: 180px;
}
.ws-filter-line label select {
  display: block;
  min-width: 180px;
  max-width: 100%;
}
.workspace-staff .ws-nav-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: var(--ui-caption);
}
.workspace-staff .ws-nav-group summary:after {
  content: '⌄';
  margin-left: auto;
}
.workspace-staff .ws-nav-group[open] summary:after {
  content: '⌃';
}
.workspace-staff .ws-nav-group > div {
  padding-left: 15px;
}
.workspace-staff .ws-nav-group a {
  padding: 10px 12px;
  font-size: var(--ui-caption);
}
.workspace-staff .sidebar .nav > a {
  font-size: var(--ui-caption);
}
.workspace-staff .sidebar footer small {
  display: none;
}
@media (max-width: 900px) {
  .ws-ai-grid {
    grid-template-columns: 1fr;
  }
  .ws-observations {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .ws-compare-grid {
    grid-template-columns: 1fr;
  }
  .ws-observations {
    display: block;
  }
  .ws-filter-line label,
  .ws-filter-line label select {
    width: 100%;
    min-width: 0;
  }
  .workspace-page #analysis-search {
    width: 100%;
    align-items: flex-end;
  }
  .ws-summary {
    padding: 12px;
  }
}

.ws-statistics .ws-adherence {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
.ws-statistics .ws-adherence th:first-child {
  width: 210px;
}
.ws-statistics .ws-adherence th:not(:first-child),
.ws-statistics .ws-adherence td {
  width: 48px;
}
@media (max-width: 700px) {
  .workspace-page .ws-stack-table {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .ws-stack-table thead {
    display: none;
  }
  .ws-stack-table tbody,
  .ws-stack-table tr {
    display: block;
    width: 100%;
  }
  .workspace-page .ws-stack-table tr {
    border: 1px solid #e0e8ed;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 12px;
  }
  .workspace-page .ws-stack-table td {
    display: flex;
    gap: 10px;
    border: 0;
    padding: 7px 0;
    overflow-wrap: anywhere;
  }
  .workspace-page .ws-stack-table td:before {
    content: attr(data-label);
    color: var(--ui-muted);
    font-size: var(--ui-caption);
    min-width: 85px;
    width: 85px;
    flex-shrink: 0;
  }
  .workspace-page .ws-stack-table td:first-child {
    font-weight: 600;
  }
  .workspace-page .ws-stack-table td:first-child:before,
  .workspace-page .ws-stack-table td:last-child:before {
    display: none;
  }
  .workspace-page .ws-stack-table td[colspan] {
    display: block;
  }
  .workspace-page .ws-stack-table td[colspan]:before {
    display: none;
  }
  .ws-stack-table td:last-child button {
    width: 100%;
  }
  .workspace-page .ws-stack-table td small {
    display: inline-block;
  }
  .workspace-page .ws-stack-table .ws-thumb {
    width: 40px;
    height: 45px;
  }
  .ws-stack-table .ws-details {
    grid-template-columns: 1fr;
  }
  .ws-statistics .ws-adherence th:first-child {
    width: 145px;
  }
}

.ws-nutrition-questions {
  margin-top: 28px;
}
.ws-nutrition-questions > h2 {
  margin: 0 0 16px;
}
.ws-statistics .ws-adherence thead th:not(:first-child) {
  width: 96px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.workspace-page .ws-health-day {
  min-width: 105px;
  white-space: nowrap;
}
.ws-health-day > span:first-child {
  font-size: var(--ui-caption);
  font-variant-numeric: tabular-nums;
}

.nutrition-chain-picker button {
  white-space: normal;
  text-align: left;
}
.nutrition-chain-picker small {
  display: block;
  font-weight: 400;
  margin-top: 4px;
}
.nutrition-question .tools {
  flex-wrap: wrap;
}
.nutrition-question {
  overflow-wrap: anywhere;
}
.nutrition-chain + .nutrition-chain {
  margin-top: 28px;
}
@media (max-width: 700px) {
  .workspace-client-head .ws-client-line > div {
    min-width: 0;
    max-width: 100%;
  }
  .workspace-client-head h1 {
    overflow-wrap: anywhere;
  }
  .workspace-client-head .ws-tools {
    position: relative;
    width: 100%;
  }
  .workspace-client-head .ws-menu {
    position: static;
  }
  .workspace-client-head .ws-menu > div {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    width: min(100%, 22rem);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .workspace-client-head .ws-tabs {
    flex-wrap: wrap;
    overflow: visible;
    gap: 4px;
  }
  .workspace-client-head .ws-tabs button {
    white-space: normal;
    text-align: left;
  }
  .nutrition-tabs,
  .nutrition-questions > .tabs,
  .nutrition-chain-picker {
    flex-wrap: wrap;
  }
  .nutrition-questions button {
    max-width: 100%;
    white-space: normal;
  }
  .ws-date-range form {
    min-width: 0;
    max-width: calc(100vw - 40px);
  }
}

.nutrition-chain-picker button.active small {
  color: inherit;
}

/* Client-card tags only; directory tags retain their original colors. */
body.workspace-staff .workspace-client-head .client-tag {
  background: #ffed97;
  color: #6b4b00;
  border: 1px solid #e2bd43;
  font-weight: 650;
}
body.workspace-staff .questionnaire[data-q-report] .q-summary-organization [data-next='client-tags'] {
  background: #ffed97;
  border-color: #e2bd43;
  color: #6b4b00;
  font-weight: 650;
}
.diary-reply-context {
  padding: 9px 12px;
  border-left: 3px solid #658b76;
  background: #edf4ee;
  border-radius: 5px;
}

.workspace-client-head .ws-client-work-mode {
  display: inline-block;
  margin-left: 20px;
  color: #183b72;
  font-weight: 700;
}

/* Nutrition requests: selectable questions and an exact meal context. */
.nq-master-detail {
  min-width: 0;
}
.nq-chain-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 10px 12px;
  background: #f1f5f2;
  border-radius: 8px;
}
.nq-chain-heading span {
  font-size: 13px;
  color: #65736b;
}
.nq-layout {
  display: grid;
  grid-template-columns: minmax(240px, 36%) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.nq-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow-y: auto;
  min-width: 0;
  padding: 1px;
}
.nutrition-questions .nq-item {
  display: grid;
  gap: 7px;
  text-align: left;
  width: 100%;
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 10px;
  color: #263c32;
  white-space: normal;
  cursor: pointer;
}
.nutrition-questions .nq-item.selected {
  background: #f0f7f2;
  border-color: #426e57;
  box-shadow: inset 3px 0 #426e57;
}
.nq-item-top {
  display: flex;
  gap: 8px;
  align-items: start;
  justify-content: space-between;
}
.nq-item-top strong {
  font-size: 15px;
  line-height: var(--ui-leading);
  overflow-wrap: anywhere;
}
.nq-status {
  font-size: 11px;
  font-weight: 600;
  border-radius: 18px;
  padding: 4px 8px;
  white-space: nowrap;
  display: inline-block;
  flex-shrink: 0;
}
.nq-status.pending {
  background: #fff0b7;
  color: #725713;
}
.nq-status.answered {
  background: #dff1e8;
  color: #295b44;
}
.nq-item small {
  font-size: 12px;
  color: #67766e;
}
.nq-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: var(--ui-leading);
}
.nq-detail {
  border: 1px solid #dde5df;
  border-radius: 10px;
  padding: 18px;
  background: white;
  min-width: 0;
}
.nq-detail > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.nq-detail h3 {
  margin: 0;
  font-size: 18px;
}
.nq-detail blockquote {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid #789f86;
  background: #f5f7f5;
  border-radius: 6px;
}
.nq-detail p {
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.nq-detail small {
  color: #64766b;
  font-size: 12px;
}
.nq-meal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e9e4;
  border-radius: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.nq-meal > div:nth-child(2) {
  flex: 1;
  min-width: 160px;
}
.nq-meal img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}
.nq-meal h3 {
  font-size: 16px;
}
.nq-meal p {
  font-size: 13px;
}
.nq-chain-context {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f5f7f5;
  border-radius: 8px;
}
.nq-chain-context span {
  font-size: 13px;
}
.nq-reply {
  margin-top: 14px;
}
.nq-reply > label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.nq-reply .compose-bar {
  border-radius: 10px;
  align-items: flex-end;
}
.nq-reply textarea {
  min-height: 84px;
  max-height: 240px;
}
.nq-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.nq-answer {
  margin-top: 14px;
  border-top: 1px solid #e3e8e4;
  padding-top: 12px;
}
.nq-empty {
  padding: 16px;
  color: #68766e;
}
.nutrition-chain-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 1000px) {
  .nq-item-top {
    flex-direction: column;
  }
  .nq-layout {
    grid-template-columns: minmax(200px, 34%) minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  .nq-layout {
    grid-template-columns: 1fr;
  }
  .nq-list {
    max-height: 260px;
  }
  .nq-detail {
    padding: 12px;
  }
  .nq-item-top {
    flex-direction: row;
  }
  .nq-detail > header {
    flex-wrap: wrap;
  }
  .nq-status {
    white-space: normal;
  }
  .nq-meal img {
    width: 70px;
    height: 70px;
  }
}

/* Variant 3: question first, response and meal context alongside it. */
.nq-layout {
  grid-template-columns: minmax(250px, 38%) minmax(0, 1fr);
}
.nutrition-questions .nq-item {
  align-items: start;
  justify-items: stretch;
  text-align: left !important;
  padding: 16px;
}
.nq-item-top {
  flex-direction: column;
  gap: 7px;
}
.nq-item-top strong {
  font-size: 16px;
}
.nq-item .nq-excerpt {
  display: none;
}
.nq-detail > header h3 {
  font-size: 21px;
  line-height: var(--ui-leading);
  overflow-wrap: anywhere;
}
.nq-detail .nq-chain-context {
  background: none;
  padding: 0;
  color: #697a70;
  font-size: 13px;
}
.nq-reply .compose-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  padding: 10px;
  border: 1px solid #d7e0d9;
  border-radius: 8px;
}
.nq-reply .compose-bar textarea {
  grid-column: 1/-1;
  grid-row: 1;
  min-height: 94px;
  margin-bottom: 8px;
}
.nq-reply .compose-send {
  grid-column: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 112px;
  height: 38px;
  border-radius: 7px;
  padding: 8px 12px;
}
.nq-reply .compose-send span {
  font-size: 14px;
}
.nq-reply .compose-send svg {
  width: 18px;
  height: 18px;
}
.nq-reply .compose-icon {
  width: 34px;
  height: 34px;
}
.nq-inbox-list {
  display: grid;
  gap: 8px;
}
.nq-inbox-row {
  display: grid;
  grid-template-columns: minmax(180px, 25%) minmax(0, 1fr) auto 16px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dbe4dd;
  border-radius: 10px;
  background: white;
  color: #2b4335;
  text-decoration: none;
}
.nq-inbox-row:hover {
  background: #f1f7f3;
}
.nq-inbox-row small {
  display: block;
  color: #6c7d72;
  margin-top: 6px;
}
.nq-inbox-row strong {
  overflow-wrap: anywhere;
}
.directory-nutrition-filter {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #dca35b;
  border-radius: 10px;
  background: #fff0d6;
  color: #734b12;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.directory-nutrition-filter b {
  border-radius: 12px;
  padding: 2px 6px;
  background: #f9dba8;
}
.nq-detail blockquote {
  margin: 12px 0;
}
.nq-actions button {
  font-size: 13px;
  padding: 8px 10px;
}
@media (max-width: 750px) {
  .nq-layout {
    grid-template-columns: 1fr;
  }
  .nq-inbox-row {
    grid-template-columns: 1fr auto;
  }
  .nq-inbox-row > div {
    grid-column: 1/-1;
  }
  .nq-reply .compose-send {
    min-width: 100px;
  }
  .nq-detail > header h3 {
    font-size: 18px;
  }
}

.nutrition-questions .nq-item .nq-item-top {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
}
.nutrition-questions .nq-item > small {
  text-align: left !important;
  justify-self: start;
}
.nutrition-questions .nq-item {
  display: grid !important;
  justify-content: stretch !important;
  align-content: start !important;
}
.nutrition-questions .nq-reply .message-composer .compose-bar {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 34px 34px !important;
  border-radius: 8px !important;
  padding: 10px !important;
  align-items: end !important;
}
.nutrition-questions .nq-reply .message-composer textarea {
  grid-column: 1/-1 !important;
  grid-row: 1 !important;
  min-height: 94px !important;
  height: 94px !important;
  max-height: 240px !important;
  padding: 8px !important;
  font-size: 14px !important;
  border: 0 !important;
  resize: vertical !important;
}
.nutrition-questions .nq-reply .compose-send {
  display: none !important;
}
.nutrition-questions .nq-reply .compose-bar > .emoji-picker {
  grid-column: 3;
}
.nutrition-questions .nq-reply [data-voice-record] {
  grid-column: 4;
}
.nutrition-questions .nq-actions .nq-answer-send {
  margin-left: auto;
  order: 10;
  padding: 9px 20px;
  font-size: 14px;
}
.nutrition-questions .nq-reply > label {
  color: #2c4134;
  font-size: 14px;
  font-weight: 600;
}

.nutrition-questions .nq-reply .message-composer textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  justify-self: stretch !important;
}

.nutrition-questions .nq-item-context {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: normal;
}
.nq-item-photo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.nq-item-photo.empty {
  display: grid;
  place-items: center;
  background: #eef2ef;
  font-size: 10px;
}
.nq-conversation {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 420px;
  overflow-y: auto;
  margin: 14px 0;
  padding: 2px;
}
.nq-message {
  width: 90%;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f3f5f3;
  border: 1px solid #e1e7e2;
}
.nq-message.from-specialist {
  align-self: flex-end;
  background: #eaf5ec;
}
.nq-message header {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
}
.nq-message time {
  color: #78867c;
  font-size: 11px;
  white-space: nowrap;
}
.nq-message p {
  font-size: 14px;
  line-height: var(--ui-leading);
  margin: 6px 0;
}
.nq-chain-heading a,
.nq-chain-context a {
  color: #365c46;
  font-weight: 700;
  text-decoration: underline;
}
.nq-message .message-photos img {
  max-height: 150px;
}
.nq-detail .nq-meal img {
  width: 115px;
  height: 100px;
}
.nq-detail .nq-conversation audio {
  max-width: 100%;
}

.assignment-archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 16px;
  font-size: var(--ui-caption, 14px);
  font-weight: 400;
  line-height: var(--ui-leading);
  color: var(--ui-muted, #5d7164);
}
.assignment-archive-toggle input[type='checkbox'] {
  width: 17px;
  height: 17px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #39765b;
}
.ws-filter-line .assignment-archive-toggle {
  margin: 0;
  align-self: center;
}

/* User-adjustable columns, scoped to the two client assignment lists. */
.ws-column-tools {
  display: none;
}
@media (min-width: 701px) {
  .ws-column-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--ui-muted);
    font-size: var(--ui-caption);
  }
  .workspace-page .ws-column-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    font-size: var(--ui-card);
    color: var(--ws-green);
  }
  .workspace-page table[data-column-widths] {
    min-width: 100%;
  }
  .workspace-page table[data-column-widths].ws-sized-columns {
    table-layout: fixed;
  }
  table[data-column-widths] thead th {
    position: relative;
    padding-right: 20px !important;
  }
  table[data-column-widths] .ws-column-grip {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    z-index: 2;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
  }
  .ws-column-grip::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 20%;
    height: 60%;
    width: 2px;
    background: #a5bdb0;
    border-radius: 2px;
  }
  .ws-column-grip:hover::after,
  .ws-column-grip:focus-visible::after {
    background: #245b42;
    width: 3px;
  }
  .ws-column-grip:focus-visible {
    outline: 2px solid #a88d50;
    outline-offset: -2px;
  }
  .ws-resizing {
    user-select: none;
    cursor: col-resize;
  }
  .ws-sized-columns :is(td, th) {
    overflow-wrap: anywhere;
  }
  .ws-sized-columns .ws-name-photo {
    min-width: 0;
  }
  .ws-sized-columns .ws-name-photo strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .ws-sized-columns .ws-tools {
    flex-wrap: wrap;
    min-width: 0;
  }
  .ws-sized-columns :is(button, .ws-badge) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 700px) {
  table[data-column-widths] > colgroup {
    display: none;
  }
  .workspace-page table[data-column-widths] {
    width: 100% !important;
  }
}

.ws-row-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.ws-row-content {
  flex: 1;
  min-width: 0;
}
.workspace-page .ws-row-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  min-width: 28px;
  height: 36px;
  min-height: 36px;
  padding: 0 !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
  color: #658577;
  cursor: grab;
  font-size: var(--ui-card);
}
.ws-row-handle:active {
  cursor: grabbing;
}
.ws-row-handle:focus-visible {
  outline: 2px solid #a88d50;
  outline-offset: 1px;
}
.ws-row-dragging {
  opacity: 0.5;
}
table[data-column-widths] .ws-drop-before > td {
  box-shadow: inset 0 3px #277354;
}
table[data-column-widths] .ws-drop-after > td {
  box-shadow: inset 0 -3px #277354;
}
.workspace-page .ws-row-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: var(--ui-card);
  color: var(--ws-green);
}
.ws-column-tools > span {
  flex: 1;
}
@media (max-width: 700px) {
  .workspace-page .ws-stack-table td .ws-row-handle {
    width: 28px;
  }
  .ws-column-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
  }
  .ws-column-tools > span,
  .ws-column-reset {
    display: none !important;
  }
}

.ws-medicine-filters {
  justify-content: flex-start !important;
}
.ws-medicine-filters .ws-search {
  flex: 0 1 480px !important;
  margin-right: 12px;
}
.ws-medicine-filters > select {
  margin-left: auto;
}
.ws-table-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9b3c40;
  font-size: var(--ui-caption);
  margin-bottom: 8px;
}
.ws-table-sync[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .ws-medicine-filters .ws-search {
    margin-right: 0;
  }
  .ws-medicine-filters > select {
    margin-left: 0;
  }
  .ws-table-sync {
    flex-wrap: wrap;
  }
}

/* Touch gestures only start on the grip; the card body still scrolls normally. */
.workspace-page .ws-row-handle {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.workspace-page .ws-row-handle.ws-touch-active {
  background: #e3f0e9;
  color: #245b42;
  border-radius: 6px;
}
.ws-touch-label {
  position: fixed;
  z-index: 9999;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid #92b4a2;
  border-radius: 8px;
  background: #fff;
  color: #234c3c;
  box-shadow: 0 4px 16px #183d2929;
  pointer-events: none;
  font: var(--ui-caption)/1.25 var(--ui-font);
  overflow-wrap: anywhere;
}
@media (any-pointer: coarse), (max-width: 700px) {
  .workspace-page .ws-stack-table td .ws-row-handle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}
@media (max-width: 700px) {
  .workspace-page .ws-stack-table .ws-drop-before > td,
  .workspace-page .ws-stack-table .ws-drop-after > td {
    box-shadow: none;
  }
  .workspace-page .ws-stack-table .ws-drop-before {
    box-shadow: inset 0 3px #277354;
  }
  .workspace-page .ws-stack-table .ws-drop-after {
    box-shadow: inset 0 -3px #277354;
  }
}
