/* Портал пацієнта: легкий каркас для телефона. Цілі дотику — від 44 px, поля — 16 px (без масштабування в iOS). */
.portal { min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); font-size: var(--fs-14); }
.portal__top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: var(--brand-ink); color: #fff; }
.portal__logo { height: 16px; width: auto; flex: none; margin: 8px 8px 8px 0; }
.portal__who { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-13); color: rgba(230, 243, 240, 0.84); }
.portal__top b { font-size: var(--fs-16); font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal__top .btn { color: #fff; border-color: rgba(255, 255, 255, 0.28); background: transparent; height: 40px; }
.portal__main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px calc(84px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.portal__main:focus { outline: none; }
.portal h1 { font-size: var(--fs-18); font-weight: 650; }
.portal h2 { font-size: var(--fs-14); font-weight: 650; color: var(--ink-2); }
.portal .btn { height: 44px; padding: 0 16px; font-size: var(--fs-14); border-radius: var(--r-8); }
.portal .btn--sm { height: 40px; padding: 0 12px; font-size: var(--fs-14); }
.portal .input, .portal .select { height: 48px; font-size: 16px; border-radius: var(--r-8); }
.portal .textarea { font-size: 16px; }
.portal__tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface);
  border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom, 0px); }
.portal__tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--ink-muted);
  font-size: var(--fs-12); font-weight: 600; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.portal__tab:hover { text-decoration: none; }
.portal__tab[aria-current="page"] { color: var(--accent-ink); }
.portal__tab .icon { width: 22px; height: 22px; }
.portal__tab:active { background: var(--surface-3); }
.plist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-8); }
.plist__item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.plist__item:last-child { border-bottom: 0; }
.plist__when { font-size: var(--fs-16); font-weight: 650; }
.plist__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plist__meta { color: var(--ink-2); }
.plist__empty { padding: 14px; color: var(--ink-muted); }
.portal .slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.portal .slot { height: 44px; min-width: 72px; font-size: var(--fs-14); border-radius: var(--r-8); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.portal .slot:active { background: var(--surface-3); }
.portal .slot-day { font-size: var(--fs-14); margin: 10px 0 6px; }
.portal .dialog { width: min(520px, calc(100vw - 24px)); }
.portal-step { display: flex; flex-direction: column; gap: 8px; }
html:has(.portal) { overscroll-behavior-y: contain; }
@media (min-width: 720px) { .portal__tabs { position: static; max-width: 640px; margin: 0 auto; width: 100%; border: 1px solid var(--line); border-radius: var(--r-8); order: -1; }
  .portal__main { padding-bottom: 24px; } .portal { gap: 12px; } .portal__tabs { margin-top: 12px; } }
html:has(.portal) .dialog .btn { height: 44px; padding: 0 16px; font-size: var(--fs-14); }
html:has(.portal) .dialog .input, html:has(.portal) .dialog .select { height: 48px; font-size: 16px; }
@media (pointer: coarse) { .auth .input, .auth .btn--primary, .auth .btn { height: 44px; } .auth__foot .btn { height: 40px; } }
.portal-submit { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 4; padding: 8px 0; background: var(--canvas); }
@media (min-width: 720px) { .portal-submit { bottom: 0; } }
