/* Patient portal — mobile-first additions on top of the shared kit. Tokens only, no colours. */
.mc-main { max-width: 900px; }
.mc-header-right [data-testid="current-user"] { white-space: nowrap; }
.mc-main { padding-bottom: 64px; }
.mc-btn { min-height: 40px; }
.mc-btn.sm { min-height: 34px; }
.mc-input, .mc-select, .mc-textarea { min-height: 42px; }

/* Navigation: wraps into a tidy 4-column grid on phones */
@media (max-width: 720px) {
  .mc-header-inner { flex-wrap: wrap; }   /* the kit gives the nav order:3 + width:100% but no wrap */
  .mc-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 2px; }
  .mc-nav a { text-align: center; padding: 7px 2px; font-size: .8rem; }
  .mc-header-right [data-testid="current-user"] { display: none; }
  .mc-brand > span:nth-child(2) { font-size: .95rem; }
  .mc-brand .mc-app-tag { display: none; }   /* the nav makes the app obvious; keeps brand + sign-out on one row */
  .mc-header-right { margin-left: auto; }
}

/* Auth cards: give the kit's bare "N" the brand treatment */
.mc-login .mc-logo { border-radius: 10px; background: var(--mc-primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.mc-login { margin: 4vh auto; }

/* Page header */
.pt-page { margin-bottom: 14px; }
.pt-page h1 { font-size: 1.35rem; }
.pt-page .sub { color: var(--mc-muted); font-size: .9rem; }

/* Home */
.pt-greeting { margin-bottom: 14px; }
.pt-greeting h1 { font-size: 1.5rem; margin-bottom: 2px; }
.pt-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 600px) { .pt-tiles { grid-template-columns: repeat(4, 1fr); } }
.pt-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: var(--mc-radius); color: var(--mc-text); box-shadow: var(--mc-shadow); }
.pt-tile:hover { text-decoration: none; border-color: var(--mc-primary); }
.pt-tile .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.pt-tile .v.alert { color: var(--mc-warn); }
.pt-tile .l { font-size: .78rem; color: var(--mc-muted); text-transform: uppercase; letter-spacing: .04em; }
.pt-section { margin-bottom: 14px; }
.pt-section .mc-card-title h2 { font-size: 1.05rem; }

/* Appointment card */
.pt-appt { display: flex; flex-direction: column; gap: 8px; }
.pt-appt .when { font-size: 1.05rem; font-weight: 700; }
.pt-appt .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--mc-muted); font-size: .9rem; align-items: center; }
.pt-appt .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-appt .actions .mc-btn { flex: 1 1 auto; }
.pt-appt.next { border-left: 5px solid var(--mc-primary); }
.pt-appt.cancelled .when { text-decoration: line-through; color: var(--mc-muted); }

/* Generic list rows (mobile-friendly alternative to tables) */
.pt-rows { display: flex; flex-direction: column; gap: 8px; }
.pt-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: var(--mc-radius); color: var(--mc-text); text-align: left; font: inherit; width: 100%; cursor: pointer; }
.pt-row:hover { border-color: var(--mc-primary); text-decoration: none; }
.pt-row.static { cursor: default; }
.pt-row.static:hover { border-color: var(--mc-border); }
.pt-row .main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-row .title { font-weight: 650; }
.pt-row .sub { color: var(--mc-muted); font-size: .86rem; }
.pt-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.pt-row .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-row.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mc-accent); margin-right: 6px; vertical-align: middle; }

/* Booking wizard */
.pt-steps { display: flex; gap: 4px; margin-bottom: 14px; }
.pt-steps span { flex: 1; height: 5px; border-radius: 999px; background: var(--mc-border); }
.pt-steps span.done { background: var(--mc-primary); }
.pt-choices { display: flex; flex-direction: column; gap: 8px; }
.pt-choice { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--mc-border-strong); border-radius: var(--mc-radius); background: var(--mc-surface); font: inherit; color: var(--mc-text); text-align: left; cursor: pointer; width: 100%; }
.pt-choice:hover, .pt-choice.selected { border-color: var(--mc-primary); background: var(--mc-primary-soft); color: var(--mc-primary-text); }
.pt-choice .name { font-weight: 650; }
.pt-choice .sub { font-size: .84rem; color: var(--mc-muted); }
.pt-choice.selected .sub { color: inherit; opacity: .85; }
.pt-dates { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.pt-date { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border: 1px solid var(--mc-border-strong); border-radius: var(--mc-radius-sm); background: var(--mc-surface); font: inherit; cursor: pointer; color: var(--mc-text); }
.pt-date .d { font-size: .72rem; color: var(--mc-muted); text-transform: uppercase; }
.pt-date .n { font-size: 1.05rem; font-weight: 700; }
.pt-date .m { font-size: .7rem; color: var(--mc-muted); }
.pt-date:hover, .pt-date.selected { border-color: var(--mc-primary); background: var(--mc-primary-soft); color: var(--mc-primary-text); }
.pt-date.selected .d, .pt-date.selected .m { color: inherit; }
.mc-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (min-width: 600px) { .mc-slots { grid-template-columns: repeat(6, 1fr); } }
.mc-slot { text-align: center; min-height: 40px; }
.pt-summary { display: grid; gap: 10px; }
.pt-confirm-ref { font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; font-family: var(--mc-mono); }
.pt-room { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--mc-surface-2); border: 1px dashed var(--mc-border-strong); border-radius: var(--mc-radius); color: var(--mc-muted); text-align: center; padding: 16px; margin-bottom: 12px; }

/* Results */
.pt-flag-H, .pt-flag-L { font-weight: 700; color: var(--mc-danger); }
.pt-result { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-variant-numeric: tabular-nums; }
.pt-report { white-space: pre-wrap; font-size: .92rem; }

/* Tokens */
.mc-token.big { font-size: 1.35rem; padding: 14px 16px; text-align: center; display: block; }

/* Health */
.pt-obs-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-consent p { margin: 2px 0 8px 25px; font-size: .84rem; color: var(--mc-muted); }
.pt-messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pt-msg { max-width: 88%; padding: 10px 12px; border-radius: var(--mc-radius); background: var(--mc-surface-2); border: 1px solid var(--mc-border); }
.pt-msg.patient { align-self: flex-end; background: var(--mc-primary-soft); border-color: transparent; color: var(--mc-primary-text); }
.pt-msg .who { font-size: .76rem; color: var(--mc-muted); margin-bottom: 3px; }
.pt-msg.patient .who { color: inherit; opacity: .8; }
.pt-msg .body { white-space: pre-wrap; }
.pt-inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-inline-actions .mc-btn { flex: 1 1 auto; }
.pt-wrong-role { max-width: 520px; margin: 8vh auto; }
