@font-face {
  font-family: MedlySystem;
  src: local("Avenir Next"), local("Segoe UI");
}
:root {
  --ink: #293d39;
  --muted: #73807c;
  --pink: #cc2878;
  --pink-hover: #b51f68;
  --pink-soft: #fff0f7;
  --pink-border: #f1bad5;
  --border: #e7ebe7;
  --green: #456f59;
  --bs-primary: var(--pink);
  --bs-primary-rgb: 204, 40, 120;
  --bs-body-color: var(--ink);
  --bs-body-font-family: MedlySystem, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --bs-border-color: var(--border);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f8f9f6;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 2.7vw, 2.7rem);
  font-weight: 650;
  letter-spacing: -1.3px;
  line-height: 1.2;
}
h2 {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 1.02rem;
  font-weight: 650;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border-radius: 9px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
}
.btn-primary {
  --bs-btn-bg: var(--pink);
  --bs-btn-border-color: var(--pink);
  --bs-btn-hover-bg: var(--pink-hover);
  --bs-btn-hover-border-color: var(--pink-hover);
  --bs-btn-active-bg: var(--pink-hover);
  --bs-btn-active-border-color: var(--pink-hover);
  --bs-btn-disabled-bg: var(--pink);
  --bs-btn-disabled-border-color: var(--pink);
}
.btn-outline-primary {
  --bs-btn-color: var(--pink);
  --bs-btn-border-color: var(--pink-border);
  --bs-btn-hover-bg: var(--pink);
  --bs-btn-hover-border-color: var(--pink);
  --bs-btn-active-bg: var(--pink);
  --bs-btn-active-border-color: var(--pink);
}
.btn-light {
  --bs-btn-bg: #f2f4f1;
  --bs-btn-border-color: #f2f4f1;
}
.btn-sm {
  font-size: 12px;
  padding: 7px 12px;
}
.icon-button {
  background: transparent;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 24px;
}
.icon-button:hover {
  background: #f5f6f3;
}
.text-link {
  color: var(--pink);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.text-link .icon {
  width: 15px;
}
.sidebar {
  width: 236px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 35px 21px 22px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 35px;
  letter-spacing: -1.8px;
  font-weight: 750;
  padding: 0 12px;
  line-height: 1.2;
}
.brand-icon {
  background: var(--pink);
  color: #fff;
  font-size: 24px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.brand-dot {
  color: var(--pink);
  margin-left: -12px;
}
.sidebar-caption {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 16px 12px 21px;
  margin: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #63706a;
  min-height: 45px;
  padding: 11px 14px;
  margin-bottom: 5px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 550;
}
.nav-link .icon {
  width: 19px;
  height: 19px;
}
.nav-link:hover {
  background: #f6f7f3;
  color: var(--ink);
}
.nav-link.active {
  background: var(--pink-soft);
  color: var(--pink);
  font-weight: 650;
}
.nav-divider {
  display: block;
  border-top: 1px solid var(--border);
  margin: 19px 11px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 30px 12px 0;
  font-size: 10px;
}
.sidebar-bottom strong {
  font-weight: 600;
  font-size: 10px;
}
.sidebar-bottom p {
  color: var(--muted);
  margin: 6px 0 10px;
}
.sidebar-bottom a {
  color: var(--pink);
  display: flex;
  justify-content: space-between;
}
.privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: #709c76;
  margin-right: 7px;
}
.app-shell {
  margin-left: 236px;
}
.topbar {
  height: 84px;
  border-bottom: 1px solid var(--border);
  padding: 0 42px;
  display: flex;
  align-items: center;
  gap: 30px;
  background: #ffffff85;
}
.desktop-label {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}
.search-trigger {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  min-height: 38px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  min-width: 220px;
}
.search-trigger > span:first-child {
  font-size: 23px;
  line-height: 1;
}
.search-trigger kbd {
  margin-left: auto;
  color: #89938d;
  background: #f3f4f1;
  font-weight: 400;
  border: 1px solid var(--border);
  font-size: 10px;
}
.local-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.mobile-brand {
  display: none;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 39px 42px 25px;
  min-height: calc(100vh - 156px);
}
main:focus {
  outline: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 29px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.8px;
  color: #79847d;
  text-transform: uppercase;
  margin-bottom: 11px;
}
.page-description {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 0;
}
.welcome-card {
  border: 1px solid #f3d5e4;
  background: #fff1f7;
  border-radius: 15px;
  display: flex;
  min-height: 315px;
  padding: 32px 37px;
  position: relative;
  overflow: hidden;
  margin-bottom: 25px;
}
.welcome-copy {
  max-width: 490px;
  z-index: 1;
}
.pill {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--pink);
  border: 1px solid var(--pink-border);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 17px;
  font-weight: 600;
}
.welcome-copy h2 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.8px;
  font-weight: 550;
}
.welcome-copy p {
  max-width: 365px;
  font-size: 12px;
  line-height: 1.8;
  color: #79766c;
  margin: 15px 0 20px;
}
.welcome-copy .btn {
  font-size: 11px;
}
.welcome-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  font-size: 9px;
  color: #827d73;
}
.welcome-footnote .icon {
  width: 13px;
  height: 13px;
}
.welcome-art {
  flex: 1;
  position: relative;
  min-width: 210px;
  align-self: center;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink);
}
.art-orbit {
  position: absolute;
  border: 1px solid #efd0df;
  border-radius: 50%;
  width: 250px;
  height: 250px;
}
.orbit-two {
  width: 315px;
  height: 315px;
  border-style: dashed;
  opacity: 0.5;
}
.art-paper {
  width: 153px;
  height: 203px;
  border: 1px solid #f0d3e2;
  border-radius: 12px;
  background: #fffdf9;
  transform: rotate(-10deg);
  padding: 20px;
  box-shadow: 10px 12px 0 #f0cddd80;
  z-index: 1;
}
.art-cross {
  display: block;
  font-size: 29px;
  line-height: 1;
  margin-bottom: 12px;
}
.art-line {
  display: block;
  width: 95%;
  height: 5px;
  background: #e7e9df;
  border-radius: 3px;
  margin: 9px 0;
}
.art-line.short {
  width: 60%;
}
.art-paper svg {
  width: 100%;
  height: 50px;
  margin: 4px 0;
}
.art-check {
  z-index: 2;
  position: absolute;
  right: 17%;
  bottom: 25px;
  font-size: 24px;
  background: #dce6d7;
  color: #5c795a;
  border: 5px solid #fff1f7;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-leaf {
  position: absolute;
  left: 12%;
  top: 23px;
  color: #969e7c;
  font-size: 32px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 20px 19px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: border-color 0.15s;
}
.stat-card:hover {
  border-color: var(--pink-border);
}
.stat-icon,
.record-icon {
  border-radius: 11px;
  width: 39px;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5eee9;
  color: #a58168;
  flex-shrink: 0;
}
.stat-icon .icon {
  width: 19px;
}
.tone-visits {
  background: var(--pink-soft);
  color: var(--pink);
}
.tone-diagnoses {
  background: #edf2e9;
  color: #7a906b;
}
.tone-treatments {
  background: #edf3ee;
  color: #5e9178;
}
.tone-appointments {
  background: #f9f3e5;
  color: #aa8b4d;
}
.tone-documents {
  background: #eeeefa;
  color: #8a81b3;
}
.tone-doctors,
.tone-clinics {
  background: #ebf2f4;
  color: #638c99;
}
.tone-medications {
  background: #f5eeea;
  color: #aa8066;
}
.stat-number {
  font-size: 29px;
  line-height: 1.3;
  font-weight: 550;
  letter-spacing: -1px;
  margin: 13px 0 5px;
}
.stat-card strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.stat-card small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.panel-heading {
  padding: 22px 23px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.panel-heading h2 {
  margin: 0;
  font-size: 15px;
}
.panel-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 6px;
  letter-spacing: 1.3px;
}
.empty-state {
  padding: 38px 24px 42px;
  text-align: center;
  max-width: 550px;
  margin: auto;
}
.empty-icon {
  display: flex;
  margin: 0 auto 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8eae2;
  border-radius: 50%;
  background: #f8f9f5;
  width: 56px;
  height: 56px;
  color: #9aa28d;
}
.empty-icon .icon {
  width: 24px;
  height: 24px;
}
.empty-state h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 285px;
  margin: 0 auto 16px;
}
.empty-state .btn {
  font-size: 11px;
}
.quick-section {
  margin: 30px 0 24px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}
.section-title h2 {
  font-size: 14px;
  margin: 0;
}
.section-title > span {
  color: var(--muted);
  font-size: 10px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.quick-action {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  padding: 13px;
  font-size: 10px;
  color: var(--ink);
  font-weight: 550;
}
.quick-action > .icon {
  margin-left: auto;
  width: 14px;
  color: #9daba2;
}
.quick-action .record-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.quick-action .record-icon .icon {
  width: 17px;
}
.quick-action:hover {
  border-color: var(--pink-border);
}
.privacy-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid #e5e9dd;
  border-radius: 10px;
  background: #f0f3eb;
}
.privacy-note > .icon {
  color: #7c9272;
  width: 23px;
  height: 23px;
}
.privacy-note strong {
  font-size: 11px;
  font-weight: 600;
}
.privacy-note p {
  color: var(--muted);
  font-size: 10px;
  margin: 4px 0 0;
}
.privacy-note .text-link {
  margin-left: auto;
  font-size: 10px;
  white-space: nowrap;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 22px 42px;
  font-size: 9px;
  color: #8c958c;
  max-width: 1480px;
  margin: auto;
}
.bottom-nav {
  display: none;
}
.skip-link {
  position: fixed;
  left: 10px;
  top: -100px;
  background: #fff;
  z-index: 100;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.loading-state {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.record-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 23px;
  min-height: 82px;
  border-bottom: 1px solid #f0f1ed;
}
.record-row:last-child {
  border-bottom: 0;
}
.record-row:hover {
  background: #fafbf8;
}
.record-body {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}
.record-body strong {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.record-body > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}
.record-end {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-direction: column;
  max-width: 35%;
  text-align: right;
}
.record-end time {
  font-size: 10px;
  color: var(--muted);
}
.record-end > .icon {
  width: 15px;
  height: 15px;
  color: #849084;
}
.status {
  display: inline-block;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 9px;
  line-height: 1.5;
}
.status-green {
  background: #eaf2e9;
  color: #476c49;
}
.status-amber {
  background: #faf2df;
  color: #896b30;
}
.upcoming-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 20px 23px;
  border-bottom: 1px solid var(--border);
}
.upcoming-item:last-child {
  border: 0;
}
.date-tile {
  background: #f8f2eb;
  border: 1px solid #eee3d5;
  border-radius: 8px;
  min-width: 45px;
  text-align: center;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.date-tile small {
  font-size: 9px;
  text-transform: uppercase;
}
.date-tile strong {
  font-size: 21px;
  font-weight: 500;
}
.upcoming-item > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.upcoming-item > div > strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.upcoming-item > div > span {
  font-size: 10px;
  color: var(--muted);
}
.filter-bar {
  padding: 20px;
  display: flex;
  gap: 16px;
}
.search-input {
  position: relative;
  flex: 1;
}
.search-input > .icon {
  position: absolute;
  top: 12px;
  left: 13px;
  color: #8b978d;
  width: 19px;
}
.search-input .form-control {
  padding-left: 41px;
}
.filter-bar > .form-select {
  width: 155px;
}
.form-control,
.form-select {
  min-height: 44px;
  font-size: 13px;
  border-radius: 8px;
  border-color: #dce2dc;
  color: var(--ink);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px #cc287818;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}
.form-text {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.form-error {
  font-size: 12px;
  color: #a23444;
  white-space: pre-wrap;
  margin-top: 18px;
}
.visit-filters {
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.visit-filters label {
  font-size: 10px;
  color: var(--muted);
}
.visit-filters label input {
  margin-top: 5px;
}
.results-label {
  font-size: 10px;
  color: var(--muted);
  padding: 10px 23px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.section-tabs a {
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 12px;
}
.section-tabs .active {
  background: var(--pink-soft);
  color: var(--pink);
  font-weight: 600;
}
.back-link {
  display: inline-block;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
}
.action-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.detail-panel {
  padding: 27px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 0;
}
.detail-field {
  min-width: 0;
}
.detail-field.wide {
  grid-column: 1/-1;
}
.detail-field dt {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 7px;
}
.detail-field dd {
  font-size: 14px;
  white-space: pre-wrap;
  margin: 0;
  overflow-wrap: anywhere;
}
.linked-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  background: #f4f6f1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  margin: 0 8px 8px 0;
}
.linked-chip .icon {
  width: 14px;
}
.document-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin-top: 25px;
  flex-wrap: wrap;
}
.document-controls > span {
  color: var(--muted);
  font-size: 12px;
}
#document-preview img {
  max-width: 100%;
  height: auto;
  margin-top: 25px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
#document-preview iframe {
  width: 100%;
  height: 65vh;
  border: 1px solid var(--border);
  margin-top: 25px;
  border-radius: 8px;
}
.timeline-month {
  margin: 30px 0 20px;
  font-size: 16px;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 20px;
  position: relative;
  margin-bottom: 15px;
}
.timeline-entry > time {
  color: var(--muted);
  font-size: 11px;
  padding-top: 30px;
}
.timeline-entry .panel {
  position: relative;
}
.timeline-entry .panel:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  position: absolute;
  top: 39px;
  left: 8px;
}
.timeline-entry .record-row {
  padding-left: 28px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.settings-panel {
  padding: 27px;
}
.settings-panel > .record-icon {
  margin-bottom: 18px;
}
.settings-panel h2 {
  margin-bottom: 15px;
}
.settings-panel h3 {
  margin-bottom: 12px;
}
.settings-panel p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.settings-panel p strong {
  color: var(--ink);
}
.storage-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-block: 1px solid var(--border);
  padding: 20px 0;
  margin: 22px 0;
}
.storage-summary strong {
  font-size: 16px;
}
.storage-summary span {
  font-size: 11px;
  color: var(--muted);
}
.notice {
  background: #f9f3e7;
  border: 1px solid #eee3cf;
  border-radius: 9px;
  padding: 17px;
  color: #7e6b46;
  font-size: 11px;
  line-height: 1.8;
}
.notice .btn {
  display: block;
  margin-top: 15px;
}
.danger-panel {
  border-color: #ecdada;
}
.large-search {
  margin: 24px;
}
.large-search .form-control {
  min-height: 52px;
}
.large-search > .icon {
  top: 16px;
}
.medly-dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 27px;
  width: 680px;
  max-width: calc(100vw - 30px);
  max-height: calc(100dvh - 40px);
  color: var(--ink);
  box-shadow: 0 20px 100px #25342c26;
  overscroll-behavior: contain;
}
.medly-dialog::backdrop {
  background: #23382e65;
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.dialog-header h2 {
  font-size: 23px;
  margin: 0;
}
.dialog-header .eyebrow {
  margin-bottom: 7px;
}
.dialog-header .icon-button {
  border: 0;
  font-size: 28px;
  margin-top: -8px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 25px;
  position: sticky;
  bottom: -27px;
  background: #fff;
  padding-bottom: 2px;
}
.medly-dialog > p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.notifications {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 36px));
  pointer-events: none;
}
.notification {
  background: #f0f6ef;
  border: 1px solid #b9cebb;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 5px 20px #23382e12;
  color: #34583a;
  font-size: 12px;
  pointer-events: auto;
}
.notification-error {
  background: #fff2f2;
  border-color: #e6bcbc;
  color: #963846;
}
.more-menu {
  display: flex;
  flex-direction: column;
}
.more-menu a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 5px;
  min-height: 50px;
  border-bottom: 1px solid var(--border);
}
.more-menu a > .icon:last-child {
  margin-left: auto;
  width: 16px;
}
.selector-search {
  margin-bottom: 7px;
}
.fatal {
  padding: 20px;
  background: #fff1f1;
  color: #8e3344;
  position: fixed;
  inset: 0;
  z-index: 200;
}
input[type="date"],
input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 1600px) {
  .topbar {
    padding-inline: 60px;
  }
  main {
    padding: 48px 60px 30px;
  }
  .welcome-card {
    min-height: 335px;
  }
  .welcome-copy {
    max-width: 550px;
  }
  .welcome-copy p {
    max-width: 420px;
  }
  .stat-card {
    padding: 24px;
  }
  .welcome-art {
    margin-left: 50px;
  }
  .empty-state {
    padding-block: 45px;
  }
}
@media (max-width: 1199px) {
  .sidebar {
    width: 212px;
    padding-inline: 15px;
  }
  .app-shell {
    margin-left: 212px;
  }
  .topbar {
    padding-inline: 26px;
    gap: 20px;
  }
  main {
    padding: 30px 26px 24px;
  }
  .local-label {
    display: none;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat-card {
    padding: 16px 12px;
  }
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome-card {
    padding: 29px;
  }
  .welcome-copy {
    max-width: 380px;
  }
  .welcome-copy h2 {
    font-size: 29px;
  }
  .welcome-art {
    min-width: 180px;
  }
  .art-orbit {
    width: 205px;
    height: 205px;
  }
  .orbit-two {
    width: 260px;
    height: 260px;
  }
  .welcome-copy p {
    max-width: 330px;
  }
  .panel-heading {
    padding: 21px 18px 0;
  }
  .page-footer {
    padding-inline: 26px;
  }
}
@media (max-width: 900px) {
  .desktop-label {
    display: none;
  }
  .search-trigger {
    margin-left: auto;
  }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .welcome-art {
    display: none;
  }
  .welcome-copy {
    max-width: none;
  }
  .welcome-copy p {
    max-width: 470px;
  }
  .welcome-card {
    min-height: 0;
  }
  .welcome-copy h2 br {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat-card:nth-last-child(-n + 2) {
    grid-column: auto;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .privacy-note {
    flex-wrap: wrap;
  }
  .privacy-note .text-link {
    margin-left: 37px;
  }
  .visit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > .btn {
    font-size: 11px;
    flex-shrink: 0;
  }
  .page-heading .action-group {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page-footer span {
    display: none;
  }
}
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }
  .sidebar {
    display: none;
  }
  .app-shell {
    margin-left: 0;
  }
  .topbar {
    height: 69px;
    padding: 0 20px;
    gap: 14px;
    background: #fff;
  }
  .mobile-brand {
    display: block;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -1px;
    color: var(--pink);
  }
  .search-trigger {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: #f6f7f3;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
  }
  .search-trigger > span:nth-child(2),
  .search-trigger kbd {
    display: none;
  }
  .search-trigger > span:first-child {
    font-size: 28px;
  }
  .local-label {
    display: none;
  }
  main {
    padding: 26px 20px 22px;
    min-height: calc(100dvh - 200px);
  }
  h1 {
    font-size: 29px;
    letter-spacing: -0.9px;
  }
  .page-heading {
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 23px;
  }
  .page-description {
    font-size: 12px;
    line-height: 1.8;
    max-width: 320px;
  }
  .page-heading > .btn {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
    margin-bottom: 9px;
  }
  .welcome-card {
    padding: 26px 23px;
    margin-bottom: 20px;
    border-radius: 13px;
  }
  .welcome-copy h2 {
    font-size: 28px;
    max-width: 300px;
  }
  .welcome-copy h2 br {
    display: block;
  }
  .welcome-copy p {
    font-size: 12px;
    max-width: 340px;
  }
  .welcome-copy .btn {
    font-size: 12px;
  }
  .welcome-footnote {
    font-size: 10px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 22px;
  }
  .stat-card {
    padding: 17px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .stat-number {
    margin: 0;
    font-size: 29px;
    text-align: right;
  }
  .stat-card strong {
    grid-column: 1/-1;
    font-size: 12px;
    margin-top: 14px;
  }
  .stat-card small {
    grid-column: 1/-1;
    font-size: 10px;
  }
  .stat-card:last-child {
    grid-column: 1/-1;
    grid-template-columns: auto 1fr auto;
    column-gap: 14px;
  }
  .stat-card:last-child .stat-icon {
    grid-row: 1/3;
  }
  .stat-card:last-child .stat-number {
    grid-column: 3;
    grid-row: 1/3;
  }
  .stat-card:last-child strong {
    grid-column: 2;
    margin: 0;
  }
  .stat-card:last-child small {
    grid-column: 2;
  }
  .dashboard-columns {
    gap: 20px;
  }
  .panel-heading {
    padding: 21px 19px 0;
  }
  .panel-heading h2 {
    font-size: 16px;
  }
  .panel-heading .text-link {
    font-size: 10px;
    gap: 5px;
  }
  .empty-state {
    padding: 33px 23px;
  }
  .empty-state h3 {
    font-size: 14px;
  }
  .empty-state p {
    font-size: 12px;
  }
  .empty-state .btn {
    font-size: 12px;
  }
  .section-title {
    display: block;
  }
  .section-title h2 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .section-title > span {
    font-size: 11px;
  }
  .quick-grid {
    gap: 10px;
  }
  .quick-action {
    padding: 12px;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
    position: relative;
    min-height: 90px;
    align-content: center;
  }
  .quick-action > span:nth-child(2) {
    flex-basis: 100%;
  }
  .quick-action > .icon {
    position: absolute;
    right: 13px;
    top: 22px;
  }
  .privacy-note {
    padding: 18px;
    gap: 12px;
    align-items: flex-start;
  }
  .privacy-note > div {
    flex: 1;
    min-width: 0;
  }
  .privacy-note strong {
    font-size: 12px;
  }
  .privacy-note p {
    font-size: 11px;
  }
  .privacy-note .text-link {
    margin-left: 34px;
  }
  .page-footer {
    padding: 15px 20px calc(90px + env(safe-area-inset-bottom));
    font-size: 10px;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset: auto 0 0;
    background: #fffffffa;
    border-top: 1px solid var(--border);
    padding: 8px 6px calc(9px + env(safe-area-inset-bottom));
    z-index: 5;
    backdrop-filter: blur(12px);
  }
  .bottom-nav > a,
  .bottom-nav > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 49px;
    color: #7f8b82;
    font-size: 9px;
    border: 0;
    background: none;
  }
  .bottom-nav .active {
    color: var(--pink);
  }
  .bottom-nav .icon {
    width: 21px;
    height: 21px;
  }
  .notifications {
    bottom: calc(91px + env(safe-area-inset-bottom));
    right: 18px;
  }
  .medly-dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 26px);
    padding: 23px 19px;
    border-radius: 13px;
  }
  .dialog-header h2 {
    font-size: 21px;
  }
  .dialog-actions {
    bottom: -23px;
    padding-block: 15px 2px;
  }
  .dialog-actions > .btn {
    flex: 1;
  }
  .filter-bar {
    flex-wrap: wrap;
    padding: 17px;
    gap: 12px;
  }
  .filter-bar .search-input {
    flex-basis: 100%;
  }
  .filter-bar > .form-select {
    width: 100%;
  }
  .visit-filters {
    padding: 0 17px 17px;
    gap: 10px;
  }
  .visit-filters > select {
    grid-column: 1/-1;
  }
  .record-row {
    padding: 17px;
    gap: 11px;
  }
  .record-body strong {
    font-size: 12px;
  }
  .record-body > span {
    font-size: 10px;
    max-width: 190px;
  }
  .record-end {
    max-width: 80px;
  }
  .record-end time {
    font-size: 9px;
  }
  .record-icon {
    width: 35px;
    height: 35px;
    border-radius: 9px;
  }
  .record-icon .icon {
    width: 18px;
  }
  .detail-panel {
    padding: 21px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .detail-field.wide {
    grid-column: auto;
  }
  .detail-field dd {
    font-size: 13px;
  }
  .page-heading .action-group {
    justify-content: flex-start;
  }
  .document-controls {
    gap: 15px;
  }
  .document-controls .action-group {
    flex-wrap: wrap;
  }
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .timeline-entry > time {
    padding: 0 0 0 3px;
    font-size: 10px;
  }
  .timeline-entry .record-row {
    padding-left: 23px;
  }
  .timeline-month {
    margin-top: 25px;
  }
  .settings-panel {
    padding: 23px;
  }
  .storage-summary {
    flex-wrap: wrap;
  }
  .large-search {
    margin: 18px;
  }
  .upcoming-item {
    padding: 20px;
  }
  .action-group {
    flex-shrink: 1;
  }
  .notice {
    font-size: 12px;
  }
  .form-control,
  .form-select {
    font-size: 16px;
  }
  input[type="datetime-local"] {
    width: 100%;
  }
  .section-tabs a {
    font-size: 12px;
    padding-inline: 13px;
  }
}
@media (max-width: 767px) {
  .privacy-note > div {
    flex-basis: calc(100% - 35px);
  }
  .privacy-note .text-link {
    flex-basis: calc(100% - 34px);
  }
}
@media (max-width: 360px) {
  main {
    padding-inline: 14px;
  }
  .topbar {
    padding-inline: 14px;
  }
  .page-heading > .btn {
    width: 100%;
  }
  .welcome-card {
    padding: 23px 19px;
  }
  .welcome-copy h2 {
    font-size: 26px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card strong {
    font-size: 11px;
  }
  .quick-action {
    padding: 11px;
    font-size: 10px;
  }
  .panel-heading {
    padding-inline: 16px;
  }
  .panel-heading .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .panel-heading h2 {
    font-size: 14px;
  }
  .record-end {
    max-width: 65px;
  }
  .record-body > span {
    max-width: 135px;
  }
  .record-row {
    padding-inline: 14px;
  }
  .record-body strong {
    font-size: 11px;
  }
  .record-icon {
    width: 30px;
    height: 30px;
  }
  .record-row {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

.new-medicine-fields {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--pink-border);
  border-radius: 10px;
  background: #fffafd;
}
.new-medicine-fields legend {
  float: none;
  width: auto;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.episode-section {
  padding-bottom: 12px;
}
.episode-origin,
.episode-empty {
  margin: 10px 20px 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.episode-origin a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.followup-tree {
  list-style: none;
  padding: 0;
  margin: 12px 16px 0;
}
.followup-tree > li {
  min-width: 0;
  margin-top: 8px;
}
.followup-card {
  position: relative;
}
.followup-node {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.followup-node.current-visit {
  border-color: var(--pink);
}
.followup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 9px 108px 9px 12px;
}
.followup-title,
.episode-list-title {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
}
.followup-title strong,
.episode-list-title strong {
  font-size: 13px;
  font-weight: 650;
}
.followup-title time,
.followup-title > span,
.episode-list-title > span {
  font-size: 11px;
  color: var(--muted);
}
.followup-content {
  padding: 0 12px 10px;
  overflow-wrap: anywhere;
}
.followup-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-bottom: 6px;
}
.followup-facts:empty {
  display: none;
}
.followup-facts > div {
  min-width: 0;
}
.followup-facts dt {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}
.followup-facts dd {
  margin: 2px 0 0;
  font-size: 12px;
  white-space: pre-wrap;
}
.followup-content h4 {
  font-size: 12px;
  font-weight: 650;
  margin: 10px 0 5px;
}
.episode-course {
  margin: 5px 0;
  padding: 6px 10px;
  background: var(--pink-soft);
  border-radius: 7px;
}
.episode-course p {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0;
}
.episode-course .text-link {
  min-height: 32px;
}
.episode-course .episode-instructions {
  white-space: pre-wrap;
  color: var(--ink);
}
.followup-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 2px;
}
.followup-actions .icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  color: var(--pink);
}
.followup-actions .icon-button:hover {
  background: var(--pink-soft);
}
.followup-actions .icon {
  width: 18px;
  height: 18px;
}
.episode-list-group {
  gap: 12px;
}
.episode-list-group > .icon {
  color: var(--pink);
  width: 16px;
  height: 16px;
}
.episode-list-group .episode-match {
  color: var(--pink);
}
.episode-count {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 11px;
  text-align: center;
}
@media (max-width: 767px) {
  .followup-tree {
    margin-inline: 10px;
  }
  .followup-facts {
    grid-template-columns: 1fr;
  }
  .followup-title strong {
    font-size: 12px;
  }
  .followup-title time,
  .followup-title > span {
    font-size: 10px;
  }
  .episode-section .panel-heading {
    flex-wrap: wrap;
    padding-top: 16px;
  }
  .episode-count {
    font-size: 10px;
    max-width: 65px;
  }
  .episode-origin,
  .episode-empty {
    margin-inline: 18px;
  }
  .episode-list-group {
    gap: 8px;
  }
  .episode-list-group > .record-icon {
    display: none;
  }
}
.care-record-row .record-body > span {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 767px) {
  .new-medicine-fields {
    padding: 12px;
  }
}
