:root {
  color-scheme: light;
  --ink: #191c23;
  --muted: #616773;
  --brand: #2a9d8f;
  --dark-brand: #21786f;
  --tint: #e8f4f2;
  --border: #e1e1de;
  --pill: #efeee9;
  --paper: #fff;
  --ground: #f7f6f4;
  color: var(--ink);
  background: var(--ground);
  font: 16px/1.45 "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { scroll-margin-inline: 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--dark-brand); outline-offset: 3px; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 10; color: var(--dark-brand); background: white; padding: 8px 14px; }
.skip:focus { top: 12px; }
.layout { max-width: 440px; min-height: 100dvh; margin: auto; }
.header { position: relative; z-index: 1; padding: 8px 0 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; min-height: 43px; }
.logo { display: flex; align-items: center; min-height: 44px; background: none; padding: 0; border: 0; }
.logo img { display: block; width: 45px; height: auto; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.avatar, .notification { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; padding: 0; }
.notification { background: var(--paper); border: 1px solid var(--border); color: var(--muted); }
.avatar { background: #e1eeeb; color: var(--dark-brand); border: 0; font-size: .76rem; font-weight: 730; }
.badge { display: grid; place-items: center; position: absolute; top: -3px; right: -3px; width: 19px; height: 19px; border-radius: 50%; background: #b4482d; color: white; font-size: .66rem; font-weight: 750; }
.nav { display: flex; gap: 6px; padding: 7px 20px 8px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button, .chip { flex: 0 0 auto; min-height: 32px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper); color: #505865; font-size: .79rem; font-weight: 540; }
.nav button[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: white; }
.chip[aria-pressed="true"] { border-color: #b4d8d4; background: var(--tint); color: var(--dark-brand); font-weight: 700; }
.nav button:hover:not([aria-current="page"]), .chip:hover { border-color: var(--brand); }
.main { padding: 12px 16px 34px; }
h1, h2 { font-size: 1rem; font-weight: 740; letter-spacing: -.018em; }
.greeting { margin: 0 4px 12px; font-size: 1.125rem; line-height: 1.32; }
.greeting span { color: #777e89; }
.card { width: 100%; padding: 16px; background: var(--paper); border: 1px solid var(--border); border-radius: 18px; }
.main > section > .card + .card { margin-top: 12px; }
.home-card { display: block; text-align: left; }
.home-card:hover, .shortcut:hover { border-color: #9acbc5; }
.card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: .9rem; }
.chevron { margin-left: auto; color: #767b82; font-size: 1.55rem; line-height: 1; }
.icon-tile { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--dark-brand); }
.tags, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tags > span { padding: 3px 9px; border-radius: 999px; background: var(--pill); color: #4e5560; font-size: .72rem; font-weight: 650; }
.rows { display: grid; gap: 7px; }
.pill-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; padding: 6px 11px; border: 0; border-radius: 14px; background: var(--pill); font-size: .87rem; }
.pill-row strong { font-weight: 670; }
.pill-row small, .sample-detail small { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.pill-row.accented { background: var(--tint); color: var(--dark-brand); }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.shortcut { display: flex; align-items: center; gap: 8px; min-height: 46px; min-width: 0; border-radius: 14px; padding: 8px 11px; text-align: left; font-size: .81rem; }
.shortcut strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut .icon-tile { width: 26px; height: 26px; }
.shortcut [data-icon]::before { scale: .82; }
#appointments .chips { margin-top: 8px; }
.plan-card { padding: 17px; border-radius: 17px; }
.plan-card > .chips { margin-top: 8px; }
.plan-card .chip { min-height: 26px; padding: 3px 10px; }
.plan-card .card-heading { margin-bottom: 12px; }
#plan-date { margin-left: auto; color: var(--muted); font-size: .76rem; }
.meal { border-radius: 16px; background: var(--pill); min-width: 0; }
.meal summary, .sample-detail summary { display: flex; list-style: none; align-items: center; gap: 8px; cursor: pointer; min-height: 37px; padding: 7px 10px; font-size: .84rem; }
.meal summary::-webkit-details-marker, .sample-detail summary::-webkit-details-marker { display: none; }
.meal summary { min-height: 34px; padding: 5px 11px; }
.meal summary > strong { flex: 0 0 auto; }
.meal-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: #666d78; font-size: .8rem; }
.meal-marker { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; border: 1.5px solid #d4d6d1; border-radius: 50%; background: white; font-size: .72rem; }
.meal-marker.recorded { border-color: var(--dark-brand); background: var(--dark-brand); color: white; }
.meal-marker.partial { border-color: var(--brand); background: linear-gradient(90deg, var(--brand) 50%, white 50%); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.meal-content { margin: 0 9px 9px; padding: 9px; background: var(--paper); border-radius: 11px; font-size: .84rem; }
.meal-content time { color: var(--muted); font-size: .78rem; }
.food-list { list-style: none; padding: 0; margin: 4px 0; }
.food { padding: 7px 0; }
.food-line { display: flex; justify-content: space-between; gap: 8px; }
.food + .food { border-top: 1px solid var(--border); }
.food-line > span:last-child { white-space: nowrap; }
.food-status { min-height: 35px; width: auto; max-width: 100%; font-size: .78rem; border-radius: 999px; }
.food-status[data-status="eaten"], .food-status[data-status="swapped"] { background: var(--tint); border-color: #b4d8d4; color: var(--dark-brand); }
.food-status[data-status="skipped"] { background: var(--pill); }
.meal-note, .swap { margin: 4px 0; color: var(--muted); }
.meal-note { border-top: 1px solid var(--border); padding-top: 6px; }
.plan-tools { display: grid; gap: 6px; margin: 8px 0 0; }
.plan-tools .week-card { background: transparent; border-color: transparent; padding: 0 10px; }
.week-card > summary { cursor: pointer; font-weight: 670; font-size: .86rem; }
.plan-tools summary { padding: 6px; color: var(--dark-brand); }
.plan-tools .chips { margin: 5px 0 8px; }
.week .chip { flex: 1; padding-inline: 4px; }
.shopping-items { list-style: none; padding: 0; margin: 0; }
.shopping-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 7px 6px; font-size: .83rem; border-bottom: 1px solid var(--border); }
.shopping-item > span { text-align: right; color: var(--muted); }
.primary { border: 0; border-radius: 14px; min-height: 37px; padding: 7px 13px; background: var(--dark-brand); color: white; font-size: .86rem; font-weight: 710; }
.primary:hover { background: #165e56; }
.print-button { display: grid; place-items: center; width: 100%; min-height: 34px; margin-top: 12px; border-radius: 16px; text-decoration: none; }
.diary-form { display: grid; gap: 11px; }
.diary-form .card-heading { margin-bottom: 0; }
.diary-form .muted { font-size: .83rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label { display: block; font-size: .84rem; font-weight: 650; }
label small { color: var(--muted); font-weight: 500; }
input, textarea, select { display: block; width: 100%; min-width: 0; min-height: 41px; margin-top: 3px; padding: 6px 9px; border: 1px solid #c6ceca; border-radius: 8px; background: var(--paper); color: var(--ink); }
textarea { resize: vertical; }
.form-actions, .entry-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.text-button { border: 0; border-radius: 8px; padding: 6px 8px; background: transparent; color: var(--dark-brand); font-size: .83rem; font-weight: 680; }
.text-button:hover { background: var(--tint); }
.history { margin-top: 14px; }
.history h2 { margin-bottom: 7px; }
#entries, #plan-entries { display: grid; gap: 8px; }
.entry h3, .entry p, .empty { font-size: .86rem; }
.entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
.entry time, .entry-note, .empty { color: var(--muted); }
.entry time { font-size: .79rem; }
.remove { color: #8c352f; }
.conversation, .sent-messages { display: grid; gap: 9px; }
.sent-messages:empty { display: none; }
.message { justify-self: start; background: var(--pill); border-radius: 13px; padding: 8px 11px; font-size: .86rem; }
.message-self { justify-self: end; background: var(--tint); }
.sample-detail { padding: 0; border-radius: 14px; }
.sample-detail summary { min-height: 50px; padding: 8px 13px; }
.sample-detail summary > strong { flex: 1; }
.sample-detail p { padding: 0 13px 12px; font-size: .84rem; color: var(--muted); }
.demo { text-align: center; margin-top: 17px; color: var(--muted); font-size: .72rem; }
.toast { position: fixed; z-index: 3; right: 12px; bottom: 12px; max-width: calc(100% - 24px); border-radius: 9px; background: #165e56; color: white; padding: 8px 11px; font-size: .82rem; }
.toast:empty { padding: 0; }
.toast[data-error="true"] { background: #803630; }
.header-panel {
  position: absolute;
  top: 100%;
  right: 13px;
  width: min(275px, calc(100% - 26px));
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 11px 13px 9px;
  box-shadow: 0 14px 26px #20252a18;
}
.header-panel h2 { font-size: .88rem; margin-bottom: 4px; }
.notice-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 3px; text-align: left; border: 0; border-radius: 8px; background: transparent; }
button.notice-row:hover { background: var(--tint); }
.notice-row > span:last-child { min-width: 0; }
.notice-row strong, .notice-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-row strong { font-size: .79rem; }
.notice-row small { color: var(--muted); font-size: .74rem; }
.notice-row .icon-tile { width: 27px; height: 27px; }
.notice-row.read .icon-tile { color: var(--muted); background: var(--pill); }
.appointment-date { margin: 4px 0 10px; font-size: .87rem; }
.appointment-date span { color: var(--muted); }
.inline-form { display: grid; gap: 8px; margin-top: 12px; }
.message-form { display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: white; border-radius: 16px; padding: 4px 6px 4px 11px; }
.message-form input { margin: 0; min-height: 34px; padding: 4px 0; border: 0; }
.message-form button { border: 0; }
.day-count { margin-left: auto; color: var(--dark-brand); font-weight: 720; font-size: .83rem; }
.diary-day-picker { display: flex; gap: 6px; margin-bottom: 10px; }
.diary-progress > .text-button { margin-top: 7px; }
[data-icon="send"]::before { content: ""; display: block; width: 14px; height: 14px; background: currentColor; clip-path: polygon(0 43%, 100% 0, 63% 100%, 43% 59%, 76% 26%, 30% 54%); }
[data-icon]::before { display: block; color: currentColor; width: 15px; height: 15px; font: 1rem/1 system-ui, sans-serif; text-align: center; }
[data-icon="plan"] { position: relative; }
[data-icon="plan"]::before, [data-icon="plan"]::after { content: ""; position: absolute; }
[data-icon="plan"]::before {
  width: 14px; height: 17px; transform: rotate(-42deg);
  background:
    linear-gradient(currentColor, currentColor) 4px 0 / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 0 / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 10px 0 / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 7px / 7px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 7px / 1.5px 10px no-repeat;
}
[data-icon="plan"]::after {
  width: 5px; height: 16px; transform: rotate(42deg);
  border-left: 1.5px solid currentColor; border-radius: 5px 0 0 0;
  background: linear-gradient(currentColor, currentColor) 0 60% / 4px 1px no-repeat;
}
[data-icon="calendar"]::before { content: ""; border: 1.5px solid currentColor; border-radius: 3px; background: linear-gradient(currentColor,currentColor) 50% 38% / 100% 1px no-repeat; }
[data-icon="chat"]::before { content: ""; border: 1.5px solid currentColor; border-radius: 50% 50% 50% 3px; }
[data-icon="diary"]::before, [data-icon="book"]::before, [data-icon="report"]::before { content: ""; border: 1.5px solid currentColor; border-radius: 2px; border-left-width: 2px; background: repeating-linear-gradient(currentColor 0 1px,transparent 1px 4px) center / 55% 7px no-repeat; }
[data-icon="bell"]::before { content: ""; margin-top: -3px; width: 13px; height: 15px; border: 1.5px solid currentColor; border-radius: 7px 7px 3px 3px; box-shadow: 0 4px 0 -3px currentColor; }
@media (max-width: 350px) {
  .tags { gap: 4px; }
  .tags > span { padding-inline: 6px; font-size: .67rem; }
  .pill-row { gap: 5px; padding-inline: 8px; }
  .pill-row small { white-space: normal; text-align: right; }
}
@media (min-width: 600px) {
  .layout { margin: 18px auto; min-height: calc(100dvh - 36px); }
}
@media print {
  body { background: white; }
  .layout { width: 100%; max-width: none; margin: 0; }
  .header, .skip, .toast, .print-button, .week-card, .demo, .food-status, #plan > .card:first-child { display: none !important; }
  .card { border: 0; padding: 0; }
  .meal { break-inside: avoid; margin-bottom: 10px; }
}

.appointment-card { padding: 17px; }
.appointment-card .card-heading { margin: 0; }
.appointment-card .card-heading h1 { font-size: .94rem; }
.appointment-date { margin: 6px 0 11px 43px; color: var(--muted); font-size: .83rem; }
.appointment-card > .chips { margin-left: 43px; }
.appointment-confirm { background: var(--dark-brand); border-color: var(--dark-brand); color: white; }
.appointment-chevron { margin-left: auto; color: #838783; font-size: 1.35rem; }
.appointment-detail { margin: 12px 0 0 43px; border-top: 1px solid var(--border); padding-top: 8px; font-size: .84rem; }
.appointment-past summary, .document-card summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.appointment-past summary::-webkit-details-marker, .document-card summary::-webkit-details-marker { display: none; }
.appointment-past small, .document-card summary small { margin-left: auto; color: var(--muted); font-size: .79rem; }
.appointment-past p { margin: 10px 0 0 44px; color: var(--muted); font-size: .84rem; }
.appointment-tools { margin-top: 7px; padding-left: 6px; }
.appointment-tools details { padding: 6px; font-size: .83rem; color: var(--muted); }
.appointment-tools summary { cursor: pointer; }
#appointment-editor .inline-form { margin-top: 0; }

.card.conversation { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: min(550px, calc(100dvh - 150px)); }
.conversation-log { display: grid; align-content: start; gap: 9px; flex: 1; overflow: auto; min-height: 120px; max-height: min(455px, calc(100dvh - 235px)); }
.conversation .message { max-width: 87%; overflow-wrap: anywhere; padding: 8px 13px; border-radius: 18px; }
.conversation .message-studio { justify-self: end; background: var(--dark-brand); color: white; border-bottom-right-radius: 10px; }
.conversation .message-self { justify-self: start; background: var(--pill); border-bottom-left-radius: 10px; }
.conversation .message-form { flex-direction: column; align-items: stretch; border-radius: 13px; padding: 5px; }
.conversation .message-form input { min-width: 0; padding-inline: 8px; font-size: .86rem; }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; min-height: 32px; min-width: 30px; padding: 0 4px; border: 0; background: transparent; }
.message-form .icon-button { color: var(--dark-brand); font-size: 1.23rem; }
.attachment-tools { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 7px; }
.file-control { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.file-control:focus-within { outline: 2px solid var(--dark-brand); }
.file-control input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; min-height: 0; }
.attachment-draft { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-radius: 9px; background: var(--tint); font-size: .8rem; padding: 3px 6px 3px 10px; margin: 3px 0; }
.attachment-draft > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-link { display: inline-block; margin-top: 5px; color: var(--dark-brand); overflow-wrap: anywhere; }
.attachment-photo { display: block; max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 8px; }
.audio-attachment audio { display: block; width: min(220px, 100%); margin-top: 5px; }

#diary-sample { gap: 12px; margin: 12px 0 4px; }
.diary-meal .card-heading { margin-bottom: 6px; }
.diary-meal p { color: var(--muted); font-size: .86rem; }
#open-diary-form { margin: 5px 0; }
.diary-progress .card-heading { margin-bottom: 0; }
.diary-day-picker { margin-top: 7px; margin-bottom: 0; }
.diary-progress .day-count { color: var(--muted); font-weight: 500; }
.section-cards { display: grid; gap: 12px; }
.document-card { padding: 17px; }
.document-card summary > strong, .recipe-label strong { font-size: .94rem; }
.document-card .recipe-icon { width: 43px; height: 43px; border-radius: 13px; font-size: 1.25rem; }
.recipe-label { display: grid; gap: 1px; }
.recipe-label small { margin-left: 0 !important; }
.recipe-card[open] .chevron { transform: rotate(90deg); }
.document-detail { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; }
.document-detail p { color: var(--muted); font-size: .86rem; margin: 3px 0 10px; }
.document-detail a { display: inline-block; text-decoration: none; }
.report-values { margin: 6px 0; font-size: .84rem; }
.report-values > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 4px 0; }
.report-values dd { margin: 0; font-weight: 700; }
.history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.history-heading .text-button[aria-pressed="true"] { background: var(--tint); }

.portal-loading .layout { visibility: hidden; }
.portal-status { margin-bottom: 12px; }
.portal-meta { color: var(--muted); font-size: .82rem; margin: 6px 0 8px; white-space: pre-wrap; }
.portal-course { color: var(--dark-brand); margin: 6px 0; font-size: .88rem; }
.portal-variants { margin: 8px 0; }
.meal-note { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Connected patient app */
[data-connected] {
  --brand: var(--portal-accent,#29978d);
  --dark-brand: var(--brand);
  --tint: color-mix(in srgb,var(--brand) 10%,white);
  --muted: #8b9099;
  --ground: #faf9f7;
  --border: #e5e3df;
  --portal-gutter: clamp(14px,4.9vw,20px);
  background: var(--ground);
  font-family: ui-sans-serif,system-ui,sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
[data-connected] .layout { max-width: 560px; margin: 0 auto; }
[data-connected] .header { position: sticky; top: 0; z-index: 3; padding-top: 12px; background: var(--ground); }
[data-connected] .topbar { padding: 0 var(--portal-gutter) 4px; min-height: 50px; }
[data-connected] .logo img { width: 80px; max-height: 46px; object-fit: contain; object-position: left center; }
[data-connected] .header-actions { gap: 12px; }
[data-connected] .avatar, [data-connected] .notification { width: 30px; height: 30px; flex: none; }
[data-connected] .avatar.selected, [data-connected] .notification[aria-expanded=true] { outline: 2px solid var(--brand); }
[data-connected] .nav { margin-inline: var(--portal-gutter); padding: 7px 0 10px; border-bottom: 1px solid var(--border); }
[data-connected] .nav[data-scroll-start], [data-connected] .nav[data-scroll-end] {
  mask-image: linear-gradient(to right, var(--nav-edge-start,#000), #000 10px, #000 calc(100% - 10px), var(--nav-edge-end,#000));
}
[data-connected] .nav[data-scroll-start] { --nav-edge-start: transparent; }
[data-connected] .nav[data-scroll-end] { --nav-edge-end: transparent; }
[data-connected] .nav button, [data-connected] .chip { min-height: 35px; padding: 6px 13px; font-size: 13px; font-weight: 500; line-height: 20px; }
[data-connected] .nav button { position: relative; }
[data-connected] .nav [aria-current="page"], [data-connected] .primary { background: var(--dark-brand); border-color: var(--dark-brand); }
[data-connected] .main { padding: 12px var(--portal-gutter) max(30px,env(safe-area-inset-bottom)); }
[data-connected] .main > section { min-width: 0; }
[data-connected] .card { border-radius: 16px; }
[data-connected] h1 { font-size: 22px; font-weight: 600; line-height: 1.22; letter-spacing: -.04em; overflow-wrap: anywhere; }
[data-connected] h2 { font-size: 15px; font-weight: 600; letter-spacing: -.025em; }
[data-connected] .greeting { margin: 0 0 16px; }
[data-connected] .greeting span { color: var(--muted); }
[data-connected] .portal-meta { color: var(--muted); font-size: 12px; }
[data-connected] .home-card { padding: 14px 16px; }
[data-connected] .home-card > .portal-meta { display: block; margin-block: 5px 0; }
.home-plan-card { padding:14px 16px 0; }
.home-plan-card .card-heading { margin-bottom:10px; }
.home-plan-card h2 { margin:0; min-width:0; overflow-wrap:anywhere; }
.home-plan-options { margin-inline:-16px; }
.home-plan-day { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%;
  min-height:48px; padding:12px 16px; border:0; border-top:1px solid var(--border); border-radius:0; background:transparent; text-align:left; }
.home-plan-day:last-child { border-radius:0 0 16px 16px; }
.home-plan-day:hover { background:var(--tint); }
.home-plan-day:focus-visible { outline:2px solid var(--brand); outline-offset:-3px; }
.home-plan-day-label { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.home-plan-day strong { font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.home-plan-day small { color:var(--dark-brand); background:var(--tint); border-radius:12px; padding:2px 8px; font-size:11px; }
.home-plan-card > .portal-meta { margin-block:0 14px; }
.today-meal { margin-bottom: 12px; border-color: #b9dcd6; background: var(--tint); padding: 13px 15px; }
.today-meal-summary, .today-meal-row { display: flex; align-items: center; gap: 10px; }
.today-meal-summary .icon-tile { background: var(--paper); }
.today-meal-row { justify-content: space-between; margin-top: 10px; }
.today-meal-row > div, .diary-day-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.today-meal-row time, .diary-day-row time { display: block; }
.today-meal-row .primary { flex-shrink: 0; min-height: 44px; }
.today-meal .text-button { display: inline-flex; align-items: center; min-height: 44px; }
.diary-day { margin-bottom: 12px; }
.diary-day-list { padding: 0; margin: 8px 0 0; list-style: none; }
.diary-day-list li + li { border-top: 1px solid var(--border); }
.diary-day-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%;
  min-height: 47px; padding: 6px 0; border: 0; background: transparent; text-align: left; }
.diary-meal-status { flex-shrink: 0; font-size: .75rem; font-weight: 650; padding: 3px 7px;
  border-radius: 8px; background: var(--pill); color: var(--muted); }
.diary-meal-status[data-status="eaten"] { background: var(--tint); color: var(--dark-brand); }
.diary-meal-status:is([data-status="partial"],[data-status="modified"]) { background: #fff2d4; color: #79501c; }
[data-connected] .card-heading { margin-bottom: 10px; font-size: 14px; }
[data-connected] .card-heading strong { font-weight: 600; }
[data-connected] .card-heading strong, [data-connected] .shortcut strong { min-width: 0; overflow-wrap: anywhere; }
[data-connected] .tags > span { padding: 4px 10px; font-size: 12px; font-weight: 400; }
[data-connected] .shortcuts { gap: 10px; margin-top: 14px; }
[data-connected] .shortcut { min-height: 54px; padding: 12px 14px; font-size: 14px; }
[data-connected] .shortcut strong { white-space: normal; }
[data-connected] .shortcut .icon-tile { width: 28px; height: 28px; }
[data-connected] .shortcut strong { font-weight: 600; }
[data-connected] .portal-unread::after, [data-connected] .portal-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #aa614d; }
[data-connected] .portal-unread::after { content: ''; top: 3px; right: 4px; }
[data-connected] .portal-dot { top: 0; right: 0; }
[data-connected] .header-panel { top: 59px; right: calc(var(--portal-gutter) + 51px); width: min(310px,calc(100% - 90px)); max-height: 55dvh; overflow: auto; padding: 14px 16px; }
[data-connected] .portal-alert { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 calc(-1 * var(--portal-gutter)) 28px; width: calc(100% + 2 * var(--portal-gutter)); }
.portal-alert strong { font-size: 13px; font-weight: 600; }
.portal-alert p { color: var(--muted); font-size: 12px; }
.portal-alert .primary { padding: 6px 12px; border-radius: 999px; font-size: 13px; min-height: 30px; }
.portal-alert .icon-tile { width: 28px; height: 28px; }
.portal-alert .icon-button { color: var(--muted); min-width: 18px; }
.portal-empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 39px 16px; }
.portal-empty .icon-tile { width: 43px; height: 43px; }
.portal-empty p { color: var(--muted); font-size: .89rem; }
.section-title { margin: 0 0 16px; }
.section-title:has(+ .section-intro) { margin-bottom: 6px; }
.section-intro { color: #817b73; font-size: 14px; margin-bottom: 16px; }
.contents-empty { background: #f2f0ec; margin-top: 19px; }
.plan-publication, .plan-date-header, .patient-meal-heading, .recipe-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.plan-publication { margin-top: 0; align-items: start; position:relative; padding-right:84px; }
.plan-publication > .portal-pdf { position:absolute; top:0; right:0; }
.plan-publication h1 { min-width: 0; overflow-wrap: anywhere; }
.portal-pdf { display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; min-height: 34px; padding: 6px 14px; border-radius: 11px; font-weight: 500; box-shadow: 0 4px 12px #23443b12; }
.portal-shopping-link { display: flex; align-items: center; gap: 12px; text-align: left; margin-block: 16px 14px; padding: 10px 16px; }
.shopping-link-label { display: grid; min-width: 0; gap: 2px; }
.shopping-link-label strong { font-size: 15px; font-weight: 600; }
.shopping-link-label small { color: var(--muted); font-size: 12px; font-weight: 400; }
.portal-day-types .chip { border-radius: 12px; font-size: 13px; }
.portal-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px; margin-block: 8px; }
.portal-strip::-webkit-scrollbar { display: none; }
.plan-dates { margin: 14px 0; padding: 14px 16px; }
.plan-date-header h2 { font-size:14px; line-height:21px; }
.plan-date-header small { color: var(--muted); white-space: nowrap; }
.plan-dates .portal-strip { margin: 8px 0 0; padding:0; }
.patient-meals { gap: 14px; }
[data-connected] .patient-meal { padding: 0; min-width: 0; }
.patient-meal-heading { padding: 14px 16px; border-bottom: 1px solid #efeeec; position: relative; }
.patient-meal-heading > div:first-child { flex: 1; }
.patient-meal-heading > div { min-width: 0; overflow-wrap: anywhere; }
.patient-meal-heading time { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.patient-meal { scroll-margin-top: 122px; }
.patient-meal-actions { position: absolute; right: 3px; top: 4px; z-index: 1; }
.patient-meal-actions summary { display: grid; place-items: center; color: var(--muted); font-size: 16px; width: 24px; min-height: 22px; list-style: none; cursor: pointer; opacity: 0; }
.patient-meal-actions summary::-webkit-details-marker { display: none; }
.patient-meal:is(:hover,:focus-within) .patient-meal-actions summary,.patient-meal-actions[open] summary { opacity: 1; }
.patient-meal-actions[open] { padding: 3px 8px 7px; background: var(--paper); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 16px #20252a12; }
.patient-meal-actions[open] summary { margin-left: auto; }
.patient-meal-actions button { display: block; margin: 2px 0; min-height: 34px; }
.meal-all { flex: 0 0 auto; color: var(--dark-brand); background: white; border: 1px solid #cde3e0; border-radius: 8px; min-height: 31px; padding: 4px 8px; font-size: .79rem; font-weight: 650; }
.meal-all[aria-pressed=true] { background: var(--tint); }
.patient-meal-body { padding: 12px 16px; }
.patient-meal-body .portal-variants { margin: 5px 0 9px; }
.patient-meal-body .food-list { margin: 0; }
.patient-meal-body .food { padding: 11px 0; }
.patient-meal-body .food + .food { border-color: #efeeec; }
.patient-meal-body .food-line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: start; gap: 9px; line-height: 1.35; }
.patient-meal-body .food-line .food-name { white-space: normal; }
.patient-meal-body .food > .food-line .food-name { font-weight: 400; }
.food-label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-width: 0; }
.food-name { min-width: 0; overflow-wrap: anywhere; }
.food-quantity { color: var(--muted); font-size: 12px; text-align: right; }
.patient-meal-body .food-line .food-quantity { max-width: min(136px,32vw); white-space: normal; }
.food-marker { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1.5px solid #dfddd9; background: white; font-size: 16px; line-height: 1; }
.food-marker[data-status=eaten], .food-marker[data-status=swapped] { border-color: var(--dark-brand); background: var(--dark-brand); color: white; }
.food-marker[data-status=skipped] { color: #974a3b; background: #f0e1dd; border-color: transparent; }
.food-marker[data-status=replacement] { color: #896313; background: #fbf1da; border-color: transparent; }
.food-record { margin-top: 4px; font-size: .85rem; font-weight: 610; color: var(--dark-brand); overflow-wrap: anywhere; }
.food-record[data-status=skipped] { color: #974a3b; }
.food-record[data-status=replacement] { color: #896313; }
.food-alternatives { margin: 8px 0 0 12px; padding: 0; border: 0; color: #646870; font-size: 13px; }
.food-alternatives h3 { margin: 2px 0 6px; color: #aaa59f; font-size: 11px; font-weight: 600; }
.food-alternatives .food-marker:not([data-status=swapped]) { opacity: 0; }
.food-alternatives .food-line:is(:hover,:focus-within) .food-marker { opacity: 1; }
.food-alternatives .food-line { margin-bottom: 5px; align-items: center; line-height: 1.4; }
.food-alternatives .food-record { margin: 0 0 7px; font-size: .82rem; }
.food-actions { display: grid; gap: 6px; margin-top: 8px; }
.food-action { display: flex; gap: 10px; align-items: center; padding: 8px 11px; min-height: 38px; text-align: left; border: 1px solid #f0eeec; border-radius: 10px; background: var(--ground); font-size: .9rem; }
.food-action .action-symbol { color: #777e89; font-size: 1.12rem; }
.food-action[aria-pressed=true] { color: var(--dark-brand); background: var(--tint); border-color: #cee4e1; }
.food-action.remove-mark { background: none; border-color: transparent; color: var(--muted); }
.replacement-box { display: grid; gap: 8px; padding: 12px; border: 1px solid #f0eeec; border-radius: 10px; background: var(--ground); }
.replacement-box input { border-color: #ddd9d5; border-radius: 10px; min-height: 38px; margin: 0; }
.replacement-box input[type=search] { border-color: #bcdcd7; padding-inline-start: 37px; }
.replacement-results { max-height: 220px; overflow: auto; background: white; border-radius: 10px; }
.search-result { display: block; padding: 9px 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #efeeec; background: white; }
.replacement-item { margin-block: 4px; border-bottom: 1px solid #efeeec; padding-bottom: 5px; }
.replacement-weight { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.replacement-weight input { width: 74px; }
.replacement-save { justify-self: end; }
.replacement-items:empty { display: none; }
[data-connected] .primary:disabled, .icon-button:disabled { opacity: .5; cursor: default; }
.recipe-name, .recipe-badge, .portal-back { text-align: left; background: none; border: 0; padding: 0; }
.recipe-name { color: var(--dark-brand); overflow-wrap: anywhere; }
.recipe-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--dark-brand); font-size: 11px; font-weight: 600; margin: 0; }
.recipe-label { padding: 1px 6px; border-radius: 999px; background: var(--tint); }
.recipe-badge > span:last-child { font-size: 17px; line-height: 1; }
.portal-back { color: var(--muted); font-size: .84rem; padding: 7px 0; }
.recipe-top { margin: 7px 0 14px; }
.recipe-top { flex-wrap: wrap; }
.recipe-plan-back { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 0;
  background: transparent; color: var(--muted); font-weight: 500; }
.recipe-return { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 16px; }
.free-diary { display: grid; gap: 14px; }
.free-diary .section-intro { margin: -7px 0 0; }
.diary-days { margin: 0; }
.free-diary-day { display: grid; gap: 13px; }
.free-diary-day > .portal-meta { margin-top: -9px; }
.free-diary-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.free-diary-heading h3 { font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.free-diary-heading input { width: 118px; min-width: 0; min-height: 38px; margin: 0; font-size: .9rem; }
.free-diary-meal textarea { min-height: 90px; margin: 0; padding: 11px 12px; border-color: var(--border); border-radius: 10px; background: var(--ground); font-size: 15px; resize: vertical; }
.free-diary-meal textarea::placeholder { color: #9ca0a8; opacity: 1; }
.free-diary-heading input { border-color: var(--border); background: var(--ground); }
.diary-skip { min-height: 34px; padding: 9px 0 0; color: #676c74; font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.free-diary-day > h2 { font-size: 22px; line-height: 1.2; margin-top: 4px; }
.diary-days .chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c6c1ba; display: inline-block; margin-right: 7px; vertical-align: 1px; }
.diary-plan-records { margin-top: 18px; color: var(--muted); }
.diary-plan-records > summary { cursor: pointer; font-size: 12px; }
.diary-skip[aria-pressed=true] { color: #974a3b; }
.diary-save-status { color: var(--muted); font-size: .77rem; min-height: 0; }
.diary-save-status:empty { display: none; }
.diary-daily { display: grid; gap: 12px; }
.diary-daily :is(input,textarea) { margin: 0; }
.diary-water { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diary-water > span { margin-right: auto; }
.diary-water button { min-width: 40px; min-height: 40px; padding: 5px; font-size: 1.15rem; }
.diary-water output { min-width: 62px; text-align: center; color: var(--muted); font-size: .9rem; }
.diary-day-navigation { display: flex; justify-content: space-between; gap: 10px; }
.diary-day-navigation button { min-height: 42px; }
.diary-day-navigation button:disabled { opacity: .45; }
.diary-completion { display: grid; gap: 8px; }
.diary-completion .primary { justify-self: start; min-height: 44px; }
.diary-entry-history { margin-top: 14px; }
.diary-entry-history > summary { min-height: 44px; color: var(--muted); font-size: .87rem; cursor: pointer; }
.diary-entry-history .entry { margin-top: 10px; }
.appointment-location { margin-top: 9px; font-size: .9rem; font-weight: 650; }
.appointment-address { white-space: pre-line; }
.recipe-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 17px; margin-bottom: 13px; }
.recipe-serving { background: var(--tint); color: var(--dark-brand); border-radius: 14px; padding: 12px 14px; font-size: .86rem; font-weight: 650; margin-bottom: 13px; }
.recipe-block { padding: 0; margin-top: 15px; overflow:hidden; }
.recipe-block h2 { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.recipe-ingredient { display: flex; gap: 9px; justify-content: space-between; margin:0 16px; padding: 13px 0; border-bottom: 1px solid #efeeec; }
.recipe-ingredient:last-child { border: 0; }
.recipe-preparation, .recipe-description, .document-detail p { white-space: pre-wrap; overflow-wrap: anywhere; }
.recipe-preparation { padding: 12px 16px; }
.recipe-steps { padding:0; margin:0 16px; list-style:none; }
.recipe-steps li { display:flex; gap:12px; align-items:flex-start; padding:14px 0; font-size:13px; line-height:1.7; }
.recipe-step-number { display:grid; place-items:center; flex:none; width:24px; height:24px; border-radius:50%; background:var(--tint); color:var(--brand); font-size:12px; font-weight:600; }
.recipe-step-text { min-width:0; }
.recipe-steps li + li { border-top: 1px solid #efeeec; }
#recipes .home-card { display: flex; align-items: center; gap: 10px; }
.recipe-list-label { min-width: 0; overflow-wrap: anywhere; }
.recipe-list-label small { display: block; color: var(--muted); margin-top: 2px; }
.recipe-thumbnail, #recipes .recipe-thumbnail-empty { width: clamp(62px,20vw,78px); height: clamp(62px,20vw,78px);
  flex: none; border-radius: 12px; object-fit: cover; }
#recipes .recipe-thumbnail-empty { background-color: #b68c60; color: #f5e4cf; }
#recipes .home-card { padding: 12px; gap: 12px; }
.recipe-list-description { margin-block: 5px; }
.recipe-collection-title { margin-top: 5px; }
[data-connected] .document-card summary > strong { min-width: 0; overflow-wrap: anywhere; }
[data-connected] .document-card summary > .chevron { flex: none; }
[data-connected] .document-card[open] summary > .chevron { transform: rotate(90deg); }
[data-connected] .document-card summary small { color: var(--muted); }
#contents .document-card { margin-bottom: 12px; }
.shopping-groups { display: grid; gap: 8px; margin-top: 16px; }
.shopping-groups h2 { text-transform: uppercase; font-size: .79rem; color: #77716a; margin-top: 8px; }
.shopping-group { padding: 0; }
.shopping-product { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid #efeeec; font-size: 14px; font-weight:400; cursor: pointer; }
.shopping-product > strong { color:var(--muted); font-size:12px; font-weight:500; }
.shopping-product small { color:var(--muted); font-size:12px; }
.shopping-product:last-child { border: 0; }
.shopping-product input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--brand); }
.shopping-product span { flex: 1; }
.shopping-product small { display: block; }
.shopping-product.checked span { color: var(--muted); text-decoration: line-through; }
.account-card h2 { text-transform: uppercase; color: #77716a; font-size: .78rem; margin-bottom: 8px; }
.app-install-guide { border-color: #dbe8df; }
.app-install-guide summary { cursor: pointer; color: #173d32; font-weight: 740; }
.app-install-guide > p { margin: 9px 0 0; color: #455e54; font-size: .88rem; line-height: 1.45; }
.app-install-guide > button { margin-top: 12px; min-height: 44px; }
.app-install-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.app-install-picker button { flex: 1 1 auto; min-height: 44px; font-size: .89rem; }
.app-install-picker button[aria-pressed=true] { background: #235b49; color: white; border-color: #235b49; }
.app-install-steps { margin-top: 10px; padding: 12px 14px; border: 1px solid #dce8e1; border-radius: 12px; background: #f2f7f2; }
.app-install-steps > p { color: #455e54; font-size: .87rem; }
.app-install-steps ol { margin: 10px 0 0; padding-inline-start: 23px; color: #235b49; font-size: .89rem; line-height: 1.45; }
.app-install-steps li::marker { font-weight: 740; }
.app-install-steps li + li { margin-top: 8px; }
.app-install-steps li > strong, .app-install-steps li > span { display: block; }
.app-install-steps li > span { color: #455e54; }
.app-install-guide > .app-install-finish { margin-top: 12px; padding: 9px 11px; border-radius: 10px; background: #edf3ee; color: #25493c; }
.account-row, .account-language { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 0; }
.account-row + .account-row, .account-language + .account-language { border-top: 1px solid #efeeec; }
.account-row small { display: block; color: var(--muted); margin-top: 2px; }
.account-active { color: #218268; background: #eaf3ee; border-radius: 999px; font-weight: 650; font-size: .78rem; padding: 4px 9px; }
.account-language { border: 0; background: transparent; width: 100%; text-align: left; }
.account-language[aria-pressed=true] { font-weight: 650; }
.account-language[aria-pressed=true] span:last-child { color: var(--dark-brand); }
.account-exit { color: #974a3b; margin-top: 12px; }
.password-form, .portal-login, .measure-form { display: grid; gap: 12px; }
[data-portal-access] { min-height: 100dvh; background: linear-gradient(#eaf2eb, #f7f6f4 390px); }
[data-portal-access] .main { width: min(100%, 480px); margin-inline: auto; padding-top: clamp(18px, 6vh, 60px); }
.portal-login { gap: 16px; padding: clamp(18px, 5vw, 28px); border-color: #dce6de; border-radius: 22px; box-shadow: 0 7px 24px #173d3210; }
.portal-access-intro { display: grid; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid #e4ebe5; }
.portal-access-intro img { width: 105px; height: auto; margin-bottom: 3px; }
.portal-access-intro h1 { font-size: clamp(1.55rem, 5.5vw, 2rem); line-height: 1.12; color: #173d32; }
.portal-access-intro p, .portal-access-hint { color: #455e54; font-size: .9rem; }
.portal-access-hint { margin-top: -10px; }
.portal-access-field { display: grid; gap: 4px; color: #25493c; font-size: .9rem; font-weight: 650; }
.portal-access-field input { min-height: 46px; margin: 0; font-size: 1rem; font-weight: 400; }
.portal-login > .primary { min-height: 48px; background: #235b49; font-size: 1rem; }
.portal-login > .primary:disabled { opacity: .75; }
.portal-login > .portal-recovery-link { justify-self: end; min-height: 44px; margin-block: -8px; padding: 4px 0; border: 0; background: transparent; color: #235b49; text-decoration: underline; font-weight: 650; }
.portal-search, .measure-value { position: relative; min-width: 0; }
.portal-search > span, .measure-unit { position: absolute; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.portal-search > span { inset-inline-start: 12px; display: grid; place-items: center; width: 17px; height: 17px; }
.portal-search > input { padding-inline-start: 37px; }
[data-connected] [data-icon=search]::before { content: ''; width: 10px; height: 10px; border: 1.6px solid currentColor; border-radius: 50%; }
[data-connected] [data-icon=search]::after { content: ''; position: absolute; width: 5px; height: 1.6px; background: currentColor; transform: rotate(45deg); right: 0; bottom: 1px; }
.measure-form input { min-height: 44px; margin: 0; border-radius: 10px; }
.measure-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 11px; }
.measure-field { display: grid; align-content: start; gap: 5px; }
.measure-field label { color: var(--muted); }
.measure-unit { inset-inline-end: 10px; font-size: .85rem; font-weight: 600; }
.measure-value:has(.measure-unit:not([hidden])) input { padding-inline-end: 56px; }
.measure-choices { display: flex; flex-wrap: wrap; gap: 6px; }
[data-connected] .measure-choices .chip { min-height: 34px; white-space: normal; max-width: 100%; text-align: left; }
.measure-form > .primary { min-height: 42px; border-radius: 10px; }
.measure-form input:disabled { background: #f8f7f5; color: var(--muted); }
.measure-feedback { color: var(--dark-brand); font-size: .85rem; font-weight: 620; }
.measure-feedback:empty { display: none; }
.measure-feedback[data-error=true] { color: #974a3b; }
.measure-history-heading { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
.measure-history-heading .portal-meta, .measure-history-empty { margin: 0; }
.measure-history-empty { padding-top: 8px; }
.measure-history-list { list-style: none; margin: 6px 0 0; padding: 0; }
.measure-history-row { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.measure-history-row:last-child { padding-bottom: 0; }
.measure-history-row time { display: block; color: var(--muted); font-size: .8rem; }
.measure-history-value { color: var(--dark-brand); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.appointment-card > .appointment-date { margin: 10px 0 3px; color: var(--ink); font-size: .92rem; font-weight: 650; }
.appointment-card > .appointment-actions { margin: 12px 0 0; }
.appointment-join { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.appointment-status { margin-inline-start: auto; border-radius: 999px; background: var(--tint); color: var(--dark-brand); font-size: .75rem; padding: 4px 8px; }
.appointment-editor:not(:empty) { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.appointment-editor .chips { margin-top: 9px; }
[data-connected] .appointment-danger { color: #974a3b; border-color: #e2c7c0; background: #fbefec; }
.conversation-header { display: flex; align-items: center; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
[data-connected] .conversation-header h1 { font-size: 1rem; }
.conversation-header .portal-meta { margin: 2px 0; }
.conversation-log:has(.portal-empty) { align-content: center; }
.conversation-log .portal-empty { border: 0; padding: 12px; }
.conversation-compose .message-form { gap: 2px; padding-inline: 5px; }
[data-connected] .conversation-compose .message-form input { min-height: 42px; font-size: 1rem; }
.conversation-compose .message-form .icon-button { min-width: 30px; min-height: 40px; font-size: 1rem; }
.conversation .message-studio { justify-self: start; background: var(--pill); color: var(--ink); border-radius: 16px 16px 16px 5px; }
.conversation .message-self { justify-self: end; background: var(--tint); color: var(--ink); border-radius: 16px 16px 5px 16px; }
.message-time { display: block; margin-top: 4px; text-align: end; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.message audio { max-width: 100%; width: 220px; }
.emoji-picker { display: grid; grid-template-columns: repeat(6,1fr); background: var(--tint); border-radius: 10px; padding: 5px; }
[data-connected] [data-icon=content], [data-connected] [data-icon=shopping],
[data-connected] [data-icon=bell] { position: relative; }
[data-connected] [data-icon=content]::before { content: ''; width: 14px; height: 9px; background: currentColor; clip-path: polygon(50% 0,100% 46%,50% 100%,0 46%); margin-top: -4px; }
[data-connected] [data-icon=content]::after { content: ''; position: absolute; width: 8px; height: 5px; border: 1.4px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; top: calc(50% + 1px); }
[data-connected] [data-icon=measure]::before { content: ''; width: 17px; height: 7px; border: 1.4px solid currentColor; border-radius: 2px; transform: rotate(40deg); background: repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 4px) 2px 0 / 13px 3px no-repeat; }
[data-connected] [data-icon=shopping]::before { content: ''; width: 15px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px 2px 4px 4px; margin-top: 4px; background: repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 4px) 3px 2px / 9px 5px no-repeat; }
[data-connected] [data-icon=shopping]::after { content: ''; position: absolute; width: 8px; height: 6px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; top: calc(50% - 8px); }
[data-connected] [data-icon=bell]::before { width: 11px; height: 13px; border-radius: 6px 6px 3px 3px; box-shadow: none; }
[data-connected] [data-icon=bell]::after { content: ''; position: absolute; width: 5px; height: 3px; border-bottom: 1.5px solid currentColor; border-radius: 50%; bottom: calc(50% - 10px); }
[data-connected] [data-icon=book]::before { width: 16px; height: 13px; border-width: 1.5px; border-radius: 3px; background: linear-gradient(currentColor,currentColor) center / 1.5px 100% no-repeat; }
[data-connected] .notification [data-icon=bell] { display: grid; place-items: center; width: 22px; height: 22px; }
@media (max-width: 360px) {
  .patient-meal-body, .patient-meal-heading { padding-inline: 11px; }
  .meal-all { padding-inline: 5px; font-size: .72rem; }
  .measure-fields { grid-template-columns: minmax(0,1fr); }
  [data-connected] .portal-alert { gap: 6px; padding-inline: 8px; }
  [data-connected] .shortcut { padding-inline: 8px; }
}

/* Conversation in the connected patient portal. */
[data-connected] .card.conversation {
  padding: 0;
  gap: 0;
  overflow: hidden;
  min-height: min(510px, calc(100dvh - 144px));
  background: var(--paper);
}
[data-connected] .conversation-header { padding: 12px 15px; gap: 10px; }
[data-connected] .conversation-header .avatar { width: 40px; height: 40px; flex: 0 0 40px; }
[data-connected] .conversation-timeline { display: flex; flex-direction: column; flex: 1; position: relative; min-height: 0; background: #f8faf9; }
[data-connected] .conversation-log { padding: 13px; min-height: 170px; max-height: max(210px, calc(100dvh - 320px)); overscroll-behavior: contain; }
[data-connected] .conversation .message { width: fit-content; max-width: 87%; padding: 9px 12px 6px; border: 1px solid var(--border); }
[data-connected] .conversation .message p { white-space: pre-wrap; overflow-wrap: anywhere; }
[data-connected] .conversation .message-studio { background: var(--paper); }
[data-connected] .conversation .message-self { background: var(--tint); }
[data-connected] .conversation .message audio { width: min(240px, 100%); }
.conversation-date,.conversation-unread { justify-self: stretch; text-align: center; color: var(--muted); font-size: .72rem; padding-block: 5px; }
.conversation-unread { display: flex; align-items: center; gap: 7px; color: var(--dark-brand); font-weight: 700; }
.conversation-unread::before,.conversation-unread::after { content: ""; flex: 1; height: 1px; background: #c6dfd4; }
.conversation-meta { display: flex; align-items: center; justify-content: end; gap: 6px; margin-top: 3px; }
.conversation-meta :is(time,.conversation-receipt) { font-size: .66rem; color: #50635d; }
.conversation-meta .message-time { margin-top: 0; }
.conversation-receipt { font-weight: 685; }
.conversation-older,.conversation-recent { justify-self: center; margin-inline: auto; }
.conversation-recent { position: absolute; bottom: 8px; align-self: center; box-shadow: 0 1px 5px #203a2c20; }
[data-connected] .conversation-compose { padding: 10px; border-top: 1px solid var(--border); }
.conversation-compose textarea { resize: vertical; max-height: 120px; min-height: 41px; width: 100%; border: 0; padding: 6px 8px; background: transparent; font-size: 1rem; }
.conversation-tools { display: flex; gap: 1px; align-items: center; }
.conversation-tools .primary { margin-inline-start: auto; min-width: 76px; min-height: 44px; border-radius: 10px; }
.conversation-tools .primary:disabled { background: var(--pill); color: var(--muted); opacity: 1; cursor: default; }
.conversation-feedback { padding: 6px 4px 0; color: #8b4035; font-size: .78rem; }
.conversation-feedback:empty { display: none; }
.nav button[data-view="messages"] { display: inline-flex; align-items: center; gap: 4px; }
.nav-message-count { background: var(--dark-brand); color: #fff; min-width: 17px; padding: 0 4px; border-radius: 12px; font-size: .68rem; font-weight: 750; }
.nav [aria-current] .nav-message-count { background: #fff; color: var(--dark-brand); }
button.notice-row:not(.read) strong { color: var(--dark-brand); }

.patient-content-detail .patient-content-list {margin:0;padding-left:22px}
.patient-content-list>li {padding:12px 0;border-bottom:1px solid var(--line,#e6e8e6);overflow-wrap:anywhere}
.patient-content-list>li:last-child {border-bottom:0}
.patient-content-list>li>strong {display:block;margin-bottom:6px}
.patient-content-list>li>p,.patient-content-locked {margin:3px 0 0}
.patient-content-text {white-space:pre-wrap}

.recipe-collection-title{grid-column:1/-1;font-size:1rem;margin:18px 0 3px;color:var(--text,#263a33)}

/* Shared patient layout, matched to the original Cibus patient screens. */
[data-connected] .icon-tile { width:32px; height:32px; border-radius:12px; }
[data-connected] .vector-icon::before,[data-connected] .vector-icon::after { display:none; }
.vector-icon > svg { display:block; width:18px; height:18px; flex:none; }
[data-connected] .shortcut .icon-tile { width:28px; height:28px; border-radius:10px; }
[data-connected] .portal-alert .icon-tile { width:28px; height:28px; border-radius:10px; }
[data-connected] .primary { font-weight:600; }
[data-connected] .portal-variants .chip,[data-connected] .plan-dates .chip { min-height:30px; padding:4px 12px; font-size:12px; font-weight:600; }
[data-connected] .meal-all { min-height:28px; padding:3px 10px; font-size:12px; font-weight:600; }
[data-connected] .food-action { font-size:14px; font-weight:500; }
[data-connected] .portal-empty h2 { font-size:16px; }
[data-connected] .portal-empty p { font-size:13px; }
[data-connected] .card.conversation { min-height:440px; height:calc(100dvh - 250px); }
[data-connected] .conversation-timeline { flex:1; }
[data-connected] .conversation-log { flex:1; max-height:none; background:var(--ground); }
[data-connected] .conversation-header .avatar { width:34px; height:34px; flex-basis:34px; }
[data-connected] .conversation-header h1 { font-size:15px; font-weight:600; letter-spacing:-.02em; }
[data-connected] .conversation-header .portal-meta { font-size:11px; }
[data-connected] .conversation-compose { background:var(--ground); padding:12px 24px; }
[data-connected] .conversation-compose .message-form { background:var(--ground); border-radius:16px; }
[data-connected] .conversation-compose textarea { background:transparent; border:0; font-size:14px; }
[data-connected] .account-card { padding:16px; }
[data-connected] .account-row { font-size:14px; }
[data-connected] .account-row small { font-size:12px; }
[data-connected] .account-language { font-size:14px; }
.password-field { display:flex; gap:8px; align-items:center; }
.password-field input { flex:1; }
.password-field button { min-width:70px; margin-top:3px; }
[data-connected] .account-row > button { border:0; background:var(--pill); border-radius:12px; padding:6px 12px; font-size:12px; }
[data-connected] .account-row strong { font-weight:400; }
[data-connected] .account-card h2 { font-size:12px; font-weight:600; letter-spacing:.025em; }
[data-connected] .measure-form input { background:var(--ground); border-color:var(--border); min-height:42px; padding:10px 12px; font-size:14px; }
.measure-form > .portal-search > span { display:none; }
[data-connected] .measure-form .portal-search input { padding-left:12px; }
[data-connected] .measure-choices .chip { border-radius:8px; min-height:30px; padding:4px 10px; color:var(--muted); font-size:12px; }
[data-connected] .measure-choices .chip[aria-pressed=true] { color:var(--brand); }
.measure-form h2,.measure-history h2 { margin-bottom:0; }
.measure-history-row strong { font-weight:500; }
.measure-history-row .measure-history-value { font-weight:600; }
.recipe-list-label > strong { font-size:14px; font-weight:600; }
.conversation-tools > .primary { margin-left:auto; }
[data-connected] .conversation-tools .icon-tile { background:transparent; width:24px; height:24px; color:#6b6b67; }
[data-connected] .conversation-tools .vector-icon > svg { width:21px; height:21px; }
.voice-status { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:7px 3px; color:#9d493b; font-size:13px; }
.voice-recording .icon-tile { color:#b5473a!important; }
[data-connected] .portal-pdf { gap:6px; }
[data-connected] .portal-pdf .icon-tile { width:18px; height:18px; color:inherit; background:none; }
[data-connected] .notification > .icon-tile { width:20px; height:20px; background:none; color:var(--muted); }
@media(max-width:420px){
  [data-connected] .portal-alert { grid-template-columns:28px minmax(0,1fr) auto; gap:8px; }
  .portal-alert .primary { grid-column:2; justify-self:start; margin-top:2px; }
  .portal-alert .icon-button { grid-column:3; grid-row:1; }
  [data-connected] .conversation-compose { padding:10px 12px; }
  .patient-meal-body .food-line { gap:7px; }
  .patient-meal-body .food-line .food-quantity { max-width:100px; }
  [data-connected] .greeting { font-size:22px; }
}
/* Activity sharing reuses the account card and the studio colour. */
.activity-card h2{margin-bottom:.4rem}.activity-card>p{line-height:1.5}.activity-status{font-weight:700;color:var(--brand,#257e75)}
.activity-guide{padding-left:1.4rem;display:grid;gap:1.1rem}.activity-guide li>strong{display:block}.activity-guide li p{margin:.35rem 0;line-height:1.5}
.activity-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;text-align:center;margin:.35rem 0}
.activity-actions{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}.activity-card label{display:grid;gap:.4rem;margin:.8rem 0}
.activity-card select,.activity-card textarea{width:100%;max-width:100%;padding:.7rem;border:1px solid #ccd9d6;border-radius:10px;font:inherit;background:white;color:inherit}
.activity-card textarea{min-height:90px;overflow-wrap:anywhere}.activity-automation{margin:1rem 0}.activity-automation summary{font-weight:600;cursor:pointer}.activity-automation p{line-height:1.5}

.activity-device-picker{display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}.activity-device-picker button{flex:1;min-width:130px;white-space:normal;line-height:1.35}.activity-device-picker button[aria-pressed=true]{background:var(--portal-accent);color:#fff;border-color:var(--portal-accent)}
.activity-form{display:grid;gap:.2rem}.activity-form input{width:100%;min-width:0;padding:.8rem;border:1px solid #ccd9d6;border-radius:10px;font:inherit;background:white;color:inherit}.activity-form .primary{margin-top:.5rem;justify-self:stretch}.activity-manual-note{padding:1rem;border-radius:12px;background:#f0f6f4}.activity-day{padding:1rem 0;border-top:1px solid #e0e9e6}.activity-values{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:.8rem;margin-top:.7rem}.activity-values>div{display:grid;gap:.2rem}.activity-values span,.activity-values small{font-size:.8rem;color:#526762;overflow-wrap:anywhere}.activity-values strong{font-size:1.15rem}.activity-disconnect{padding:1rem;border:1px solid #ccd9d6;border-radius:12px}.activity-disconnect button{margin:.2rem;white-space:normal}
