/* Patient Notes extends the existing palette, cards and type scale. */
.pn-page { background: var(--blue-tint); padding-top: 60px; padding-bottom: 60px; }
.pn-heading { margin-bottom: 48px; }
.pn-caption { font-size: 13px; line-height: 22px; color: #666873; font-weight: 400; }
.pn-heading .pn-caption { text-align: center; margin-top: 12px; }
.pn-grid { max-width: 1340px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: clamp(28px, 3vw, 50px); }
.pn-note { display: grid; grid-template-rows: 1fr auto; gap: 10px; min-width: 0; }
.pn-card.card { border: 0; outline: 0; color: var(--ink); text-align: left; cursor: pointer; min-width: 0; width: 100%; min-height: 401px; background: var(--gray-card); padding: clamp(40px, 3.2vw, 50px); gap: clamp(28px, 3vw, 50px); box-shadow: 0 0 30px rgba(39,42,60,.05); }
.pn-card.card:hover { outline: 0; transform: none; box-shadow: 0 0 30px rgba(39,42,60,.05); }
.pn-surface { display: flex; flex: 1; flex-direction: column; width: 100%; border: 0; padding: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; min-width: 0; }
.pn-content { opacity: .75; transition: opacity .25s; width: 100%; margin: auto 0; }
.pn-content img { width: 100%; height: 250px; object-fit: contain; }
.pn-text { font-size: 15px; line-height: 28px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.pn-surface { min-height: 250px; }
.pn-meta { display: block; padding-left: 4px; }
.pn-open { border: 0; background: none; color: #626571; min-width: 44px; min-height: 44px; padding: 8px; cursor: pointer; border-radius: 4px; flex: none; font-size: 20px; }
.pn-card.card.is-active, .pn-card.card:focus-within { transform: translateY(-3px); outline: 0; box-shadow: 0 0 30px rgba(39,42,60,.14); }
.pn-card.is-active .pn-content, .pn-card:focus-within .pn-content { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .pn-card.card:hover { transform: translateY(-3px); outline: 0; box-shadow: 0 0 30px rgba(39,42,60,.14); }
  .pn-card:hover .pn-content { opacity: 1; }
}
.pn-page button:focus-visible, .pn-dialog button:focus-visible, .pn-dialog input:focus-visible, .pn-dialog textarea:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.pn-contribute { display: flex; justify-content: center; margin-top: 32px; }
/* The same text + fine underline action used by Services / Read more.
   Padding enlarges the touch target without making a separate button panel. */
.pn-cta, .pn-choice { background: none; border: 0; border-radius: 0; padding: 8px 0; min-height: 44px; color: rgba(39,42,60,.8); font-size: 15px; line-height: 28px; text-align: left; cursor: pointer; }
.pn-cta .pn-choice-label, .pn-choice .pn-choice-label { border-bottom: 1px solid rgba(39,42,60,.25); padding-bottom: 5px; }
.pn-cta:hover, .pn-choice:hover { color: var(--ink); }
.pn-cta:hover .pn-choice-label, .pn-choice:hover .pn-choice-label { border-bottom-color: var(--ink); }
.pn-sheet[data-step=choose] .pn-choice { text-align: center; }
.pn-dialog { padding: 24px; border: 0; border-radius: 8px; background: var(--gray-card); color: var(--ink); width: min(600px, calc(100% - 32px)); max-height: 90dvh; overflow: auto; box-shadow: 0 12px 48px rgba(39,42,60,.18); }
.pn-dialog[open] { animation: pn-dialog-enter 180ms ease-out both; }
.pn-dialog::backdrop { background: rgba(39,42,60,.3); animation: pn-backdrop-enter 180ms ease-out both; }
@keyframes pn-dialog-enter { from { opacity: 0; transform: translateY(4px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes pn-backdrop-enter { from { background: rgba(39,42,60,0); } to { background: rgba(39,42,60,.3); } }
.pn-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pn-dialog-head h2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.pn-choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pn-flow { display: flex; flex-direction: column; gap: 16px; }
.pn-flow label { display: flex; flex-direction: column; gap: 6px; }
.pn-flow textarea, .pn-flow input:not([type=radio]):not([type=checkbox]):not([type=file]) { border: 1px solid rgba(39,42,60,.2); border-radius: 4px; padding: 12px; font-size: 16px; line-height: 28px; width: 100%; background: var(--paper); color: var(--ink); }
.pn-flow textarea { resize: vertical; min-height: 150px; }
.pn-flow fieldset { border: 0; padding: 0; margin: 0; }
.pn-flow legend { margin-bottom: 8px; }
.pn-flow label.pn-check { flex-direction: row; align-items: flex-start; gap: 12px; padding: 6px 0; }
.pn-check input { flex: none; width: 18px; height: 18px; accent-color: var(--dark); margin: 5px 0 0; }
.pn-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pn-actions .form-submit { height: auto; min-height: 48px; padding: 10px 24px; }
.pn-error { color: var(--ink); border-left: 2px solid var(--orange); padding-left: 12px; font-size: 14px; line-height: 22px; }
.pn-error:empty { display: none; }
.pn-upload-preview { width: 100%; max-height: 220px; object-fit: contain; }
.pn-review { background: var(--gray-card); padding: 20px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pn-viewer { width: min(1100px, calc(100% - 24px)); }
.pn-view-body { overflow: auto; max-height: 70dvh; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.pn-view-body img { margin: auto; width: auto; max-width: 100%; max-height: 65dvh; object-fit: contain; }
.pn-view-body.is-zoomed img { max-width: none; max-height: none; width: auto; }
.pn-view-text { max-width: 700px; margin: auto; font-size: 18px; line-height: 30px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pn-viewer .pn-actions { margin-top: 16px; }
.pn-hidden { display: none !important; }
@media (max-width: 600px) {
  .pn-page { padding: 28px 16px 36px; }
  .pn-heading { margin-bottom: 32px; }
  .pn-grid { gap: 12px; }
  .pn-card.card { min-height: 401px; padding: 40px; gap: 28px; }
  .pn-surface { min-height: 250px; }
  .pn-content img { height: 250px; }
  .pn-text { font-size: 15px; line-height: 25px; -webkit-line-clamp: 8; }
  .pn-note { gap: 8px; }
  .pn-meta { font-size: 13px; line-height: 20px; padding-left: 2px; }
  .pn-open { padding: 4px; min-width: 36px; }
  .pn-sheet { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; border-radius: 8px 8px 0 0; max-height: 90dvh; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
  .pn-sheet[data-step=choose] { min-height: min(25dvh, 240px); }
  .pn-sheet[data-step=choose] .pn-dialog-head { margin-bottom: 10px; }
  .pn-sheet[data-step=choose] .pn-choice { padding: 8px 0; }
  .pn-dialog-head h2 { font-size: 16px; }
  .pn-contribute { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { .pn-card.card, .pn-content { transition: none; } .pn-card.card.is-active, .pn-card.card:focus-within, .pn-card.card:hover { transform: none; } .pn-dialog[open], .pn-dialog::backdrop { animation: none; } }
