:root{--text-body:16px;--text-caption:var(--text-body);--text-section:18px;--text-title:20px;--control-gap:10px;--control-height:44px;--form-gap:20px;--form-action-gap:32px;font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:var(--theme-text);background:var(--theme-background);font-size:var(--text-body);--teal:var(--theme-primary);--line:var(--theme-border);--muted:var(--theme-muted);--accent:var(--theme-subtle)}
.home-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid var(--line);border-radius:9px;color:var(--teal);background:var(--theme-surface);text-decoration:none;font-weight:600;white-space:nowrap}
.home-link:hover{background:var(--accent)}
.platform-portal{--portal-card-title-size:22px;width:min(1140px,100%);margin:0 auto;padding:clamp(16px,3dvh,40px) 30px 16px}
#platform-home:focus,#main:focus,#education-title:focus{outline:none}
.portal-section{margin:0 0 clamp(12px,2dvh,22px)}
.portal-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.portal-section-heading h3{display:flex;align-items:center;gap:9px;margin:0;font-size:calc(var(--portal-card-title-size) + 2px)}
.portal-heading-icon{display:inline-flex;flex:none;width:1.1em;height:1.1em;color:var(--theme-primary)}
.portal-heading-icon svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.portal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.module-card{display:flex;flex-direction:column;min-width:0;padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--theme-surface)}
.module-available{border-color:var(--teal);box-shadow:0 5px 20px var(--theme-shadow)}
.module-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.module-icon{display:grid;place-items:center;flex:none;width:52px;height:52px;border-radius:14px;background:var(--accent);color:var(--teal)}
.module-icon svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.module-status{display:inline-block;width:max-content;padding:3px 10px;border-radius:20px;background:var(--theme-background);color:var(--muted);font-size:13px;white-space:nowrap}
.module-status.available{background:var(--accent);color:var(--teal)}
.module-card h3{margin:0;font-size:var(--portal-card-title-size)}
.module-card p{margin:10px 0 24px;color:var(--muted);font-size:15px;line-height:1.8}
.module-entry{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:46px;margin-top:auto;padding:10px 14px;border:1px solid var(--teal);border-radius:10px;background:var(--teal);color:var(--theme-on-primary);font-weight:600;text-decoration:none;font-size:15px}
.module-entry:hover{background:var(--theme-primary-hover)}
.module-entry.module-pending{background:var(--theme-background);border-color:var(--line);color:var(--muted);opacity:1;cursor:not-allowed}
.module-card .module-entry-status{margin:10px 0 0;font-size:14px;line-height:1.6;color:var(--theme-invalid)}
.teaching-card{flex-direction:row;align-items:center;gap:22px;background:linear-gradient(110deg,var(--theme-surface),var(--accent))}
.teaching-copy{flex:1;min-width:0}
.teaching-heading{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.teaching-copy p{margin-bottom:0}
.teaching-card .module-entry{flex:none;min-width:180px;margin-top:0}
.portal-release-note{margin:0;color:var(--muted);font-size:14px;text-align:center}
.portal-navigation-status:not(:empty){padding:12px 30px;color:var(--theme-invalid);text-align:center}
.module-entry:focus-visible,.home-link:focus-visible{outline:3px solid var(--teal);outline-offset:4px}
@media(max-width:900px){.platform-portal{--portal-card-title-size:20px;padding-top:30px}.portal-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.module-card{padding:18px}.module-card h3{font-size:var(--portal-card-title-size)}}
@media(max-width:680px){.platform-portal{padding:24px 18px}.portal-grid{grid-template-columns:1fr}.module-card-top{margin-bottom:14px}.module-card p{margin-bottom:18px}.teaching-card{align-items:flex-start;flex-wrap:wrap;gap:16px}.teaching-copy{flex-basis:calc(100% - 70px)}.teaching-card .module-entry{width:100%}}
/* Short desktop windows keep all home entries visible without clipping content. */
@media(min-width:681px) and (max-height:800px){
  body.platform-home>.topbar{min-height:64px;padding:8px 24px}
  body.platform-home .platform-portal{--portal-card-title-size:20px;display:flex;flex-direction:column;gap:12px;padding:16px 30px}
  body.platform-home .portal-section{padding:0;margin:0}
  body.platform-home .portal-section-heading{margin-bottom:8px}
  body.platform-home .portal-grid .module-card{padding:18px}
  body.platform-home .portal-grid .module-card-top{margin-bottom:12px}
  body.platform-home .portal-grid .module-icon{width:40px;height:40px}
  body.platform-home .portal-grid .module-card>h3{font-size:20px}
  body.platform-home .portal-grid .module-card>p{margin:8px 0 14px;font-size:15px;line-height:1.6}
  body.platform-home .portal-grid .module-entry{width:100%}
  body.platform-home .portal-grid .module-card .module-entry-status{margin:0;color:var(--theme-invalid)}
  body.platform-home .teaching-card{padding:16px 20px;gap:16px}
  body.platform-home .teaching-card h3{font-size:20px}
  body.platform-home .teaching-copy p{margin-top:6px;line-height:1.6}
}
@media(min-width:681px) and (max-height:650px){
  body.platform-home .platform-portal{gap:10px;padding-block:10px}
  body.platform-home .portal-grid .module-card{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:12px;gap:6px}
  body.platform-home .portal-grid .module-card-top{grid-column:2;grid-row:1;margin:0}
  body.platform-home .portal-grid .module-card-top .module-icon{display:none}
  body.platform-home .portal-grid .module-card>h3{grid-column:1;grid-row:1}
  body.platform-home .portal-grid .module-card>p{grid-column:1/-1;margin:0 0 4px;font-size:14px;line-height:1.5}
  body.platform-home .portal-grid .module-entry{grid-column:1/-1;align-self:end}
  body.platform-home .teaching-card{padding:12px 16px}
  body.platform-home .teaching-card .module-icon{width:40px;height:40px}
  body.platform-home .teaching-copy p{font-size:14px;line-height:1.5}
  body.platform-home .portal-release-note{font-size:13px}
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
*{box-sizing:border-box}
body{margin:0;line-height:1.6}
button,input,select,textarea{font:inherit}
button{font-size:var(--text-body);line-height:1.4}
input:not([type=checkbox]),select,textarea{font-size:var(--text-body);line-height:1.5}
small{font-size:var(--text-caption)}
h1{font-size:var(--text-title)}
h2,h3{font-size:var(--text-section);line-height:1.4}
button{cursor:pointer;min-height:var(--control-height);padding:9px 14px;border:1px solid var(--line);border-radius:9px;background:var(--theme-surface);color:var(--theme-text);font-weight:600;transition:background .15s}
input[type=file]::file-selector-button{font:inherit;min-height:var(--control-height);margin-inline-end:var(--control-gap)}
.button-group{display:flex;flex-wrap:wrap;align-items:center;gap:var(--control-gap)}
.button-group:empty{display:none}
button:hover{background:var(--theme-subtle)}
button:disabled{opacity:.5;cursor:default}
button.completed-action{opacity:.5}
.primary{background:var(--teal);border-color:var(--teal);color:var(--theme-on-primary)}
.primary:hover{background:var(--theme-primary-hover)}
.quiet{background:transparent;border-color:transparent}
.danger{color:var(--theme-invalid)}
.auth-secondary{display:flex;gap:var(--control-gap);flex-wrap:wrap;margin-top:14px}
.initial-card{padding:16px;margin-top:16px;border:1px solid var(--line);border-radius:12px;background:var(--accent)}
.topbar{min-height:86px;padding:18px 30px;background:var(--theme-surface);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:25px}
.brand{display:flex;gap:12px;align-items:center}
.brand-icon{font-family:Georgia,serif;font-size:32px;border-radius:12px;display:grid;place-items:center;width:46px;height:46px;background:var(--teal);color:var(--theme-on-primary)}
.brand h1{font-size:var(--text-title);letter-spacing:.5px;line-height:1.3;margin:0 0 3px}
.brand span:not(.brand-icon){font-size:var(--text-body);color:var(--muted);letter-spacing:.5px}
.brand small{margin-left:6px;font-size:inherit}
.brand>div{min-width:0}
.brand .platform-subtitle{display:block;line-height:1.6}
.brand .module-subtitle{display:none}
body:has(#shared-workspace:not([hidden])):has(#assessment-workspace:not([hidden])) .brand .platform-subtitle{display:none}
body:has(#shared-workspace:not([hidden])):has(#assessment-workspace:not([hidden])) .brand .module-subtitle{display:block}
.top-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--control-gap);min-width:0;max-width:100%;margin-left:auto}
.account-header{display:flex;align-items:center;gap:var(--control-gap);min-width:0;max-width:100%}
#account-actions:not([hidden]){display:flex;flex-direction:column;gap:var(--control-gap)}
.top-actions button{white-space:nowrap}
.top-actions button{font-size:var(--text-body)}
.settings-dropdown{position:relative;flex:none}
#settings-toggle{display:flex;align-items:center;justify-content:center;gap:8px}
.settings-chevron{width:12px;height:8px;fill:none;stroke:currentColor;stroke-width:1.6;flex:none}
#settings-toggle[aria-expanded="true"] .settings-chevron{transform:rotate(180deg)}
.settings-menu{position:absolute;z-index:30;top:calc(100% + var(--control-gap));right:0;display:flex;flex-direction:column;gap:var(--control-gap);width:150px;max-width:calc(100vw - 30px);max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);overflow-y:auto;padding:var(--control-gap);background:var(--theme-surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 32px var(--theme-shadow)}
.settings-menu button{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;text-align:center;white-space:normal;padding:9px 12px}
.top-actions :is(#platform-home-link,#settings-toggle,.settings-menu button){height:var(--control-height);min-height:var(--control-height);padding:0 12px;line-height:1.4}
.notice{font-size:var(--text-caption);padding:9px 30px;color:var(--theme-muted);background:var(--theme-subtle);border-bottom:1px solid var(--line);line-height:1.7}
.notice.warn{background:var(--theme-warning-bg);color:var(--theme-warning)}
.workspace{display:grid;grid-template-columns:282px minmax(0,1fr);min-height:calc(100vh - 124px)}
.sidebar{padding:22px 18px;display:flex;flex-direction:column;gap:12px;background:var(--theme-surface);border-right:1px solid var(--line);position:sticky;top:0;height:auto;min-height:0}
.side-heading{display:flex;justify-content:space-between;align-items:center}
.side-heading h2{font-size:var(--text-section);margin:0}
.side-heading button{font-size:var(--text-body)}
.side-tools{display:flex;gap:var(--control-gap)}
.side-tools button{flex:1;padding:9px 6px;font-size:var(--text-body)}
.sidebar input,.sidebar select{width:100%;min-height:var(--control-height)}
.patient-list{overflow-y:auto;flex:0 1 auto;min-height:0}
.patient-pager{grid-column:1/-1;flex:none;min-width:0}
.patient-pager p{margin:0 0 6px}
.patient-pager p:empty{display:none}
.patient-pager nav{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.patient-pager nav span{grid-column:1/-1;grid-row:1;text-align:center;font-size:var(--text-caption);color:var(--theme-muted);line-height:1.5}
.patient-pager nav button{min-width:0;font-size:var(--text-caption)}
.patient-deferred{color:var(--theme-muted)}
.patient-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;column-gap:8px;row-gap:7px;width:100%;text-align:left;padding:14px 12px;margin-bottom:var(--control-gap);border-color:transparent;background:transparent;position:relative}
.patient-card.active{background:var(--theme-selected);border-color:var(--theme-border-strong)}
.patient-card strong{font-size:var(--text-section);display:block;margin-bottom:0;overflow-wrap:anywhere}
.patient-card small{display:grid;grid-template-columns:subgrid;grid-column:1/-1;grid-row:2;overflow-wrap:anywhere;color:var(--muted);font-size:var(--text-caption);font-weight:400;line-height:1.8}
.patient-identifier{grid-column:1;grid-row:1;min-width:0}
.patient-admission{grid-column:1/-1;grid-row:2}
.patient-card>.tag{justify-self:end}
/* Outline, document, completed check and review shield remain distinct without color. */
.tag{display:inline-flex;align-items:center;gap:4px;font-size:var(--text-caption);line-height:1.35;border:1px dashed currentColor;border-radius:5px;background:var(--theme-surface);color:var(--theme-muted);padding:3px 6px;grid-column:2;grid-row:1;align-self:start;white-space:nowrap;font-weight:500}
.tag::before{content:'';flex:0 0 .95em;width:.95em;height:.95em;background:currentColor;mask:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='M10 6v8M6 10h8'/%3E%3C/svg%3E")}
.tag.saved{border-style:solid;color:var(--theme-status-saved-text);background:var(--theme-status-saved-bg)}
.tag.saved::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 2.5h7l3.5 3.5v11.5H5zM12 2.5V6h3.5M8 10h4.5M8 13.5h4.5'/%3E%3C/svg%3E")}
.tag.assessed{border-style:solid;color:var(--theme-status-assessed-text);background:var(--theme-status-assessed-bg);font-weight:600}
.tag.assessed::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='m6.5 10 2.3 2.5 4.7-5'/%3E%3C/svg%3E")}
.tag.reviewed{border-style:solid;border-color:var(--theme-primary);color:var(--theme-on-primary);background:var(--theme-primary);font-weight:600}
.tag.reviewed::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2 3.5 4.5v5c0 4 3 6.8 6.5 8.5 3.5-1.7 6.5-4.5 6.5-8.5v-5zM6.5 9.5l2.3 2.5 4.7-5'/%3E%3C/svg%3E")}
.tag.modified{border-style:solid;color:var(--theme-warning);background:var(--theme-warning-bg)}
.tag.modified::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.5 6a7.5 7.5 0 1 0 1 6M16.5 2v4.5H12M10 6v4l2.5 1.5'/%3E%3C/svg%3E")}
.recheck-tag{grid-column:2;grid-row:2;align-self:start;justify-self:end;padding-inline:5px;text-align:right;line-height:1.8;font-size:var(--text-caption);font-weight:400;color:var(--theme-primary);overflow-wrap:anywhere}
.recheck-tag.confirmed{color:var(--theme-success)}
#recheck-status{flex:1 1 0;min-width:0;margin-right:auto;text-align:left;overflow-wrap:anywhere}
.side-footer{border-top:1px solid var(--line);padding-top:14px;display:grid;gap:var(--control-gap)}
main{padding:27px 32px 40px;min-width:0;max-width:1600px;width:100%;margin:auto}
#main:has(>.empty:not([hidden])){align-self:start;margin:0 auto}
.empty{padding:clamp(40px,7vh,80px) 12px;text-align:center;color:var(--muted)}
.empty h2{color:var(--theme-text);font-size:var(--text-title);margin:0 0 20px}
.empty p{line-height:1.9;margin:0 0 24px}
.hint{font-size:var(--text-caption);color:var(--muted);line-height:1.8}
.patient-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px}
.eyebrow{font-size:var(--text-caption);letter-spacing:2px;color:var(--muted)}
.patient-heading h2{font-size:var(--text-title);margin:6px 0}
.patient-heading p{font-size:var(--text-caption);margin:0;color:var(--muted)}
.save-area{display:flex;align-items:center;gap:var(--control-gap);flex-wrap:wrap;justify-content:flex-end}
#save-status{font-size:var(--text-caption);color:var(--theme-success);max-width:260px}
.summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}
.metric{background:var(--theme-surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px;min-height:78px}
.metric.monitoring{background:var(--teal);color:var(--theme-on-primary);border-color:var(--teal)}
.metric span{display:block;font-size:var(--text-caption);opacity:.72;margin-bottom:6px}
.metric strong{display:block;font-size:var(--text-body);font-weight:650}
.assessment-toolbar{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);gap:12px;flex-wrap:wrap}
nav{display:flex;flex-wrap:wrap;gap:var(--control-gap)}
nav button{border:0;border-radius:0;background:transparent;color:var(--muted);padding:13px 4px;border-bottom:3px solid transparent}
nav button.active{color:var(--teal);border-bottom-color:var(--teal)}
.edit-toggle{font-size:var(--text-body);color:var(--muted)}
body:not(:is(.desktop-layout,.education-desktop-layout)) .assessment-toolbar>:is(#web-permissions,.edit-toggle){margin-left:auto;text-align:right}
input[type=checkbox]{width:17px;height:17px;accent-color:var(--teal);vertical-align:middle;margin:0 6px 0 0}
.validation{font-size:var(--text-caption);line-height:1.8;color:var(--theme-warning);background:var(--theme-warning-bg);border:1px solid var(--theme-warning-border);padding:10px 14px;border-radius:8px;margin:16px 0}
.validation:empty{display:none}
.validation.error{color:var(--theme-invalid);background:var(--theme-invalid-bg);border-color:var(--theme-invalid-border)}
.group-nav{display:flex;flex-wrap:wrap;gap:var(--control-gap);margin:16px 0}
body:not(:is(.desktop-layout,.education-desktop-layout)) .group-nav:empty{display:none}
.group-nav button{min-height:var(--control-height);font-size:var(--text-body);padding:9px 12px;background:transparent}
.group-nav button.active{background:var(--theme-selected);border-color:var(--theme-border-strong);color:var(--teal)}
.field-section{margin-top:18px;background:var(--theme-surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.section-head{padding:15px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--theme-subtle)}
.section-head h3{font-size:var(--text-section);margin:0}
.section-head .index{font-size:var(--text-section);color:var(--theme-muted)}
.section-head button{margin-left:auto;font-size:var(--text-body);min-height:var(--control-height);padding:9px 12px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 24px;padding:20px}
/* Keep assessment fields in reading order at every screen width. */
#fields[data-tab="assessment"] .field-grid{grid-template-columns:minmax(0,1fr)}
.field{min-width:0}
.assessor-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
.field.wide{grid-column:1/-1}
.field label.title{display:block;font-size:var(--text-body);font-weight:600;line-height:1.6;margin-bottom:7px}
#fields .field label.title:is([for="f-BI"],[for="f-BO"]){font-weight:700}
.field .auto-label{font-size:var(--text-caption);font-weight:400;color:var(--theme-computed-text);border:1px solid var(--theme-border);padding:1px 4px;border-radius:3px;margin-left:5px}
.field small{font-size:var(--text-caption);color:var(--muted);display:block;line-height:1.7;margin-top:5px;overflow-wrap:anywhere}
.field small.issue{color:var(--theme-warning)}

.field input:not([type=checkbox]),.field select,.field textarea{width:100%}
input:not([type=checkbox]),select,textarea{border:1px solid var(--theme-border);border-radius:7px;background:var(--theme-surface);color:var(--theme-text);padding:11px;outline:none;min-height:44px}
textarea{resize:vertical;min-height:105px;line-height:1.8}
input:focus,select:focus,textarea:focus{border-color:var(--theme-focus);box-shadow:0 0 0 3px var(--theme-focus-ring)}
input[readonly],textarea[readonly],select:disabled{background:var(--theme-computed-bg);color:var(--theme-computed-text);opacity:1}
.date-control{position:relative;display:grid;grid-template-columns:minmax(0,1fr) var(--control-height);gap:var(--control-gap);min-width:0}
.date-control>input[data-date-text]{width:100%;min-width:0}
.date-control>button{padding:9px;display:flex;align-items:center;justify-content:center}
.date-control>button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}
.field .invalid{border-color:var(--theme-invalid)!important;background:var(--theme-invalid-bg)!important}
.field .calculation-change,.metric.calculation-change{border-color:var(--theme-invalid)!important;background:var(--theme-invalid-bg)!important;color:var(--theme-invalid)!important}
.group-nav button.calculation-change{border-color:var(--theme-invalid)!important;color:var(--theme-invalid)!important}
.field:has(.calculation-change)>.title,.field:has(.calculation-change) .issue{color:var(--theme-invalid)}
.field .changed:not(.invalid){background:var(--theme-changed-bg)}
.confirm-missing{font-size:var(--text-body);display:block;margin-top:7px;color:var(--muted)}
.field-title-row{display:flex;align-items:flex-start;gap:6px;flex-wrap:nowrap;margin-bottom:5px}
.field-title-row>label.title{min-width:0;margin:0}
.weight-loss-inputs{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:4px}
.weight-loss-input{display:flex;align-items:center;gap:4px;min-width:0}
.weight-loss-input input{flex:1;min-width:0;width:100%}
.weight-loss-input span{flex:0 0 2ch}
.admission-condition{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;min-width:0}
.admission-condition>select,.admission-condition>input{width:100%;min-width:0}
.field-title-row .confirm-missing{display:inline-flex;align-items:center;gap:4px;line-height:calc(var(--text-body)*1.6);flex-shrink:0;white-space:nowrap;margin:0}
.field-title-row input[type=checkbox]{display:block;flex:none;margin:0}
.record-footer{display:flex;gap:var(--control-gap);align-items:center;flex-wrap:wrap;padding:22px 0;font-size:var(--text-body)}
.record-footer button{font-size:var(--text-body)}
.record-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--control-gap);margin-left:auto;max-width:100%;min-width:0}
.record-actions button{flex:0 0 auto;min-width:96px;height:var(--control-height);min-height:var(--control-height);padding:9px 14px;white-space:nowrap}
.record-actions #save{border-color:var(--line)}
.save-feedback{flex:0 0 100%;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:flex-end;gap:var(--control-gap);min-width:0;line-height:1.45;text-align:right;overflow-wrap:anywhere}
.record-state{display:contents}
.record-flags{display:flex;align-items:center;gap:14px}
.record-flags label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;margin:0}
.record-flags input[type=checkbox]{flex:none;margin:0}
.native-record-footer .save-feedback{align-items:center}
.native-record-footer .record-state{display:flex;flex-wrap:wrap;align-items:center;gap:20px;margin-right:auto;min-width:0;text-align:left}
.native-record-footer #recheck-status{flex:0 1 auto;margin-right:0}
.native-record-footer #save-status{margin-left:auto}
#review-status{max-width:100%;overflow-wrap:anywhere}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
[hidden]{display:none!important}
.file-import{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:16px}
.file-import>label{margin:0;white-space:nowrap}
.file-import input[type=file]{width:100%;min-width:0;max-width:100%}
.file-import input[type=file]::file-selector-button{padding:9px 14px;border:1px solid var(--line);border-radius:9px;background:var(--theme-surface);color:var(--theme-text);font-weight:600;cursor:pointer}
.file-import input[type=file]::file-selector-button:hover{background:var(--theme-subtle)}
.file-import+.hint{margin-top:20px}
#dialog-body .error{color:var(--theme-invalid)}
#dialog-body details{padding:12px 0;border-bottom:1px solid var(--line)}
#dialog-body .organ-rules{padding-left:16px}
#dialog-body .organ-rules h4{margin:16px 0 0;font-size:inherit}
#dialog-body .glim-rules h4{margin:20px 0 8px;font-size:inherit}
#dialog-body .glim-rules p{margin:0;white-space:pre-wrap}
#dialog-body .organ-rules details:last-child{border-bottom:0}
#dialog-body pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:var(--text-caption);line-height:1.8}
.guide-tools{display:flex;gap:var(--control-gap);flex-wrap:wrap;margin-bottom:12px}
.guide-view{overflow:auto;max-height:60vh;background:var(--theme-subtle)}
.guide-view img{max-width:none;display:block}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:90vw;background:var(--theme-text);color:var(--theme-on-primary);padding:12px 22px;border-radius:10px;box-shadow:0 4px 20px var(--theme-shadow);z-index:9;font-size:var(--text-body)}
.manage-row{padding:13px 0;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:var(--control-gap);flex-wrap:wrap}
.manage-row>span{flex:1 1 160px;overflow-wrap:anywhere}
.manage-actions{max-width:100%}
.manage-row button{font-size:var(--text-body)}
a{color:var(--teal)}

@media(min-width:1450px){.field-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.field.wide{grid-column:1/-1}
}

@media(max-width:1100px){.workspace{grid-template-columns:235px minmax(0,1fr)}
main{padding:22px 20px}
.sidebar{padding:20px 12px}
.summary{gap:8px}
.metric{padding:12px 10px}
.top-actions{margin-left:auto}
.field-grid{gap:18px;padding:18px}
.patient-heading{gap:10px}
.edit-toggle{padding-bottom:8px}
}

@media(max-width:760px){.topbar{padding:15px;gap:12px}
.brand-icon{width:38px;height:38px}
.top-actions{gap:var(--control-gap)}
.top-actions button{padding:9px 12px;min-height:var(--control-height)}
.notice{padding:8px 15px}
.workspace{display:block}
.sidebar{position:static;height:auto;min-height:0;padding:16px;border-right:0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.side-heading,.patient-list,.side-footer{grid-column:1/-1}
.patient-list{max-height:190px;display:flex;gap:var(--control-gap);overflow-x:auto;min-height:0}
.patient-card{min-width:190px;width:190px;flex-shrink:0}
.side-footer{display:flex;flex-wrap:wrap;padding-top:8px}
.side-footer>button,.side-footer>.side-tools{flex:1;min-width:160px}
.summary{grid-template-columns:repeat(3,minmax(0,1fr))}
.metric{min-height:74px;padding:10px}
main{padding:20px 15px}
.save-area button{padding:8px}
.record-footer{gap:var(--control-gap)}
.field-grid{gap:18px 14px;padding:16px}
.empty{padding:45px 12px}
}

@media(max-width:430px){.field-grid{grid-template-columns:1fr}
.summary{gap:6px}
.patient-heading{align-items:flex-start}
}

.brand .brand-icon{display:block;object-fit:contain;flex:none;border-radius:0;background:transparent}

/* Keep every sidebar action reachable when tablet browser chrome reduces height. */
@media(min-width:761px){
  .sidebar{height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;min-height:0;overflow-y:auto;align-self:start;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px))}

  .sidebar>*{flex-shrink:0}
  .patient-list{max-height:35vh;max-height:35dvh;overflow-y:auto}

}

@media(max-width:760px){
  .sidebar{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}

}

/* A single type scale across desktop, tablet and phone. Reflow instead of shrinking text. */
button{overflow-wrap:anywhere}

.sidebar input,.sidebar select,.side-tools,.patient-heading>div{min-width:0}

.patient-heading>div:first-child{flex:1;overflow-wrap:anywhere}

.patient-heading h2{line-height:1.4}

.metric strong{line-height:1.5;overflow-wrap:anywhere}

.metric span{line-height:1.5}

.topbar{flex-wrap:wrap}

@media(max-width:430px){
  .sidebar>#project,.sidebar>#creator-filter,.sidebar>#filter,.sidebar>#search,.sidebar>.side-tools{grid-column:1/-1}

  .summary{grid-template-columns:repeat(2,minmax(0,1fr))}

  .side-footer>button,.side-footer>.side-tools{flex-basis:100%;min-width:0}

  .save-area{max-width:48%}


}

:root { --cloud-panel-width: 440px; }
[hidden] { display: none !important; }
.auth-card { width: min(var(--cloud-panel-width), calc(100% - 32px)); margin: 36px auto; padding: 28px; background: var(--theme-surface); border: 1px solid var(--theme-border); border-radius: 16px; box-sizing: border-box; box-shadow: 0 8px 32px var(--theme-shadow); }
.auth-card label { display: block; margin: 14px 0; font-weight: 600; }
.auth-card input, .auth-card select { display: block; width: 100%; margin-top: 7px; box-sizing: border-box; }
.auth-card .remember-login{display:flex;align-items:center;gap:8px;font-weight:400}
.auth-card .remember-login input{display:inline-block;width:17px;height:17px;min-height:0;margin:0;flex:none}
#desktop-remember-status:empty{display:none}
html.native-login #desktop-remember-area[hidden]{display:block!important}
.auth-card button { margin: 0; }
.auth-card>.button-group,.auth-card>button,.auth-card form>.button-group { margin-top: var(--control-gap); }
.auth-card.wide { --cloud-panel-width: 800px; }
/* Place sign-in halfway between its original top inset and vertical centering. */
body:has(#login-panel:not([hidden])){display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
body:has(#login-panel:not([hidden]))>.topbar{flex-shrink:0}
.login-stage{display:none}
.login-stage:has(#login-panel:not([hidden])){display:flex;flex:1 0 auto;flex-direction:column;align-items:center;padding:36px 0}
.login-stage::before,.login-stage::after{content:'';flex:1 0 0}
.login-stage::after{flex-grow:3}
.login-stage #login-panel{margin:0;flex:none}
@media(max-width:700px){.login-stage:has(#login-panel:not([hidden])){padding:20px 0}}
.floating-panel { position: fixed; z-index: 40; top: 12%; left: 50%; transform: translateX(-50%); margin: 0; max-height: 78vh; overflow: auto; box-shadow: 0 0 0 100vmax var(--theme-backdrop); }
.cloud-tools { display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:var(--control-gap);align-items:center;padding:10px 24px;background:var(--theme-subtle); }
.cloud-primary-actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--control-gap);min-width:0}
.cloud-tools button{height:var(--control-height);min-height:var(--control-height);padding:9px 14px;white-space:nowrap}
.cloud-tools #sync-status{min-width:0;overflow-wrap:anywhere}
.cloud-tools #history{justify-self:end;grid-column:4;grid-row:1}
#account-name { padding: 6px 0; font-size: var(--text-body); overflow-wrap: anywhere; min-width:0; max-width:min(280px,calc(100vw - 140px)); color:var(--muted); }
@media (max-width: 700px) { .auth-card { margin: 20px auto; padding: 20px; } .floating-panel { margin: 0; top: 8%; } .cloud-tools { padding: 10px 12px; } }
.settings-heading,.settings-list-heading{display:flex;align-items:flex-start;gap:var(--control-gap);justify-content:space-between;flex-wrap:wrap}
.settings-heading{position:sticky;top:0;background:var(--theme-surface);z-index:2;padding-bottom:8px}
.settings-heading h2{margin:0}.settings-heading p{margin:6px 0 12px;color:var(--theme-muted);line-height:1.6}
.settings-layout{display:grid;grid-template-columns:minmax(230px,1fr) minmax(300px,1.2fr);gap:22px}
.settings-list{min-width:0;border-right:1px solid var(--theme-border);padding-right:20px}.settings-list-heading h3{width:100%;margin:0 0 2px}
#user-list{display:grid;gap:var(--control-gap);margin-top:14px;max-height:52dvh;overflow:auto;padding:2px}
.account-row{display:grid;text-align:left;gap:4px;width:100%;padding:12px;border:1px solid var(--theme-border);background:var(--theme-subtle);white-space:normal}
.account-row.selected{border-color:var(--theme-primary);background:var(--theme-selected)}.account-row strong{font-size:var(--text-body)}.account-row span,.account-row small{color:var(--theme-muted);overflow-wrap:anywhere}.account-row .account-edit{font-size:var(--text-body);color:var(--theme-primary)}
.settings-editor h3{margin:0 0 8px}.settings-editor label{display:block;margin:10px 0;font-weight:600}.settings-editor input,.settings-editor select{display:block;width:100%;margin-top:6px;box-sizing:border-box}
.settings-editor .settings-check{display:flex;align-items:center;gap:8px}.settings-editor .settings-check input{width:auto;margin:0}
#account-fields{margin:0;padding:0;border:0;min-width:0}#account-save{width:100%;margin-top:10px}
.settings-status{min-height:24px;margin:18px 0 10px;line-height:1.6}.settings-status.success{color:var(--theme-success)}.settings-status.error{color:var(--theme-invalid)}
@media(max-width:700px){.account-settings{padding:18px;max-height:92dvh}.settings-layout{grid-template-columns:1fr}.settings-list{border-right:0;border-bottom:1px solid var(--theme-border);padding:0 0 18px}#user-list{max-height:28dvh}.settings-list-heading{justify-content:flex-start}}

.key-code{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;background:var(--theme-subtle);border-radius:8px;font-size:var(--text-body)}#vault-fields{border:0;padding:0;margin:0}#encryption-settings{width:min(760px,92vw);max-height:90dvh;overflow:auto}
#vault-recovery-area .recovery-actions{display:flex;flex-wrap:wrap;align-items:stretch;width:100%;gap:var(--control-gap)}
#vault-recovery-area .recovery-actions>button{flex:1 1 auto;width:auto;max-width:100%;padding:9px 14px}
#registration-fields{border:0;padding:0;margin:0;min-width:0}.auth-card .auth-submit{width:100%;margin-right:0}.auth-card .text-button{border:0;background:transparent;color:var(--theme-primary);box-shadow:none;padding:6px 0;font-size:var(--text-body)}.text-button:hover{text-decoration:underline}.text-button:focus-visible{outline:2px solid var(--theme-primary);outline-offset:4px}.invited-account{padding:12px;background:var(--theme-subtle);border-radius:8px;overflow-wrap:anywhere}.activation-card{padding:16px;margin-top:18px;background:var(--theme-subtle);border-radius:10px}#account-invitation-link{display:block;width:100%;box-sizing:border-box;resize:vertical;font-size:var(--text-body);padding:10px;margin-bottom:8px;overflow-wrap:anywhere;color:var(--theme-text);background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:6px}#account-invitation-copy-status{min-height:20px;color:var(--theme-success);margin:8px 0}
#login-error:empty{display:none}
.feedback-tabs{display:flex;gap:var(--control-gap);flex-wrap:wrap;margin:18px 0}
.feedback-tabs button{display:inline-flex;align-items:center;justify-content:center;min-width:112px;height:var(--control-height);padding:9px 14px;border:1px solid var(--line);border-radius:9px;background:var(--theme-surface);color:var(--theme-text);font-size:var(--text-body);font-weight:600;line-height:1.4}
.feedback-tabs button.active{background:var(--teal);border-color:var(--teal);color:var(--theme-on-primary)}
.feedback-tabs button:hover:not(.active){background:var(--accent)}
.feedback-panel fieldset{border:0;padding:0;margin:0;min-width:0;display:grid;gap:16px}
.feedback-panel label{display:grid;gap:6px}.feedback-panel input,.feedback-panel textarea{width:100%}
.feedback-panel textarea{resize:vertical}.feedback-tools{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.feedback-item{border:1px solid var(--line);border-radius:10px;padding:16px;margin:12px 0;overflow-wrap:anywhere}
.feedback-item-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.feedback-text{white-space:pre-wrap;overflow-wrap:anywhere}.feedback-answer{padding:14px;background:var(--theme-subtle);border-radius:10px;margin:14px 0}
.feedback-attachments{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:14px;min-width:0}
.feedback-attachment{display:grid;align-content:start;gap:8px;min-width:0;margin:0;padding:12px;border:1px solid var(--line);border-radius:9px;color:var(--theme-text);overflow-wrap:anywhere}
.feedback-attachment img{display:block;width:100%;height:160px;object-fit:contain;background:var(--theme-subtle);border-radius:6px}
.feedback-attachment button{justify-self:start}.feedback-attachment:focus-visible{outline:2px solid var(--theme-primary);outline-offset:3px}
#feedback-screenshot-hint{margin:0}
#feedback-screenshot-image{display:block;max-width:100%;height:auto;margin:0 auto}
.feedback-answer h3{overflow-wrap:anywhere}.feedback-answer p{margin:8px 0}.feedback-badge{display:inline-flex;align-items:center;justify-content:center;flex:none;width:max-content;min-width:24px;height:24px;padding:0 5px;margin:0;border-radius:999px;white-space:nowrap;font-variant-numeric:tabular-nums;background:var(--theme-primary);color:var(--theme-on-primary);font-size:14px;line-height:1;text-align:center}
@media(max-width:700px){.feedback-panel{padding:18px}.feedback-tools{flex-wrap:wrap}}
.contact-content{text-align:center;padding:16px 0 4px}
.contact-content p{margin:12px 0}
.contact-qr{display:block;width:min(340px,100%);height:auto;margin:0 auto}

/* Shared modal rhythm: main-page typography, one header/body inset and one action size. */
.app-dialog{--dialog-width:760px;--dialog-edge:32px;width:min(var(--dialog-width),calc(100% - var(--dialog-edge)));max-width:calc(100% - var(--dialog-edge));max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);margin:auto;padding:0;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);color:var(--theme-text);overflow:auto;box-shadow:0 16px 56px var(--theme-shadow);line-height:1.65}
.app-dialog::backdrop{background:var(--theme-backdrop)}
.app-dialog[data-size="compact"]{--dialog-width:520px}
.app-dialog[data-size="form"]{--dialog-width:560px}
.app-dialog[data-size="wide"]{--dialog-width:960px}
.app-dialog[data-size="management"]{--dialog-width:640px}
.app-dialog .management-layout{display:grid;gap:20px;min-width:0}
.app-dialog .management-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.app-dialog #management-status{flex:1;min-width:120px;font-size:var(--text-caption)}
.app-dialog .management-toolbar #delete-all{margin-left:auto}
.app-dialog .management-section{display:grid;gap:10px;min-width:0}
.app-dialog .management-section h3{margin:0;font-size:var(--text-section)}
.app-dialog .management-list{border:1px solid var(--line);border-radius:9px;overflow:hidden;min-width:0}
.app-dialog .management-list .manage-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;margin:0}
.app-dialog .management-list .manage-row:last-child{border-bottom:0}
.app-dialog .management-list .manage-row>span{min-width:0;line-height:1.5}
.app-dialog .management-list .manage-actions{margin:0;gap:12px;justify-content:flex-end}
.app-dialog .management-list .manage-row button{margin:0}
.app-dialog .management-empty{margin:0;padding:12px;color:var(--muted)}
@media(max-width:430px){
  .app-dialog .management-layout{gap:16px}
  .app-dialog .management-list .manage-row{grid-template-columns:minmax(0,1fr);gap:10px}
}
.app-dialog.account-settings{--dialog-width:980px;padding:0}
.app-dialog.contact-dialog{--dialog-width:420px}
#encryption-settings.app-dialog{width:min(var(--dialog-width),calc(100% - var(--dialog-edge)));max-height:calc(100dvh - 48px)}
.app-dialog.floating-panel{--dialog-width:480px;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;padding:0;box-shadow:0 0 0 100vmax var(--theme-backdrop),0 16px 56px var(--theme-shadow)}
.app-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:16px;min-height:68px;padding:12px 24px;border-bottom:1px solid var(--line);background:var(--theme-surface);position:sticky;top:0;z-index:2}
.app-dialog .dialog-head h2{margin:0;min-width:0;font-size:var(--text-section);font-weight:650;line-height:1.4;overflow-wrap:anywhere}
.app-dialog .dialog-close{display:grid;place-items:center;flex:none;width:var(--control-height);height:var(--control-height);min-width:var(--control-height);min-height:var(--control-height);padding:0;border-color:transparent;border-radius:9px;color:var(--muted);font-size:24px;font-weight:400;line-height:1}
.app-dialog .dialog-close:hover{background:var(--accent);color:var(--teal)}
.app-dialog .modal-body,#dialog-body{padding:24px;line-height:1.65;min-width:0;overflow-wrap:anywhere}
.app-dialog .modal-body>*,.app-dialog .modal-body form>*,.app-dialog .modal-body fieldset>*{margin-top:0;margin-bottom:0}
.app-dialog .modal-body>*+*{margin-top:16px}
.app-dialog .modal-body>h3{margin-top:24px;font-size:var(--text-section)}
.app-dialog .modal-body>details+details{margin-top:0}
.app-dialog .modal-body>details:first-child{padding-top:0}
.app-dialog .modal-body>details:last-child{border-bottom:0;padding-bottom:0}
.rule-table-wrap{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:8px;margin:16px 0}
.rule-table{width:100%;min-width:420px;border-collapse:collapse;font-size:var(--text-body)}
.rule-table th,.rule-table td{padding:10px 12px;text-align:center;vertical-align:middle}
.rule-table thead th{background:var(--accent);font-weight:600}
.rule-table tbody th{text-align:left;font-weight:400}
.rule-table tr>*+*{border-left:1px solid var(--line)}
.rule-table tbody tr{border-top:1px solid var(--line)}
.app-dialog .modal-body form{display:grid;gap:var(--form-gap);min-width:0}
.app-dialog .modal-body fieldset{display:grid;gap:var(--form-gap);border:0;padding:0;margin:0;min-width:0}
.app-dialog .modal-body form label{display:grid;gap:8px;font-size:var(--text-body);font-weight:600;margin:0;min-width:0}
.app-dialog .modal-body input:not([type="checkbox"]),.app-dialog .modal-body select,.app-dialog .modal-body textarea{width:100%;min-width:0;font-weight:400}
.app-dialog .modal-body textarea{min-height:128px;line-height:1.65}
.app-dialog .modal-body label:has(input[type="checkbox"]){display:flex;align-items:center;gap:8px;font-weight:400}
.app-dialog .modal-body input[type="checkbox"]{flex:none;margin:0}
.app-dialog.recheck-choice .modal-body label:has(input[type="radio"]){display:flex;align-items:flex-start;gap:8px;font-weight:400}
.app-dialog.recheck-choice .modal-body input[type="radio"]{width:17px;height:17px;min-height:0;padding:0;margin:4px 0;flex:none;accent-color:var(--teal)}
.app-dialog .date-control>button{width:var(--control-height);min-width:var(--control-height);height:var(--control-height);padding:9px}
.app-dialog input[type="file"]::file-selector-button{min-width:112px;min-height:var(--control-height);padding:9px 14px;border:1px solid var(--line);border-radius:9px;background:var(--theme-surface);color:var(--theme-text);font-weight:600;line-height:1.4}
.app-dialog .modal-body .error{color:var(--theme-invalid)}
.app-dialog .modal-body [role="status"]:empty,.app-dialog .modal-body .error:empty{display:none}
.app-dialog .button-group,.app-dialog .guide-tools{gap:var(--control-gap)}
.app-dialog button:where(:not(.dialog-close):not(.account-row):not([data-date-open])){min-width:112px;min-height:var(--control-height);padding:9px 14px;font-size:var(--text-body);line-height:1.4;border-radius:9px;white-space:nowrap;overflow-wrap:normal}
.app-dialog .dialog-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--control-gap);width:100%;margin-left:0;padding-top:calc(var(--form-action-gap) - var(--form-gap) + 1px);border-top:0}
.app-dialog .dialog-actions button{min-width:112px;height:var(--control-height);margin:0}
.app-dialog .delete-status{min-width:0;margin-right:auto;font-size:.875em;text-align:left}
#reason-form .dialog-actions button,#password-form .dialog-actions button{min-width:132px}
#feedback-reply-form .dialog-actions button{min-width:190px}
#encryption-settings .dialog-actions button{min-width:208px}
.app-dialog #account-save{width:auto;margin:0}
.app-dialog .feedback-tools{margin-bottom:16px;align-items:flex-end}
.app-dialog .feedback-item p{margin:12px 0}
.app-dialog .feedback-answer{margin:16px 0 0;padding:16px}
.app-dialog .feedback-answer h3{margin:0 0 16px;font-size:var(--text-section)}
.app-dialog .settings-editor label{margin:0}
.app-dialog .settings-editor input,.app-dialog .settings-editor select{margin:0}
#account-reset-fields:has(#account-reinvite:not([hidden])){display:grid;row-gap:var(--control-gap)}
#account-reset-fields:has(#account-reinvite:not([hidden]))>.settings-check{margin-bottom:calc(var(--form-gap) - var(--control-gap))}
#account-reinvite{justify-self:start;max-width:100%}
#account-invitation-hint{margin:0}
.app-dialog .settings-layout{gap:24px}
.app-dialog .settings-list-heading{gap:16px}
.app-dialog .settings-status{min-height:0}
.app-dialog .contact-content{padding:24px;text-align:center}
.app-dialog .contact-content p{margin:16px 0 0}
.app-dialog .contact-content p:empty{display:none}
.app-dialog .guide-view{border:1px solid var(--line);border-radius:9px}
.app-dialog button:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
@media(max-width:700px){
  .app-dialog .dialog-head{padding:12px 18px}
  .app-dialog .modal-body,#dialog-body{padding:20px 18px}
  .app-dialog .settings-layout{gap:20px}
  .app-dialog .settings-list{padding-right:0}
}
@media(max-width:430px){
  .app-dialog{--dialog-edge:24px;max-height:calc(100dvh - 32px)}
  .app-dialog .dialog-head{padding:10px 16px;min-height:64px}
  .app-dialog .modal-body,#dialog-body{padding:20px 16px}
  .app-dialog .dialog-actions button{max-width:100%;height:auto;min-height:var(--control-height);white-space:normal;overflow-wrap:anywhere}
  .app-dialog .guide-tools button,.app-dialog .manage-actions button{max-width:100%;white-space:normal}
}

/* Keep single-select controls and their popup menus in the same rounded visual family. */
select:not([multiple]){border-radius:9px}
@supports (appearance:base-select){
  select:not([multiple]):not([size]),select:not([multiple]):not([size])::picker(select){appearance:base-select}
  select:not([multiple]):not([size]){display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer}
  select:not([multiple]):not([size])::picker-icon{content:"";flex:none;width:14px;height:9px;background:var(--theme-muted);mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;transition:rotate .15s}
  select:not([multiple]):not([size]):open::picker-icon{rotate:180deg}
  select:not([multiple]):not([size]):open{border-color:var(--theme-focus);box-shadow:0 0 0 3px var(--theme-focus-ring)}
  select:not([multiple]):not([size])::picker(select){width:anchor-size(width);max-width:calc(100vw - 24px);max-height:min(320px,calc(100dvh - 40px));margin-block:6px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface);color:var(--theme-text);box-shadow:0 10px 32px var(--theme-shadow);overflow:auto}
  select:not([multiple]):not([size]) option{display:flex;align-items:center;gap:10px;min-height:var(--control-height);padding:9px 12px;border:0;border-radius:8px;white-space:normal;overflow-wrap:anywhere;font:inherit;font-weight:400;line-height:1.5;cursor:pointer}
  select:not([multiple]):not([size]) option+option{margin-top:4px}
  select:not([multiple]):not([size]) option:hover,select:not([multiple]):not([size]) option:focus-visible{background:var(--accent);outline:none}
  select:not([multiple]):not([size]) option:checked{background:var(--teal);color:var(--theme-on-primary)}
  select:not([multiple]):not([size]) option::checkmark{flex:none;color:inherit}
  :is(#filter,#creator-filter)>button{all:unset;display:flex;align-items:center;flex:1;min-width:0}
  :is(#filter,#creator-filter) selectedcontent{display:flex;align-items:center;gap:10px;width:100%;min-width:0}
  :is(#filter,#creator-filter) .filter-option-label{min-width:0}
  :is(#filter,#creator-filter) .filter-count{margin-left:auto}
  :is(#filter,#creator-filter) option:checked .filter-count{background:var(--theme-on-primary);color:var(--theme-primary)}
  :is(#filter,#creator-filter) selectedcontent .filter-count{background:var(--theme-primary);color:var(--theme-on-primary)}
  select:not([multiple]):not([size]):disabled,select:not([multiple]):not([size]) option:disabled{cursor:default}
}

/* One action-button height everywhere; information cards retain their content layout. */
button:not(.patient-card):not(.account-row){display:inline-flex;align-items:center;justify-content:center;height:var(--control-height);min-height:var(--control-height);padding-block:0;white-space:nowrap;overflow-wrap:normal}
input[type="file"]::file-selector-button,.file-import input[type="file"]::file-selector-button,.app-dialog input[type="file"]::file-selector-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--control-height);min-height:var(--control-height);padding-block:0;line-height:1.4;text-align:center}
input[type="file"]:not(:disabled)::file-selector-button{cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}
input[type="file"]:not(:disabled):hover::file-selector-button{background:var(--theme-subtle)}
input[type="file"]:not(:disabled):focus::file-selector-button{background:var(--theme-subtle);border-color:var(--theme-focus)}
input[type="file"]:not(:disabled):focus-visible::file-selector-button{outline:2px solid var(--teal);outline-offset:3px}
input[type="file"]:not(:disabled):active::file-selector-button{background:var(--theme-selected);border-color:var(--theme-border-strong)}
input[type="file"]:disabled::file-selector-button{opacity:.5;cursor:default}
.date-control{align-items:stretch}
.date-control>button[data-date-open]{height:auto;align-self:stretch;margin:0}

/* User totals and patient drill-down share the main interface controls. */
.statistics-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
#statistics-status{color:var(--muted);font-size:var(--text-caption)}
.statistics-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px}
.statistics-table{width:100%;border-collapse:collapse;font-size:var(--text-body)}
.statistics-table th,.statistics-table td{padding:12px 16px;text-align:center;border-bottom:1px solid var(--line)}
.statistics-table th{background:var(--accent);font-weight:600;white-space:nowrap}
.statistics-table td:nth-child(2),.statistics-table th:nth-child(2){text-align:left;overflow-wrap:anywhere}
.statistics-table tbody tr:last-child td{border-bottom:0}
.statistics-table tbody tr:hover{background:var(--theme-subtle)}
#statistics-panel .statistics-count{min-width:64px;padding-inline:12px;color:var(--teal);background:var(--theme-subtle);border-color:var(--theme-border);font-variant-numeric:tabular-nums}
#statistics-panel .statistics-count[aria-pressed="true"]{background:var(--teal);border-color:var(--teal);color:var(--theme-on-primary)}
.statistics-patients{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#statistics-panel .statistics-patient{width:100%;min-width:0;max-width:100%;height:auto;display:block;padding:14px 16px;text-align:left;white-space:normal;overflow-wrap:anywhere;background:var(--theme-surface);border:1px solid var(--line);border-radius:12px}
#statistics-panel .statistics-patient:hover{background:var(--accent);border-color:var(--theme-border-strong)}
#statistics-panel .statistics-patient strong{display:block;margin-bottom:6px}
#statistics-panel .statistics-patient span{display:block;color:var(--muted);font-size:var(--text-caption);margin-top:4px}
@media(max-width:700px){.statistics-table{min-width:540px}.statistics-table th,.statistics-table td{padding:10px 12px}.statistics-patients{grid-template-columns:minmax(0,1fr)}}

#forgot-password{margin:12px auto 0;display:flex}#registration-security-note{padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--accent);line-height:1.7}.recovery-request-item{padding:16px;border:1px solid var(--line);border-radius:12px;margin-bottom:12px;background:var(--theme-surface)}.recovery-request-item h3{margin:0 0 8px}.recovery-request-item p{overflow-wrap:anywhere}.settings-list-heading .button-group{flex-wrap:wrap}#recovery-request-link-area{padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--accent)}

/* Give form actions a consistent breathing space below the last field. */
.auth-card form,.auth-card form fieldset{display:grid;gap:var(--form-gap);min-width:0}
.auth-card form fieldset{border:0;padding:0;margin:0}
.auth-card form label{margin:0}
.auth-card .auth-submit{margin-top:calc(var(--form-action-gap) - var(--form-gap))}
.auth-card form>.error{margin:0}
.auth-card form>.error:empty{display:none}
/* The native remember row uses the same spacing as the other form rows. */
html.native-login #login-form>.auth-submit{margin-top:0}
.app-dialog .modal-body :is(input,select,textarea)+button:not([data-date-open]){margin-top:var(--form-action-gap)}
#account-invitation-link{margin-bottom:0}
#registration-cancel{display:flex;justify-content:center;width:fit-content;max-width:100%;padding:6px 20px;margin:24px 0 0 auto}

.pending-details{overflow:auto;border:1px solid var(--line);border-radius:12px;margin-top:16px}
.pending-details table{width:100%;border-collapse:collapse;table-layout:fixed}
.pending-details th,.pending-details td{padding:12px 16px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
.pending-details th{background:var(--accent)}
.pending-details tbody tr+tr{border-top:1px solid var(--line)}
@media(max-width:700px){
  .cloud-tools{grid-template-columns:minmax(0,1fr) auto}
  .cloud-primary-actions{grid-column:1 / -1;grid-row:1}
  .cloud-tools #sync-status{grid-column:1 / -1;grid-row:2}
  .cloud-tools #pending-records{grid-column:1;grid-row:3;justify-self:start}
  .cloud-tools #history{grid-column:2;grid-row:3}
}

/* Landscape browsers and the desktop container share the three-pane workspace. */
.desktop-only,.desktop-splitter{display:none}
body:not(:is(.desktop-layout,.education-desktop-layout)) :is(.desktop-only,.desktop-splitter){display:none!important}
/* Desktop density follows the native client; the regular web layout keeps its touch sizes. */
:is(.desktop-layout,.education-desktop-layout){--text-body:14px;--text-caption:14px;--text-section:16px;--text-title:18px;--control-height:32px;--control-gap:6px;--form-gap:12px;--form-action-gap:22px;font-size:var(--text-body)}
:is(.desktop-layout,.education-desktop-layout) .topbar{min-height:64px;padding:10px 18px;gap:16px}
:is(.desktop-layout,.education-desktop-layout) .brand{gap:9px}
:is(.desktop-layout,.education-desktop-layout) .brand-icon{width:36px;height:36px}
:is(.desktop-layout,.education-desktop-layout) button{min-height:var(--control-height);border-radius:5px;padding-inline:10px}
:is(.desktop-layout,.education-desktop-layout) :is(input:not([type=checkbox]),select,textarea){min-height:var(--control-height);padding:4px 7px;border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) input[type=checkbox]{width:15px;height:15px}
:is(.desktop-layout,.education-desktop-layout) .cloud-tools{padding:6px 14px}
:is(.desktop-layout,.education-desktop-layout) .settings-menu{width:132px;padding:6px;border-radius:6px}
:is(.desktop-layout,.education-desktop-layout) .auth-card{margin:24px auto;padding:20px;border-radius:9px}
:is(.desktop-layout,.education-desktop-layout) .auth-card .remember-login input{width:15px;height:15px}
:is(.desktop-layout,.education-desktop-layout) .date-control>button svg{width:18px;height:18px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog{border-radius:9px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .dialog-head{min-height:48px;padding:8px 16px;gap:10px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .modal-body{padding:16px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .modal-body>*+*{margin-top:12px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .modal-body form label{gap:5px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog button:where(:not(.dialog-close):not(.account-row):not([data-date-open])){min-width:92px;padding:4px 10px;border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .dialog-close{font-size:20px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .settings-layout{gap:16px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .management-layout{gap:16px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .management-section{gap:8px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .management-list{border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .management-list .manage-row{padding:10px;gap:10px}
:is(.desktop-layout,.education-desktop-layout) .app-dialog .management-empty{padding:10px}
body:is(.desktop-layout,.education-desktop-layout):has(#shared-workspace:not([hidden])){overflow:hidden}
:is(.desktop-layout,.education-desktop-layout) #shared-workspace{--control-height:32px;--control-gap:6px;background:var(--theme-background)}
:is(.desktop-layout,.education-desktop-layout) #shared-workspace button{min-height:32px;padding:4px 8px;border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) #shared-workspace :is(input:not([type=checkbox]),select){min-height:32px;padding:4px 7px;border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) #shared-workspace .primary{background:var(--theme-primary);border-color:var(--theme-primary)}
:is(.desktop-layout,.education-desktop-layout) #shared-workspace .primary:hover{background:var(--theme-primary-hover)}
/* Shared three-pane proportions: keep the patient list; notes / assessment = 980 / 725. */
:is(.desktop-layout,.education-desktop-layout) .workspace{display:grid;grid-template-columns:minmax(min(200px,20%),var(--patient-width,300fr)) 8px minmax(0,1705fr);height:var(--desktop-workspace-height,calc(100dvh - 150px));min-height:0;overflow:hidden;padding:0 10px 8px}
:is(.desktop-layout,.education-desktop-layout) .desktop-splitter{display:block;min-width:8px;background:transparent;cursor:col-resize;touch-action:none;position:relative;align-self:stretch}
:is(.desktop-layout,.education-desktop-layout) .desktop-splitter::after{content:"";position:absolute;inset:35% 2px;background:var(--theme-border);border-radius:3px}
:is(.desktop-layout,.education-desktop-layout) .desktop-splitter:hover,:is(.desktop-layout,.education-desktop-layout) .desktop-splitter:focus-visible{background:var(--theme-selected);outline:2px solid var(--theme-focus);outline-offset:-2px}
:is(.desktop-layout,.education-desktop-layout) .sidebar{display:flex;position:static;height:100%;max-height:none;padding:10px 8px;background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:6px;gap:8px;overflow:auto;container-type:inline-size}
@container(max-width:190px){:is(.desktop-layout,.education-desktop-layout) .side-heading{flex-wrap:wrap}:is(.desktop-layout,.education-desktop-layout) .side-tools{flex-direction:column}:is(.desktop-layout,.education-desktop-layout) .side-footer button{white-space:normal;height:auto;min-height:var(--control-height);line-height:1.5;padding-block:8px}}
:is(.desktop-layout,.education-desktop-layout) .side-heading h2{font-size:var(--text-section)}
:is(.desktop-layout,.education-desktop-layout) .patient-list{display:block;flex:1 1 auto;max-height:none;min-height:100px;overflow:auto}
:is(.desktop-layout,.education-desktop-layout) .patient-card{min-width:0;width:100%;padding:8px 6px;row-gap:2px;margin-bottom:4px;border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) .patient-card.active{background:var(--theme-selected);border-color:var(--theme-border-strong)}
:is(.desktop-layout,.education-desktop-layout) .patient-card strong{font-size:var(--text-body)}
:is(.desktop-layout,.education-desktop-layout) .patient-card small{line-height:1.5}
:is(.desktop-layout,.education-desktop-layout) .recheck-tag{line-height:1.5}
:is(.desktop-layout,.education-desktop-layout) .side-footer{display:grid;padding-top:8px}
:is(.desktop-layout,.education-desktop-layout) .side-footer>button{min-width:0}
:is(.desktop-layout,.education-desktop-layout) #main{padding:0;max-width:none;height:100%;margin:0;overflow:hidden}
:is(.desktop-layout,.education-desktop-layout) #editor{height:100%;display:flex;flex-direction:column;min-height:0}
:is(.desktop-layout,.education-desktop-layout) .patient-heading{flex:none;margin:0;padding:7px 10px;background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:6px 6px 0 0;gap:6px}
:is(.desktop-layout,.education-desktop-layout) .patient-heading h2{margin:0 0 3px;font-size:var(--text-section)}
:is(.desktop-layout,.education-desktop-layout) .clinical-workspace{display:grid;grid-template-columns:minmax(min(218px,30%),var(--info-width,980fr)) 8px minmax(min(460px,65%),725fr);flex:1;min-height:0}
:is(.desktop-layout,.education-desktop-layout) .patient-info-pane,:is(.desktop-layout,.education-desktop-layout) .assessment-pane{min-width:0;min-height:0;display:flex;flex-direction:column;border:1px solid var(--theme-border);border-radius:0 0 6px 6px;background:var(--theme-surface);overflow:hidden}
:is(.desktop-layout,.education-desktop-layout) #info-tabs{flex:none;padding:0 10px;border-bottom:1px solid var(--theme-border);gap:16px}
:is(.desktop-layout,.education-desktop-layout) #info-tabs button{border-radius:0;padding:6px 2px;border-bottom:2px solid transparent}
:is(.desktop-layout,.education-desktop-layout) #info-tabs button.active{color:var(--theme-primary);border-bottom-color:var(--theme-primary)}
:is(.desktop-layout,.education-desktop-layout) .info-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px;flex:none}
:is(.desktop-layout,.education-desktop-layout) #info-group{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}
:is(.desktop-layout,.education-desktop-layout) #info-group button.active{background:var(--theme-selected);border-color:var(--theme-border-strong);color:var(--theme-primary)}
:is(.desktop-layout,.education-desktop-layout) .info-tools button{white-space:nowrap}
:is(.desktop-layout,.education-desktop-layout) .info-tools :is(input,select){width:100%;min-width:0}
:is(.desktop-layout,.education-desktop-layout) .info-fields,:is(.desktop-layout,.education-desktop-layout) .assessment-content{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain;padding:0 10px 10px;scrollbar-gutter:stable}
:is(.desktop-layout,.education-desktop-layout) .info-fields .field-grid{grid-template-columns:1fr;gap:10px;padding:10px}
:is(.desktop-layout,.education-desktop-layout) .info-fields textarea{min-height:160px;background:var(--theme-surface);line-height:1.7}
:is(.desktop-layout,.education-desktop-layout) .info-fields[data-tab="basic"] .field{display:grid;grid-template-columns:10em minmax(0,1fr);gap:4px 10px;align-items:start}
:is(.desktop-layout,.education-desktop-layout) .info-fields[data-tab="basic"] .field>label.title{margin:4px 0;grid-column:1;white-space:nowrap}
:is(.desktop-layout,.education-desktop-layout) .info-fields[data-tab="basic"] .field>:not(label.title){grid-column:2;min-width:0}
:is(.desktop-layout,.education-desktop-layout) .info-fields[data-tab="basic"] .field small:empty{display:none}
:is(.desktop-layout,.education-desktop-layout) .summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;padding:8px;flex:none}
:is(.desktop-layout,.education-desktop-layout) .metric{padding:5px 8px;min-height:56px;border-radius:5px;border-color:var(--theme-border)}
:is(.desktop-layout,.education-desktop-layout) .metric.monitoring{background:var(--theme-primary);border-color:var(--theme-primary)}
:is(.desktop-layout,.education-desktop-layout) .metric span{margin-bottom:2px}
:is(.desktop-layout,.education-desktop-layout) .assessment-toolbar{display:none}
:is(.desktop-layout,.education-desktop-layout) #tabs,:is(.desktop-layout,.education-desktop-layout) #web-permissions{display:none}
:is(.desktop-layout,.education-desktop-layout) #groupnav{display:flex;flex:none;gap:6px;margin:0;padding:6px 8px 8px;border-bottom:1px solid var(--theme-border);max-height:30%;overflow:auto}
:is(.desktop-layout,.education-desktop-layout) #groupnav button{min-height:32px;padding:4px 8px;white-space:nowrap}
:is(.desktop-layout,.education-desktop-layout) .desktop-only{display:block}
:is(.desktop-layout,.education-desktop-layout) .assessment-title{font-size:var(--text-section);margin:0;padding:10px 10px 0;flex:none}
:is(.desktop-layout,.education-desktop-layout) .validation{margin:8px 0;max-height:84px;overflow:auto;padding:6px 8px;line-height:1.6}
:is(.desktop-layout,.education-desktop-layout) .field-section{margin-top:10px;border-color:var(--theme-border);border-radius:5px}
:is(.desktop-layout,.education-desktop-layout) .section-head{padding:7px 10px;background:var(--theme-subtle);gap:6px}
:is(.desktop-layout,.education-desktop-layout) .section-head h3,:is(.desktop-layout,.education-desktop-layout) .section-head .index{font-size:var(--text-body)}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px;padding:10px;align-items:start}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field{display:grid;grid-template-rows:subgrid;align-items:start;text-align:left}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .assessor-pair{row-gap:inherit}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .assessor-pair>.field{grid-row:1 / span 3}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field>:is(label.title,.field-title-row){grid-row:1;margin:0}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field>:is(input,select,textarea,.date-control){grid-row:2;margin:0;text-align:left}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field>.weight-loss-inputs{grid-row:2;margin:0}
:is(.desktop-layout,.education-desktop-layout) #fields[data-tab="assessment"] .field>.issue{grid-row:3;margin:0}
:is(.desktop-layout,.education-desktop-layout) .field label.title{font-weight:500;margin-bottom:5px}
:is(.desktop-layout,.education-desktop-layout) .field small{margin-top:3px;line-height:1.5}
:is(.desktop-layout,.education-desktop-layout) .field small:empty{display:none}
:is(.desktop-layout,.education-desktop-layout) .field-title-row{display:flex;align-items:flex-start;gap:6px;flex-wrap:wrap;margin-bottom:5px}
:is(.desktop-layout,.education-desktop-layout) .field-title-row>label.title{margin:0}
:is(.desktop-layout,.education-desktop-layout) .field-title-row .confirm-missing{font-size:12px;white-space:nowrap;margin:0}
:is(.desktop-layout,.education-desktop-layout) .field-title-row input[type=checkbox]{width:12px;height:12px;margin:0}
:is(.desktop-layout,.education-desktop-layout) #fields textarea{min-height:90px;line-height:1.6}
:is(.desktop-layout,.education-desktop-layout) .field :is(input[readonly],select:disabled){background:var(--theme-computed-bg)}
:is(.desktop-layout,.education-desktop-layout) .field .changed:not(.invalid){background:var(--theme-changed-bg)!important}
:is(.desktop-layout,.education-desktop-layout) .confirm-missing{margin-top:5px}
:is(.desktop-layout,.education-desktop-layout) .record-footer{margin:0;padding:8px;gap:6px;flex:none;border-top:1px solid var(--theme-border);background:var(--theme-surface);max-height:35%;overflow:auto;justify-content:flex-end}
:is(.desktop-layout,.education-desktop-layout) .record-actions{margin-left:0;width:100%;gap:6px}
:is(.desktop-layout,.education-desktop-layout) .record-actions button{flex:1 0 auto;min-width:64px;height:32px;padding:4px 7px}
:is(.desktop-layout,.education-desktop-layout) .save-feedback{justify-content:flex-end;text-align:right}
:is(.desktop-layout,.education-desktop-layout) #save-status{max-width:100%;text-align:right}
:is(.desktop-layout,.education-desktop-layout) .field-empty{padding:12px}

.narrative-document{margin-top:16px;padding:18px 20px;background:var(--theme-surface);border:1px solid var(--line);border-radius:10px}
.narrative-group+ .narrative-group{margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}
.narrative-group h3{margin:0 0 20px;font-size:var(--text-section)}
.narrative-entry+ .narrative-entry{margin-top:22px}
.narrative-label{display:block;font-size:var(--text-body);line-height:1.7;margin-bottom:4px}
.narrative-value{font-size:var(--text-body);line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}
 :is(.desktop-layout,.education-desktop-layout) .narrative-document{margin-top:0;padding:10px 12px;border-radius:6px}
:is(.desktop-layout,.education-desktop-layout) .narrative-group h3{margin-bottom:14px}
:is(.desktop-layout,.education-desktop-layout) .narrative-entry+ .narrative-entry{margin-top:16px}
:is(.desktop-layout,.education-desktop-layout) .narrative-value{line-height:1.65}

#role-panel{width:min(480px,calc(100vw - 32px));max-height:calc(100vh - 48px);padding:24px;border:1px solid var(--theme-border);border-radius:12px;color:var(--theme-text);background:var(--theme-surface);overflow:auto}
#role-panel .panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}#role-panel h2{margin:0}
.role-options{display:grid;gap:12px}.role-choice{width:100%;text-align:left;padding:14px 16px;white-space:normal}
.account-grants{display:grid;gap:12px}.category-grant{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;padding:12px;border:1px solid var(--theme-border);border-radius:8px}
.category-grant>.settings-check{grid-column:1/-1}.category-grant label{min-width:0}.category-grant select{width:100%;min-width:0}
@media(max-width:600px){.category-grant{grid-template-columns:1fr}.category-grant>.settings-check{grid-column:auto}}
#editor .surgery-selection{margin-top:var(--control-gap);max-width:100%}
#editor .surgery-selection label{display:grid;gap:var(--control-gap);font-weight:600}
#editor .surgery-selection select{width:100%;min-width:0}
.import-progress{width:min(480px,92vw)}.import-progress progress{display:block;width:100%;height:18px;accent-color:var(--theme-primary)}.import-progress [data-file]{overflow-wrap:anywhere}.import-progress [data-message]{min-height:1.5em}

.module-status.development{background:var(--theme-warning-bg);color:var(--theme-warning)}
