:root {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #163247;
  background: #e6eef1;
  font-synthesis: none;
  --paper: #f2f6f8;
  --surface: #fff;
  --ink: #163247;
  --muted: #536a7b;
  --navy: #17465b;
  --brand: #096f69;
  --brand-strong: #065953;
  --soft: #e2f3ee;
  --line: #dce7ec;
  --blue: #e6eff8;
  --amber: #fff2db;
  --warning: #744600;
  --width: 480px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, dl, dd, ol, ul, fieldset { margin: 0; }
button, input, select, textarea { font: inherit; }
input, textarea, select, button { min-width: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
h1[tabindex]:focus { outline: none; }
:focus { scroll-margin-block: 82px 70px; }
.icon { flex: none; vertical-align: middle; }

.shell {
  --home-paper: #f3f6f5;
  --home-surface: #fff;
  --home-accent: #087a73;
  --home-ink: #243a3a;
  --home-muted: #5a6d70;
  --home-background: url("./assets/background.png");
  --home-search-line: #62b9b5;
  --home-search-icon: #658082;
  --home-search-fill: #0a7d78;
  width: min(100%, var(--width));
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--paper);
  box-shadow: 0 0 45px #173f5612;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: max(10px, env(safe-area-inset-top, 0px)) 16px 10px;
  min-height: 59px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar h1 { font-size: 17px; line-height: 1.4; color: var(--ink); }
.icon-button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -5px -4px -5px -9px; border-radius: 10px; }
.page { display: grid; gap: 12px; min-width: 0; padding: 14px 16px calc(22px + var(--safe-bottom)); }
.page.with-nav { padding-bottom: calc(81px + var(--safe-bottom)); }
.bottom-nav {
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--width));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 10px calc(4px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bottom-nav a { display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 51px; border-radius: 12px; color: var(--muted); font-size: 11px; }
.bottom-nav a[aria-current] { color: var(--brand-strong); background-color: var(--soft); font-weight: 700; }

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 96px;
  padding: 15px;
  border-radius: 16px;
  background: var(--navy);
  color: white;
}
.summary > div { min-width: 0; }
.summary p { margin-top: 5px; color: #d9e9ef; font-size: 12px; line-height: 1.5; }
.summary { min-height: 82px; }
.summary h2 { font-size: 17px; }
.summary > strong { font-size: 24px; overflow-wrap: anywhere; }

.panel { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 27px; margin-bottom: 5px; }
.section-heading h2 { min-width: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.panel h3 { font-size: 14px; line-height: 1.45; }
.status { display: inline-flex; align-items: center; flex: none; border-radius: 6px; padding: 4px 7px; white-space: nowrap; color: #42596a; background: var(--paper); font-size: 11px; font-weight: 660; }
.status-teal, .tile-teal { color: var(--brand-strong); background: var(--soft); }
.status-blue, .tile-blue { color: #22577e; background: var(--blue); }
.tile-green { color: #247646; background: #e8f5e8; }
.status-amber, .tile-amber { color: var(--warning); background: var(--amber); }
.tile { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 10px; }
.archive-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding-inline: 8px; }
.archive-actions a {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  padding: 6px 2px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.archive-actions a:active { background: var(--paper); }
.item { display: flex; gap: 10px; align-items: center; min-height: 56px; padding: 8px 0; }
.item + .item { border-top: 1px solid var(--line); }
.item > .icon { color: var(--muted); }
.item-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-copy strong { display: block; font-size: 14px; line-height: 1.4; }
.item-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.more { display: inline-flex; align-items: center; flex: none; gap: 3px; color: var(--brand-strong); font-size: 12px; font-weight: 650; min-height: 38px; }
.section-heading .more { margin-block: -5px; }
.empty { display: grid; gap: 5px; justify-items: start; padding: 11px 0 4px; }
.empty strong { font-size: 14px; }
.empty p, .muted, .form-intro { color: var(--muted); font-size: 13px; line-height: 1.55; }
.muted:empty { display: none; }
.shell-home {
  --home-gutter: 0.875rem;
  background:
    linear-gradient(180deg, transparent 45px, var(--home-paper) 228px),
    var(--home-background) center top / 100% auto no-repeat var(--home-paper);
}
.topbar-home {
  position: relative;
  min-height: 54px;
  padding: max(7px, env(safe-area-inset-top, 0px)) var(--home-gutter) 5px;
  border: 0;
  background: transparent;
}
.topbar-home .home-title { color: var(--home-ink); font-size: 0.9375rem; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 7px; min-height: 44px; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  border: 1.5px solid #30928a;
  border-radius: 50%;
  color: #077a73;
}
.home-contact { margin: 0 -8px 0 0; color: #28726e; }
.page-home { gap: 11px; padding: 0 var(--home-gutter); color: var(--home-ink); }
.page-home.with-nav { padding-bottom: calc(70px + var(--safe-bottom)); }
.bottom-nav-home {
  padding-block: 1px calc(2px + var(--safe-bottom));
  border-color: #dfe8e6;
  background: #fffffff0;
  backdrop-filter: blur(16px) saturate(140%);
}
.bottom-nav-home a { gap: 3px; min-height: 52px; color: var(--home-muted, var(--muted)); }
.bottom-nav-home a[aria-current] { color: #006e68; background: transparent; }
.bottom-nav-home a[aria-current] .icon { stroke-width: 2; }
.shell-profile {
  --profile-paper: #f4f7f6;
  --profile-ink: #343e42;
  --profile-muted: #58676b;
  --profile-gutter: clamp(13px, 4.35vw, 20px);
  color: var(--profile-ink);
  background:
    linear-gradient(180deg, transparent 28px, var(--profile-paper) 210px),
    var(--home-background) center top / 100% auto no-repeat var(--profile-paper);
}
.page.page-profile, .page.profile-detail {
  padding-inline: var(--profile-gutter);
}
.page-profile {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}
.profile-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-sign-in {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--home-accent);
  font-size: 13px;
  font-weight: 600;
}
.profile-settings {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.profile-toolbar .profile-settings {
  margin-inline: auto -8px;
}
.profile-person {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-block: 20px 5px;
}
.profile-avatar {
  display: block;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.profile-person-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
}
.profile-name h1 {
  min-width: 0;
  font-size: 21px;
  line-height: 1.3;
}
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 5px;
  padding: 1px 4px;
  background: #fff0cb;
  color: #80590f;
  font-size: 11px;
  line-height: 1.4;
}
.profile-badge-bound {
  background: var(--soft);
  color: var(--brand-strong);
}
.profile-person p {
  margin-top: 5px;
  color: var(--profile-muted);
  font-size: 14px;
  line-height: 1.5;
}
.profile-card {
  min-width: 0;
  padding: 12px 13px 15px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 9px 24px #163e3510;
}
.profile-card h2 {
  font-size: 17px;
  line-height: 1.4;
}
.profile-wallet-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 1px;
  border-bottom: 1px solid #e7ecea;
}
.profile-wallet-sample {
  color: var(--profile-muted);
  font-size: 11px;
}
.profile-wallet-heading a {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  margin-inline-start: auto;
  color: var(--profile-muted);
  font-size: 13px;
}
.profile-balance {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  text-align: center;
}
.profile-balance > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}
.profile-balance dt {
  color: var(--profile-muted);
  font-size: clamp(11px, 3.2vw, 13px);
}
.profile-balance dd {
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.2;
}
.profile-features {
  padding-top: 16px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 12px;
  margin-top: 10px;
  padding: 0;
  list-style: none;
}
.profile-grid a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 61px;
  border-radius: 8px;
  color: var(--profile-ink);
  text-align: center;
  font-size: clamp(11px, 3.5vw, 14px);
  line-height: 1.4;
}
.profile-feature-icon {
  width: 28px;
  height: 28px;
  background: url("./assets/profile-tools.png") 0 calc(-28px * var(--profile-icon-index)) / 28px auto no-repeat;
}
.profile-detail-heading {
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-detail-heading .profile-settings { margin-inline-start: -8px; }
.profile-detail-heading h1 { font-size: 18px; }
.profile-detail .profile-balance { margin-bottom: 12px; }
.home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 2px 2px 2px 10px;
  border: 1px solid var(--home-search-line);
  border-radius: 999px;
  color: var(--home-search-icon);
  background: var(--home-surface);
}
.home-search input { flex: 1; min-height: 36px; padding: 2px 0; border: 0; color: var(--home-ink); background: transparent; font-size: 1rem; }
.home-search input::placeholder { opacity: 1; color: var(--home-muted); font-size: 0.8125rem; }
.home-search button { flex: none; min-height: 36px; padding: 4px 15px; border: 0; border-radius: 999px; background: var(--home-search-fill); color: white; font-size: 0.8125rem; font-weight: 650; }
.page.page-services {
  --service-accent: #008488;
  --service-line: #0ab0b5;
  --service-fill: #00abb0;
  --service-tint: #edf9f9;
  --service-muted: #647075;
  min-height: 100vh;
  min-height: 100dvh;
  align-content: start;
  gap: 12px;
  padding: 0 0 calc(81px + var(--safe-bottom));
  color: #353b3d;
  background: #f2f4f3;
}
.services-title, .services-result { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.page-services > .panel:has(> .service-shortcuts) { margin-block-start: 8px; }
.service-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.service-shortcuts a {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.375rem;
  min-block-size: 4.25rem;
  padding: 0.5rem 0.25rem;
  border-radius: 0.625rem;
  color: var(--home-ink);
  background: var(--service-tint);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
.service-shortcuts .icon { color: var(--brand-strong); }
.service-shortcuts a:active { background: var(--soft); box-shadow: inset 0 0 0 1px var(--service-accent); }
.services-tools {
  min-width: 0;
  margin-bottom: 4px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background: #fff;
}
.services-search-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; padding-inline-end: 11px; }
.services-back { display: grid; place-items: center start; min-height: 44px; padding-inline-start: 10px; color: #535e62; }
.services-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 2px 2px 2px 10px;
  border: 1px solid var(--service-line);
  border-radius: 999px;
  color: #969fa4;
  background: #fff;
}
.services-search:focus-within { border-color: var(--service-accent); box-shadow: 0 0 0 2px var(--service-tint); }
.services-search input[type="search"] { flex: 1; width: 0; min-height: 30px; padding: 0; border: 0; outline: 0; color: #353b3d; background: transparent; font-size: 1rem; }
.services-search input::placeholder { color: var(--service-muted); opacity: 1; font-size: 0.875rem; }
.services-search button {
  flex: none;
  min-width: 54px;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--service-fill);
  font-size: 0.8125rem;
  font-weight: 600;
}
.services-search button:active { background: var(--service-accent); }
.services-filters { display: flex; justify-content: space-between; }
.services-filters a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 38px;
  padding: 5px;
  color: #51595b;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}
.services-filters a[aria-current] { color: var(--service-accent); font-weight: 700; }
.services-filters a[aria-current]::after { content: ""; position: absolute; bottom: 0; width: 24px; height: 2px; border-radius: 2px; background: var(--service-fill); }
.services-card, .page-services > .panel { min-width: 0; margin-inline: 10px; }
.services-card { padding: 0 12px; border-radius: 9px; background: #fff; }
.page-services .more { color: var(--service-accent); }
.services-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.services-card-heading h2 { font-size: 1rem; }
.services-card-heading a { display: flex; align-items: center; gap: 2px; min-height: 44px; color: var(--service-muted); font-size: 0.75rem; }
.service-record { --record-avatar: 48px; --record-gap: 11px; min-height: 141px; padding-block: 12px; }
.service-record:last-child { min-height: 134px; }
.service-record-doctor, .service-record-doctor:last-child { --record-gap: 20px; min-height: 188px; padding-block: 12px 18px; }
.service-record-link { display: grid; grid-template-columns: var(--record-avatar) minmax(0, 1fr); align-items: start; gap: var(--record-gap); border-radius: 5px; }
.service-avatar { display: block; width: var(--record-avatar); height: auto; object-fit: contain; mix-blend-mode: multiply; }
.service-record-doctor .service-avatar { margin-inline-start: 10px; }
.service-record-info { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.service-record:not(.service-record-doctor) .service-record-info { padding-top: 4px; }
.service-record-info h3 { font-size: 0.9375rem; line-height: 20px; }
.service-record-info h3 span { margin-inline-start: 3px; }
.service-hospital-focus { font-size: 0.75rem; line-height: 17px; font-weight: 600; }
.service-record-meta { display: flex; gap: 3px; align-items: flex-start; color: var(--service-muted); font-size: 0.6875rem; line-height: 16px; }
.service-record-meta .icon { margin-top: 2px; }
.service-address span:last-child { margin-inline-start: auto; white-space: nowrap; }
.service-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.service-badge { padding: 0 3px; border: 1px solid transparent; border-radius: 1px; font-size: 0.625rem; line-height: 12px; }
.service-badge-0 { color: #fff; background: var(--service-fill); }
.service-badge-1 { color: #79531e; background: #f8ead0; }
.service-badge-2 { color: #246c9e; border-color: #83b0d1; background: #fff; }
.service-doctor-stats { display: flex; flex-wrap: wrap; gap: 1px 7px; color: #60686a; font-size: 0.625rem; line-height: 16px; }
.service-doctor-stats span { white-space: nowrap; }
.service-doctor-stats b { color: #aa5a17; font-weight: 600; }
.service-doctor-hospital { margin-top: 3px; color: #576266; font-size: 0.8125rem; line-height: 19px; }
.service-doctor-focus { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--service-muted); font-size: 0.8125rem; line-height: 22px; }
.service-doctor-focus mark { color: var(--service-accent); background: transparent; font-weight: 700; }
.service-record-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-inline-start: calc(var(--record-avatar) + var(--record-gap)); margin-top: 15px; }
.services-entry {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 6px;
  border: 1px solid var(--service-line);
  border-radius: 4px;
  color: var(--service-accent);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.services-tools a, .services-search button, .services-card a { touch-action: manipulation; }
.services-tools a:active, .services-card a:active { background: var(--service-tint); }
.home-results h2:focus, .home-tasks h2:focus { outline: 0; }
.home-tasks h2 { scroll-margin-top: 18px; }
.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.service-glyph-user, .service-glyph-hospital, .service-glyph-phone {
  --glyph-ink: #04b6bd;
  --glyph-accent: #2789ec;
  --glyph-detail: #72e6dc;
}
.service-glyph-camera, .service-glyph-clipboard, .service-glyph-medical {
  --glyph-ink: #35a6f5;
  --glyph-accent: #3379ed;
  --glyph-detail: #a2ddff;
}
.service-glyph-heart, .service-glyph-report, .service-glyph-chat {
  --glyph-ink: #6679f3;
  --glyph-accent: #4d63e2;
  --glyph-detail: #b4c1ff;
}
.service-glyph-pin, .service-glyph-check {
  --glyph-ink: #0dc480;
  --glyph-accent: #0aa88f;
  --glyph-detail: #7de8b3;
}
.service-glyph-calendar, .service-glyph-box {
  --glyph-ink: #f6a038;
  --glyph-accent: #ee7e27;
  --glyph-detail: #ffda95;
}
.service-glyph { color: var(--glyph-ink); }
.service-glyph .glyph-accent { fill: var(--glyph-accent); }
.service-glyph .glyph-detail { fill: var(--glyph-detail); }
.service-glyph .glyph-light { fill: #fff; }
.home-feature {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 112px;
  padding: 10px 4px;
  text-align: center;
  border-radius: 9px;
  background: var(--home-surface);
}
.home-feature .service-glyph {
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--glyph-ink) 18%, transparent));
}
.home-feature strong { font-size: 0.9375rem; line-height: 1.35; font-weight: 700; }
.home-feature small { color: var(--home-muted); font-size: 0.6875rem; line-height: 1.4; text-wrap: balance; }
.home-banner {
  display: flex;
  align-items: center;
  min-height: 85px;
  aspect-ratio: 3.75;
  padding: 10px clamp(12px, 4vw, 19px);
  border-radius: 9px;
  color: white;
  background: #2264af url("./assets/health-record-banner.jpg") center 42% / cover no-repeat;
}
.home-banner-copy { max-width: 56%; }
.home-banner h2 { font-size: clamp(1.125rem, 5.4vw, 1.5rem); line-height: 1.2; font-weight: 750; letter-spacing: -0.025em; }
.home-banner p { margin-top: 3px; font-size: 0.6875rem; line-height: 1.35; }
.home-banner-link { display: inline-flex; align-items: center; gap: 1px; margin-top: 6px; padding: 2px 6px 2px 8px; border-radius: 999px; color: #205b9b; background: #fff; font-size: 0.6875rem; font-weight: 650; line-height: 1.5; }
.home-progress, .home-quick, .page-home .panel { border: 0; border-radius: 9px; background: var(--home-surface); }
.home-progress { padding: 5px 4px; }
.progress-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; padding: 0; list-style: none; }
.progress-grid a { display: grid; gap: 2px; justify-items: center; align-content: start; min-height: 65px; padding: 7px 0 4px; text-align: center; border-radius: 6px; }
.progress-grid .service-glyph { opacity: 0.72; }
.progress-grid strong { font-size: 0.75rem; font-weight: 600; }
.progress-grid small { color: var(--home-muted); font-size: 0.625rem; }
.progress-grid [data-complete="true"] .service-glyph,
.progress-grid [aria-current="step"] .service-glyph { opacity: 1; }
.progress-grid [aria-current="step"] strong { color: var(--home-accent); }
.home-quick { padding: 9px 5px; }
.quick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.quick-grid a { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 7px 0; min-height: 56px; border-radius: 6px; font-size: clamp(0.625rem, 3.1vw, 0.75rem); font-weight: 500; line-height: 1.3; text-align: center; text-wrap: balance; }
.quick-grid .service-glyph { width: clamp(30px, 8.5vw, 38px); height: auto; }
.tasks-jump { display: flex; align-items: center; gap: 5px; min-height: 44px; margin: 2px auto 0; padding: 0 9px; border: 0; border-radius: 6px; color: var(--home-accent); background: transparent; font-size: 0.75rem; font-weight: 650; }
.page-home .panel { padding: 9px 12px; }
.page-home .section-heading h2 { font-size: 0.9375rem; font-weight: 700; }
.home-tasks .section-heading, .home-guide .section-heading { margin-bottom: 1px; }
.home-tasks .item { min-height: 56px; border-color: #e9efed; }
.home-tasks .tile { width: 34px; height: 34px; border-radius: 50%; }
.home-tasks .item-copy strong, .home-guide .item-copy strong { font-size: 0.8125rem; font-weight: 650; }
.home-tasks .item-copy small, .home-guide .item-copy small { color: var(--home-muted); font-size: 0.75rem; }
.home-guide-detail { border-top: 1px solid #e9efed; }
.home-guide-summary { display: flex; align-items: center; gap: 10px; padding-block: 7px 2px; cursor: pointer; list-style: none; }
.home-guide-summary::-webkit-details-marker { display: none; }
.home-guide-summary .icon { margin-inline-start: 2px; }
.home-guide-detail[open] .icon { transform: rotate(90deg); }
.home-guide-summary img { flex: none; max-width: 30%; height: auto; aspect-ratio: 92 / 58; border-radius: 6px; object-fit: cover; }
.home-guide-detail p { padding-block: 7px 3px; color: var(--home-muted); font-size: 0.8125rem; line-height: 1.6; }
.home-feature:active, .home-banner:active { filter: brightness(0.96); }
.home-contact:active, .quick-grid a:active, .progress-grid a:active, .tasks-jump:active,
.bottom-nav-home a:active { background: #eaf4f1; }
.home-search button:active { background: #066864; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 5px; flex: none; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 4px 12px; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: center; }
.primary { color: white; background: var(--brand); border-color: var(--brand); }
.secondary { color: var(--brand-strong); background: #f2f9f7; border-color: #bddbd6; }
.form { display: grid; gap: 12px; }
.form > .button, .page > .button { width: 100%; }
.form .more { justify-self: start; }
.field { display: grid; gap: 5px; min-width: 0; font-size: 14px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; box-sizing: border-box; min-height: 44px; padding: 9px; border: 1px solid #cbdde4; border-radius: 9px; color: var(--ink); background: #f8fbfc; font-size: 16px; font-weight: 400; line-height: 1.4; }
.field textarea { resize: vertical; }
.field ::placeholder { opacity: 1; color: var(--muted); }
.button-row { display: flex; gap: 8px; }
.button-row .button { flex: 1 1 0; }

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(clamp(36px, 11.2vw, 52px) + env(safe-area-inset-top, 0px))
    clamp(24px, 8vw, 44px) calc(28px + var(--safe-bottom));
  background: var(--surface);
}
.login-back {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top, 0px));
  left: 12px;
  margin: 0;
  color: var(--muted);
}
.login-back:active, .login-code-action:active, .login-example:active { background: var(--soft); }
.login-brand { text-align: center; }
.login-brand img {
  display: block;
  width: clamp(66px, 17.6vw, 84px);
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  padding: 7px;
  border-radius: 21px;
  background: var(--soft);
  object-fit: contain;
}
.login-brand p {
  margin-top: 18px;
  font-size: clamp(19px, 5vw, 24px);
  font-weight: 750;
  line-height: 1.35;
  text-wrap: balance;
}
.login-form {
  display: grid;
  gap: 20px;
  width: min(100%, 352px);
  margin: clamp(24px, 7.8vw, 38px) auto 0;
}
.login-form h1 { margin-bottom: 3px; font-size: 17px; font-weight: 650; line-height: 1.5; }
.login-form .field { gap: 7px; color: var(--muted); font-weight: 500; }
.login-form .field input, .login-code-row {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.login-form .field input { padding: 0 15px; }
.login-code-row { display: flex; }
.login-code-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px var(--soft); }
.login-form .login-code-row input { flex: 1 1 0; width: auto; min-height: 50px; border: 0; outline: none; }
.login-code-action, .login-example {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding-inline: 12px;
  background: transparent;
}
.login-code-action { flex: none; margin: 3px; color: var(--brand-strong); font-size: 14px; font-weight: 600; }
.login-code-action:focus-visible { outline-offset: 0; }
.login-form .login-code-status { color: var(--brand-strong); }
.login-form .login-submit {
  min-height: 52px;
  border-radius: 12px;
  box-shadow: 0 3px 8px #06595322;
  font-size: 16px;
}
.login-submit:active { background: var(--brand-strong); }
.login-note { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.login-example {
  justify-self: center;
  margin-top: 8px;
  color: var(--brand-strong);
  font-size: 13px;
}

fieldset { border: 0; padding: 0; min-width: 0; }
legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 650; }
.choice-grid, .upload-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid label { display: flex; align-items: center; gap: 5px; min-height: 45px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 13px; cursor: pointer; }
.choice-grid input { accent-color: var(--brand); }
.file-picker { position: relative; display: grid; gap: 7px; justify-items: center; align-content: center; min-height: 78px; border: 1px dashed #96c9bd; border-radius: 10px; color: var(--brand-strong); background: #f5fbfa; font-size: 13px; overflow: hidden; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.file-selection, .plain-list, .timeline, .message-list { padding: 0; list-style: none; }
.file-selection:empty { display: none; }
.file-selection li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 5px; border-bottom: 1px solid var(--line); font-size: 13px; }
.file-selection span, .attachment span { min-width: 0; overflow-wrap: anywhere; }
.file-selection button { flex: none; min-height: 35px; border: 0; border-radius: 7px; color: var(--brand-strong); background: var(--soft); font-size: 12px; }
.originals { display: grid; gap: 6px; }
.attachment { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 7px; border-radius: 8px; background: var(--paper); color: var(--brand-strong); font-size: 13px; }
.attachment span { flex: 1; }
.details > div { display: grid; grid-template-columns: minmax(75px, 28%) minmax(0, 1fr); gap: 7px; padding: 8px 0; font-size: 13px; line-height: 1.55; }
.details > div + div { border-top: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.details .more { min-height: 25px; }
.manager, .plan-topics article { display: flex; align-items: center; gap: 9px; }
.manager > div { flex: 1; min-width: 0; }
.manager strong { font-size: 14px; }
.manager p, .plan-topics p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 3px; }
.plan-topics article { padding: 7px 0; }
.plan-topics article + article { border-top: 1px solid var(--line); }
.plain-list li { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 13px; }
.plain-list .icon { color: var(--brand); }
.timeline li { position: relative; display: grid; grid-template-columns: 15px 1fr; gap: 8px; min-height: 51px; padding: 6px 0; font-size: 14px; }
.timeline li > span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); translate: 2px 6px; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; top: 22px; bottom: -7px; left: 6px; width: 1px; background: var(--line); }
.timeline small, .message-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.response-actions { margin-top: 8px; }
.message-list li { padding: 7px 0; font-size: 14px; overflow-wrap: anywhere; }
.message-list li + li { border-top: 1px solid var(--line); }
.staff-actions { display: grid; gap: 7px; margin-top: 9px; }
.staff-actions .button { justify-content: start; text-align: left; }
.toast { position: fixed; bottom: calc(70px + var(--safe-bottom)); left: 50%; z-index: 4; width: max-content; max-width: calc(100% - 28px); transform: translateX(-50%); border-radius: 9px; padding: 8px 12px; color: #fff; background: #17384b; font-size: 13px; line-height: 1.4; opacity: 0; pointer-events: none; }
.toast.visible { opacity: 1; }

.qa-welcome, .qa-chat {
  --qa-blue: #0869df;
  --qa-paper: #f4f6fb;
  --qa-ink: #162638;
  --qa-muted: #566678;
  min-width: 0;
  color: var(--qa-ink);
}
.qa-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) 10px 4px;
}
.qa-header h1 { font-size: 17px; line-height: 1.35; text-align: center; }
.qa-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--qa-muted);
}
.qa-icon-button:active { background: #e7eef5; }
.qa-icon-button:disabled { color: #a0a9b5; cursor: default; }

.qa-welcome {
  display: grid;
  grid-template-rows: auto auto minmax(195px, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: clamp(12px, 2.4vh, 22px);
  height: 100vh;
  height: 100dvh;
  min-height: calc(520px + var(--safe-bottom));
  padding-bottom: calc(clamp(80px, 17dvh, 132px) + var(--safe-bottom));
  background: radial-gradient(ellipse at 85% 4%, #c6edfb 0, transparent 60%),
    linear-gradient(160deg, #e8f7fe, #eef1fe 69%);
}
.qa-welcome .qa-header { width: 100%; }
.qa-welcome h1 { font-size: clamp(20px, 5.3vw, 25px); font-weight: 750; }
.qa-intro {
  position: relative;
  width: calc(100% - 50px);
  margin-top: clamp(8px, 3.8vh, 38px);
  padding: 14px 18px;
  border-radius: 30px;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}
.qa-intro::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 24%;
  width: 11px;
  height: 11px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: #fff;
}
.qa-hero {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: min(100% - 18px, 410px);
  min-height: 0;
}
.qa-hero img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 390px;
  object-fit: contain;
  mask-image: linear-gradient(#000 86%, transparent);
}
.qa-start {
  display: grid;
  place-items: center;
  width: calc(100% - 58px);
  min-height: 48px;
  padding: 7px 14px;
  border-radius: 11px;
  color: white;
  background: var(--qa-blue);
  box-shadow: 0 3px 8px #0c6bea24;
  font-size: 17px;
  font-weight: 650;
}
.qa-start:active { background: #085dbf; }
.qa-welcome + .bottom-nav { border-radius: 22px 22px 0 0; }

.qa-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: var(--qa-paper);
}
.qa-log {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 19px 12px 16px;
}
.qa-log:focus-visible { outline-offset: -3px; }
.qa-time {
  display: block;
  margin-bottom: 23px;
  color: var(--qa-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.qa-turn { display: grid; gap: 14px; margin-top: 16px; }
.qa-message { min-width: 0; }
.qa-message-assistant {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 29px;
  align-items: start;
  gap: 7px;
}
.qa-message-user { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; }
.qa-avatar { display: block; flex: none; width: 30px; height: 30px; object-fit: contain; }
.qa-bubble {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #eaedf5;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.qa-message-user .qa-bubble {
  max-width: 78%;
  padding: 8px 13px;
  border-color: transparent;
  background: #076fd4;
  color: white;
}
.qa-message-assistant .answer { white-space: pre-wrap; }
.qa-message-assistant .primary { margin-top: 8px; }
.qa-suggestion-label { margin-top: 15px; }
.qa-suggestions { margin-top: 3px; padding: 0; list-style: none; }
.qa-suggestions button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 0;
  border: 0;
  border-radius: 3px;
  color: #17648a;
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.qa-suggestions button::before {
  content: "";
  flex: 0 0 5px;
  height: 5px;
  border-radius: 50%;
  background: #3bb9ae;
}
.qa-suggestions button:hover { text-decoration: underline; }
.qa-copy { align-self: end; width: 29px; height: 36px; color: #267c8e; }

.qa-composer {
  display: grid;
  gap: 6px;
  padding: 8px 14px calc(13px + var(--safe-bottom));
  background: #fff;
}
.qa-note { color: var(--qa-muted); font-size: 11px; line-height: 1.4; }
.qa-input {
  display: flex;
  gap: 2px;
  min-width: 0;
  min-height: 46px;
  padding: 1px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(var(--qa-paper), var(--qa-paper)) padding-box,
    linear-gradient(110deg, #66d8ba, #6494b7) border-box;
}
.qa-input:focus-within { outline: 2px solid #0c7f7c; outline-offset: 1px; }
.qa-input input {
  flex: 1 1 auto;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  outline: none;
  color: var(--qa-ink);
  background: transparent;
  font-size: 16px;
}
.qa-input input::placeholder { color: #728194; }
.qa-input button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--qa-blue);
  font-size: 14px;
}
.qa-input button:disabled { color: #fff; background: #959fac; cursor: default; }

.archive-consult {
  --qa-blue: var(--brand);
  --qa-paper: var(--paper);
  --qa-ink: var(--ink);
  --qa-muted: var(--muted);
}
.archive-consult .section-heading { margin-bottom: 8px; }
.archive-consult-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper);
}
.archive-consult-modes button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.archive-consult-modes button[aria-pressed="true"] {
  border-color: #b9ddd2;
  background: var(--soft);
  color: var(--brand-strong);
}
.archive-consult [data-archive-consult-panel] { margin-top: 10px; }
.archive-consult .qa-log { max-height: 220px; padding: 9px; border-radius: 10px; background: var(--paper); }
.archive-consult-intro { color: var(--muted); font-size: 13px; line-height: 1.5; }
.archive-consult .qa-turn { gap: 8px; margin-top: 10px; }
.archive-consult .qa-bubble { padding: 8px 10px; font-size: 13px; }
.archive-consult .qa-message-user .qa-bubble { background: var(--brand); }
.archive-consult .qa-composer { padding: 8px 0 0; }
.archive-consult .qa-input button { min-height: 44px; }
.archive-help-turn .muted { text-align: right; font-size: 11px; }
.archive-consult [data-archive-consult-panel="doctor"] .more { min-height: 44px; }

@media (max-width: 359px) {
  .page, .topbar { padding-inline: 11px; }
  .summary { padding-inline: 11px; }
  .shell-home { --home-gutter: 0.6875rem; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .bottom-nav-home { background: #fff; backdrop-filter: none; }
}
@media (hover: hover) {
  .button.primary:hover { background: var(--brand-strong); }
  .item:hover, .more:hover { color: var(--brand-strong); }
  .archive-actions a:hover { background: var(--paper); }
  .profile-grid a:hover, .profile-settings:hover { background-color: #e7f7ef; }
  .home-feature:hover { color: var(--home-accent); }
  .quick-grid a:hover, .progress-grid a:hover, .tasks-jump:hover { background: #f2f8f6; }
  .home-search button:hover { background: #06716c; }
  .services-search button:hover { background: var(--service-accent); }
  .service-shortcuts a:hover { background: var(--soft); }
}
