/* GP view: read-only patient profile, as grouped white sections on the grey ground. Builds on styles.css tokens. */
.gp-app { min-height: 100vh; }
.topbar .switch { margin-left: auto; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.who:empty { display: none; }
.gp-banner { font-size: .85rem; text-align: center; padding: 6px 16px; background: var(--surface); color: var(--muted); border-bottom: .5px solid var(--line); }
.urgent-mini { display: inline-block; }
.urgent-mini summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--danger); font-weight: 600; font-size: 1rem; cursor: pointer; list-style: none; }
.urgent-mini summary::-webkit-details-marker { display: none; }
.urgent-mini[open] { display: block; }
.urgent-mini > span { display: block; color: var(--ink); padding: 0 0 8px; }
.gp-main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 48px; }
.gp-main:focus { outline: none; }

/* Sign-in */
.signin { max-width: 440px; margin: 56px auto; background: var(--surface); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-sm); }
.signin h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.signin p { color: var(--muted); margin-top: 6px; font-size: .95rem; }
.signin .who-card { display: flex; gap: 12px; align-items: center; margin: 20px 0; padding: 14px; border-radius: var(--radius); background: var(--page); }

/* Profile: header, section index, then grouped sections */
.doc { display: grid; gap: 14px; }
.doc-head { background: var(--surface); border-radius: 16px; padding: 22px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.doc-head > div:first-child { flex: 1; min-width: 260px; }
.doc-head h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .95rem; color: var(--muted); margin-top: 6px; }
.pt-meta b { color: var(--ink); font-weight: 600; }
.allergy { display: inline-flex; align-items: center; gap: 5px; background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: .85rem; padding: 4px 11px; border-radius: 99px; }
.doc-toc { display: flex; gap: 2px; flex-wrap: wrap; background: var(--fill); border-radius: 10px; padding: 3px; position: sticky; top: 64px; z-index: 5; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.doc-toc a { font-size: .9rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 7px 12px; border-radius: 8px; }
.doc-sec { background: var(--surface); border-radius: 16px; padding: 22px 24px; scroll-margin-top: 120px; }
.doc-sec > h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.doc-sec > .src { font-size: .88rem; color: var(--muted); margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: .5px solid var(--line); }
.cols3 > * { padding: 14px 16px 4px 0; }
.cols3 > * + * { padding-left: 16px; border-left: .5px solid var(--line); }
.cols3 h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.cols3 ul { margin: 0; padding-left: 18px; font-size: .95rem; }
.cols3 li + li { margin-top: 4px; }
/* Cards inside a section are columns, not boxes */
.doc-sec .card { background: none; padding: 0; border-radius: 0; }
.doc-sec .card + .card { margin-top: 0; }
.doc-sec .card.phys h3 { color: var(--phys); } .doc-sec .card.psych h3 { color: var(--psych); } .doc-sec .card.soc h3 { color: var(--soc); }
.doc-sec .kv .card { background: var(--page); padding: 14px; border-radius: var(--radius); }

.issue { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: start; padding: 12px 0; }
.issue + .issue { border-top: .5px solid var(--line); }
.sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.sev.red { background: var(--danger); } .sev.amber { background: var(--warn); } .sev.grey { background: var(--faint); }
.issue .t { font-weight: 600; }
.issue .d { font-size: .92rem; color: var(--muted); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .88rem; color: var(--muted); font-weight: 600; padding: 8px 10px 8px 0; border-bottom: .5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 10px 10px 0; border-bottom: .5px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .hi { color: var(--warn); font-weight: 600; }
.status { font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; display: inline-block; white-space: nowrap; }
.status.on { background: var(--ok-bg); color: var(--ok); }
.status.off { background: var(--fill); color: var(--muted); }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.red { background: var(--warn-bg); color: var(--warn); }

.sum { background: var(--brand-soft); border-radius: var(--radius); padding: 16px 18px; }
.sum .lbl { font-size: .9rem; font-weight: 600; color: var(--brand); }
.block-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; }
.block-h h3 { font-size: 1.05rem; font-weight: 600; }
.gp-chart text { font-size: 11px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 8px; }
.strip b { height: 26px; border-radius: 6px; background: var(--brand); }
.strip b.miss { background: var(--warn-bg); box-shadow: inset 0 0 0 1.5px var(--warn); }
.strip b.none { background: var(--fill); }
.locked { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .95rem; padding: 10px 0; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 18px; }
.tl::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--brand); }
.tl.up::before { box-shadow: inset 0 0 0 3px var(--warn); }
.tl .h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.tl .h b { color: var(--ink); }
.tl p { margin-top: 4px; font-size: .95rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .95rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.doc-foot { padding: 4px 8px; font-size: .85rem; color: var(--muted); }

/* Health data: one row per summary, download instead of full charts */
.dl-list { border-top: .5px solid var(--line); }
.dl-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.dl-row + .dl-row { border-top: .5px solid var(--line); }
.dl-row.off { grid-template-columns: 32px 1fr; color: var(--muted); }
.dl-txt { display: grid; gap: 2px; min-width: 0; }
.dl-txt b { font-weight: 600; }
.dl-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 1.1rem; background: var(--fill); color: var(--muted); }
.dl-ic.phys { background: var(--phys); color: #fff; }
.dl-ic.psych { background: var(--psych); color: #fff; }
.dl-row .btn { white-space: nowrap; }

/* Interaction */
.doc-toc a, .switch-link { transition: background-color .18s, color .18s, transform .12s; }
.doc-toc a:active { transform: scale(.95); }
@media (hover: hover) { .doc-toc a:hover { background: var(--surface); } }

@media (max-width: 800px) {
  .gp-main { padding: 12px; }
  .cols, .cols3 { grid-template-columns: 1fr; }
  .cols3 > * + * { padding-left: 0; border-left: 0; border-top: .5px solid var(--line); }
  .doc-head, .doc-sec { padding-left: 16px; padding-right: 16px; }
  .who span { display: none; }
  .doc-toc { position: static; }
}
@media (max-width: 560px) {
  .dl-row { grid-template-columns: 32px minmax(0, 1fr); }
  .dl-row .btn { grid-column: 1 / -1; width: 100%; }
}
@media print {
  .topbar, .gp-banner, .doc-toc, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .gp-main { padding: 0; max-width: none; }
  .doc-head, .doc-sec { border-radius: 0; padding: 12px 0; break-inside: avoid; }
  .dl-row { break-inside: avoid; }
}

/* Pastel world in the GP view */
.doc-head h1 { font-weight: 400; font-size: 2.3rem; letter-spacing: -.015em; }
.doc-sec > h2 { font-weight: 500; }
.doc-head, .doc-sec { border-radius: 26px; }
.dl-ic { width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; }
.dl-ic.phys { background: var(--tile-blue); color: var(--phys); }
.dl-ic.psych { background: var(--tile-lav); color: var(--psych); }
.dl-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
.dl-row.off { grid-template-columns: 44px 1fr; }

/* Reply to the patient's online consultation */
.gp-reply { margin-top: 10px; display: grid; gap: 8px; background: var(--fill); border-radius: 14px; padding: 12px 14px; }
.gp-reply textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--surface); color: inherit; }
.gp-reply .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-reply .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gp-reply.sent { background: var(--ok-bg); }
.gp-reply.sent p { margin: 4px 0 0; }

/* Questions for the review */
.qlist { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 10px; }
.qlist details { margin-top: 4px; }
.qlist summary { cursor: pointer; color: var(--brand); font-weight: 600; }
