/* Personal records and family relationships remain separate work areas. */
.muted { color: var(--muted); }
.small-copy { font-size: var(--text-12, 12px); line-height: 1.7; }
.danger-text { color: #b83d42; }
.login-panel h1 { font-size: var(--text-23, 23px); margin-top: 22px; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 16px; }
.login-links button { min-height: 40px; }
.login-view { background: #f3f8f7; }
.home-tools { position: relative; }
.home-tools .plus-button { background: #116f64; border-color: #116f64; }
.home-tools .plus-button img { filter: brightness(0) invert(1); }
.home-tools-menu { position: absolute; z-index: 50; right: 0; top: calc(100% + 10px); width: 198px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 10px 28px #17324720; }
.home-tools-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; color: var(--ink); background: transparent; border: 0; padding: 12px; border-radius: 4px; }
.home-tools-menu button:hover { background: #edf6f4; }
.secondary-back { display: flex; align-items: center; gap: 18px; margin: 0 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.secondary-back > span { color: var(--muted); font-size: var(--text-12, 12px); }
.tool-content { max-width: 880px; min-height: 300px; }
.tool-content > p { max-width: 700px; line-height: 1.8; }
.tool-content .simulate-dialog-header, .tool-content .simulate-dialog-copy, .tool-content .simulate-range, .tool-content .simulate-options { padding-inline: 0; }
.tool-content .simulate-dialog-header { padding-top: 0; }
.tool-content .family-password-form { padding: 0; max-width: 600px; }
.profile-hero { display: flex; align-items: center; gap: 20px; padding: 12px 0 25px; border-bottom: 1px solid #ccdfdc; }
.profile-avatar { width: 76px; height: 76px; flex: 0 0 76px; display: grid; place-items: center; border-radius: 50%; color: #177569; background: #dff0eb; border: 4px solid white; font-size: var(--text-28, 28px); font-weight: 700; }
.profile-identity { flex: 1 1 190px; min-width: 0; }
.profile-identity .eyebrow { margin-top: 0; }
.profile-identity h2 { margin: 4px 0; font-size: var(--text-26, 26px); overflow-wrap: anywhere; }
.profile-identity p { margin: 0; color: var(--muted); }
.profile-completeness { color: #7a6231; font-size: var(--text-12, 12px); text-align: right; }
.profile-shortcuts { display: flex; gap: 0; flex-wrap: wrap; padding: 14px 0; margin-bottom: 8px; }
.profile-shortcuts a { padding: 9px 20px; border-right: 1px solid var(--line); color: #216d64; text-decoration: none; font-size: var(--text-13, 13px); }
.profile-shortcuts a:first-child { padding-left: 0; }
.profile-shortcuts a:last-child { border: 0; }
#me > .content-section { margin: 0; padding: 28px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; box-shadow: none; }
#me h3 { margin: 0; font-size: var(--text-16, 16px); }
#me .section-heading h2 { font-size: var(--text-20, 20px); }
#me .section-heading { margin-bottom: 8px; }
#me .section-heading + p { margin: 8px 0 22px; font-size: var(--text-13, 13px); line-height: 1.85; }
.profile-form { display: grid; gap: 22px; }
.profile-field-grid { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 16px; }
.profile-text-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.profile-form label, .record-editor label, .group-entry-grid label { min-width: 0; }
.profile-form input, .profile-form textarea, .profile-form select { background: #fff; }
.profile-form textarea { resize: vertical; min-height: 84px; }
.consent-row { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); }
.consent-row input, .check-row input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 3px 0 0; accent-color: #148d7e; }
.consent-row > span { margin: 0; min-width: 0; color: var(--ink); font-weight: 400; }
.consent-row strong { display: block; font-size: var(--text-14, 14px); }
.consent-row small { display: block; color: var(--muted); font-size: var(--text-12, 12px); line-height: 1.8; margin-top: 5px; }
.form-footer { display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.form-footer p { font-size: var(--text-12, 12px); }
.form-footer button { flex: 0 0 auto; }
.record-editor { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.ocr-upload { display: grid; gap: 14px; }
.upload-label { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 18px; border: 1px dashed #8cafa8; border-radius: 6px; background: #eef7f4; cursor: pointer; text-align: center; }
.upload-label span { font-weight: 400; margin: 0; }
#recordImage { padding: 6px; font-size: var(--text-12, 12px); }
#recordImagePreview { width: 100%; max-height: 280px; object-fit: contain; background: #e9efed; border-radius: 4px; }
.record-editor textarea { resize: vertical; min-height: 180px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; }
.check-row > span { margin: 0; padding-top: 2px; font-weight: 400; color: var(--ink); }
.record-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.records-heading { margin-top: 30px; }
.medical-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.medical-record { background: #fff; border: 1px solid var(--line); padding: 18px; border-radius: 6px; min-width: 0; }
.medical-record h3 { overflow-wrap: anywhere; }
.medical-record details { margin: 14px 0; }
.medical-record summary { color: #217970; cursor: pointer; }
.medical-record p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-13, 13px); }
.group-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; padding: 12px 0 30px; }
.group-entry-grid > form + form { padding-left: 36px; border-left: 1px solid var(--line); }
.my-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.my-group { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 22px; min-width: 0; }
.group-card-heading { display: flex; align-items: start; gap: 12px; justify-content: space-between; }
.group-card-heading h3, .group-card-heading p { overflow-wrap: anywhere; }
.group-card-heading p { color: var(--muted); font-size: var(--text-12, 12px); margin: 6px 0 18px; }
.group-card-heading > div { min-width: 0; }
.group-card-heading button { flex-shrink: 0; }
.group-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-block: 1px solid var(--line); padding: 13px 0; margin-bottom: 16px; }
.group-code > span { flex-basis: 100%; color: var(--muted); font-size: var(--text-12, 12px); }
.group-code > strong { color: #176f65; font-family: Consolas, monospace; font-size: var(--text-21, 21px); }
.group-code button { margin-left: auto; }
.group-role-label { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; }
.group-role-label span { margin: 0; white-space: nowrap; }
.group-role-label select { max-width: 160px; }
.group-card-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.personal-account-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 0 0; }
.personal-account-actions button { min-height: 44px; }
.group-toolbar { display: flex; gap: 20px; align-items: end; justify-content: space-between; padding: 0 0 22px; }
.group-toolbar > label { flex: 1; max-width: 440px; }
.group-toolbar button { margin-bottom: 3px; }
.welcoming-empty { text-align: center; padding: 44px 24px; }
.welcoming-empty p { max-width: 520px; margin: 14px auto 24px; color: var(--muted); }
.welcome-symbol { display: inline-block; font-size: 48px; color: #178575; }
.group-member-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 20px; }
.group-member { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; background: #f1f7f5; border-radius: 6px; padding: 16px; }
.group-member > div:nth-child(2) { flex: 1; min-width: 0; }
.group-member strong, .group-member span, .group-member small { display: block; overflow-wrap: anywhere; }
.group-member span { font-size: var(--text-12, 12px); margin: 4px 0; }
.group-member small { color: var(--muted); font-size: var(--text-11, 11px); }
.group-member button { min-height: 36px; margin-left: auto; }
.group-member button:disabled { opacity: .5; cursor: default; }
#familyContent > .content-section { margin-bottom: 24px; }
#familyContent .family-task-item { display: block; }
#familyContent .family-task-item > div:first-child { display: flex; flex-wrap: wrap; gap: 12px; }
#familyContent .family-task-item p { margin: 7px 0; }
#familyContent .task-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
#familyContent .family-message-item p { white-space: pre-wrap; overflow-wrap: anywhere; }
.shared-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.shared-metrics > div { border-right: 1px solid var(--line); }
.shared-metrics span, .shared-metrics strong, .shared-metrics small { display: block; }
.shared-metrics strong { font-size: var(--text-22, 22px); margin: 6px 0; overflow-wrap: anywhere; }
.shared-metrics small { color: var(--muted); }
#legacyArchive { padding-top: 24px; }
#legacyArchive article { border-bottom: 1px solid var(--line); padding: 15px 0; overflow-wrap: anywhere; }
.tag { color: #5b786f; font-size: var(--text-12, 12px); }
body.senior-mode .consent-row input, body.senior-mode .check-row input { min-height: 24px; height: 24px; width: 24px; flex-basis: 24px; }
body.senior-mode .profile-field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.senior-mode .group-card-heading { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .profile-field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-editor { grid-template-columns: minmax(0, 1fr); }
  .ocr-upload { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .ocr-upload #recordImage { grid-column: 1; }
  .ocr-upload #recordImagePreview { grid-column: 2; grid-row: 1 / 3; }
  .ocr-upload #ocrStatus { margin: 0; }
}
@media (max-width: 760px) {
  #manualEntryButton { width: auto; padding-inline: 10px; }
  #manualEntryButton span:first-child { display: none; }
  #manualEntryButton span:last-child { display: inline; font-size: var(--text-12, 12px); }
  .advice-sections-inline { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .advice-section-inline { min-width: 0; min-height: 0; padding: 14px 0; border: 0; border-top: 1px solid #d6e9e4; border-radius: 0; background: transparent; }
  .advice-section-inline:first-child { border: 0; }
  .topbar-actions { position: relative; }
  .home-tools { margin-left: auto; }
  .topbar h1 { font-size: var(--text-23, 23px); }
  .mobile-nav-button > span { height: 24px; display: flex; align-items: center; justify-content: center; }
  .profile-hero { flex-wrap: wrap; gap: 14px; }
  .profile-avatar { width: 60px; height: 60px; flex-basis: 60px; }
  .profile-identity { flex-basis: 150px; }
  .profile-completeness { width: 100%; text-align: left; }
  .profile-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .profile-shortcuts a, .profile-shortcuts a:first-child { padding: 10px; border: 0; background: #eaf4f0; text-align: center; border-radius: 4px; }
  #me > .content-section { padding-block: 24px; }
  .profile-field-grid, body.senior-mode .profile-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-text-grid, .group-entry-grid { grid-template-columns: minmax(0, 1fr); }
  .group-entry-grid { gap: 24px; }
  .group-entry-grid > form + form { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .form-footer { display: grid; gap: 8px; }
  .form-footer button { width: 100%; }
  .ocr-upload { grid-template-columns: minmax(0, 1fr); }
  .ocr-upload #recordImagePreview { grid-column: 1; grid-row: auto; }
  .record-actions > button { width: 100%; }
  .my-group { padding: 18px; }
  .group-card-heading { flex-wrap: wrap; }
  .personal-account-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .group-toolbar { flex-wrap: wrap; gap: 12px; }
  .group-toolbar > label { flex-basis: 100%; max-width: none; }
  .shared-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-content { min-height: 260px; }
  .secondary-back { gap: 10px; flex-wrap: wrap; }
  .secondary-back > span { margin-left: auto; }
  .section-heading { flex-wrap: wrap; }
  .profile-hero h2 { font-size: var(--text-23, 23px); }
}
@media (max-width: 380px) {
  body.senior-mode .profile-field-grid { grid-template-columns: minmax(0, 1fr); }
  .group-role-label { flex-wrap: wrap; gap: 8px; }
  .group-role-label select { max-width: none; }
}
