:root {
  color-scheme: light;
  --ink: #193451;
  --blue: #153c70;
  --muted: #526880;
  --line: #d5e0e9;
  --paper: #f4f7fa;
  font: 16px/1.6 "IBM Plex Sans Arabic", "Tajawal", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--paper); }
a { color: var(--blue); }
button, input, select { font-family: inherit; }
[hidden] { display: none !important; }
.ui-icon { width: 1.3rem; height: 1.3rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.symbol-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
:where(a,button,summary,input,select):focus-visible { outline: 3px solid #a57625; outline-offset: 3px; }
.skip { position: fixed; z-index: 100; inset-block-start: -100px; inset-inline-start: 12px; padding: 10px 16px; background: #fff; }
.skip:focus { inset-block-start: 4px; }
.site-head { position: sticky; inset-block-start: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.head-inner, #main, .foot-inner, .session-message:not(:empty) { width: min(100% - 48px, 1080px); margin-inline: auto; }
.head-inner { min-height: 78px; display: flex; align-items: center; gap: clamp(12px, 3vw, 46px); }
.site-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--blue); flex: none; line-height: 1.35; }
.site-brand img { object-fit: contain; border-radius: 10px; }
.site-brand strong, .site-brand small { display: block; }
.site-brand strong { font-size: 18px; }
.site-brand small { color: var(--muted); font-size: 13px; }
.patient-nav { display: flex; align-items: center; gap: 4px; }
.patient-nav a, .session-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; text-decoration: none; }
.patient-nav a { color: #41566c; font-size: 15px; font-weight: 600; padding: 6px 12px; }
.patient-nav a[aria-current=page] { background: #e6eef7; color: #133e72; }
.patient-nav a:hover, .session-link:hover { background: #f1f5fa; }
.session-actions { margin-inline-start: auto; flex: none; }
.session-link { font-family: inherit; font-weight: 700; font-size: 14px; background: white; border: 1px solid #a9bacb; color: #173c64; padding: 8px 14px; cursor: pointer; }
#patient-signout { color: #763d3f; border-color: #cfb8b8; }
#patient-signout:disabled { opacity: .65; }
#main { flex: 1; padding-block: clamp(24px, 4vw, 48px); outline: none; scroll-margin-top: 90px; }
#main > .pc { margin: 0 auto; }
.session-message { margin-block: 0; }
.session-message:not(:empty) { margin-top: 14px; background: white; color: #244662; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; }
.welcome { isolation: isolate; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 260px; padding: clamp(24px, 5vw, 56px); border-radius: 24px; color: #fff; background: linear-gradient(112deg,#234b76,#102f58 75%); }
.welcome-copy { max-width: 550px; position: relative; z-index: 1; }
.kicker { font-size: 14px; font-weight: 700; color: #f4d496; }
.welcome h1 { color: white; font-size: clamp(32px, 4vw, 46px); margin: 2px 0 5px; line-height: 1.35; }
.welcome p { margin: 0 0 20px; max-width: 41ch; color: #e2ecf8; }
.primary-action { display: inline-flex; min-height: 46px; padding: 8px 20px; align-items: center; justify-content: center; gap: 9px; border-radius: 10px; background: #f2d399; color: #193452; text-decoration: none; font-weight: 700; }
.primary-action:hover { background: #ffe2ac; }
.welcome-art { width: 162px; height: 162px; flex: none; margin-inline-end: 5%; display: grid; position: relative; place-items: center; color: #f1d5a3; }
.welcome-art::before, .welcome-art::after { position: absolute; content: ""; inset: 0; border: 1px solid #dfbe863f; border-radius: 30%; transform: rotate(24deg); }
.welcome-art::after { transform: rotate(-15deg) scale(1.2); border-color: #b0cad237; }
.welcome-art .ui-icon { width: 82px; height: 82px; stroke-width: 1; }
.follow { margin-top: 25px; }
.follow h2, .portal-panel h1 { margin: 0 0 14px; }
.follow h2 { font-size: 22px; }
.follow-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.action-tile { display: flex; align-items: center; min-width: 0; gap: 14px; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: white; text-decoration: none; color: var(--ink); }
.action-tile:hover { border-color: #8aa1b9; }
.action-tile > i { display: grid; place-items: center; background: #eaf0f7; color: var(--blue); width: 45px; height: 45px; border-radius: 12px; flex: none; }
.action-tile > .ui-icon { margin-inline-start: auto; color: #627e95; }
.action-tile strong, .action-tile small { display: block; }
.action-tile strong { font-size: 18px; }
.action-tile small { font-size: 14px; color: var(--muted); }
.portal-panel { background: #fff; border: 1px solid var(--line); padding: clamp(20px,4vw,36px); border-radius: 18px; }
.portal-panel p { color: var(--muted); }
.portal-panel a, .archive-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.archive-link { margin-top: 14px; }
.panel-actions { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.portal-archive [data-saved-recordings] .care-recording > h3,
.portal-archive [data-saved-recordings] .care-recording > p.care-muted:not([role]) { display: none; }
.site-foot { border-top: 1px solid var(--line); background: #fff; }
.foot-inner { display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: center; padding-block: 12px; font-size: 14px; color: var(--muted); }
.foot-inner a { min-height: 44px; display: inline-flex; align-items: center; }
.foot-inner a:last-child { margin-inline-start: auto; }
#service-state { display: flex; align-items: center; gap: 7px; }
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: #8b7154; }
.pc-next-appointment { border-inline-start: 4px solid #49719a; }
.pc-appointment-history { border-block-start: 1px solid var(--line); margin-block-start: 24px; }
.pc-appointment-history > summary { cursor: pointer; color: var(--blue); font-weight: 700; padding-block: 14px; }
@media(max-width:800px) {
  .head-inner, #main, .foot-inner, .session-message:not(:empty) { width: calc(100% - 30px); }
  .head-inner { min-height: 64px; gap: 8px; }
  .site-brand img { width: 40px; height: 40px; }
  .site-brand strong { font-size: 16px; }
  .site-brand small { font-size: 12px; }
  .session-link { gap: 5px; padding-inline: 10px; }
  .patient-nav { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 20; background: white; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); }
  .patient-nav a { flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.4; padding: 4px 2px; min-height: 49px; }
  body { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
  #main { padding-block: 20px 28px; scroll-margin-top: 74px; }
  .welcome { min-height: 0; padding: 25px 20px; border-radius: 18px; }
  .welcome p { font-size: 15px; }
  .welcome-art { display: none; }
  .follow-grid { grid-template-columns: 1fr; gap: 10px; }
  .action-tile { padding: 14px; }
  .follow { margin-top: 20px; }
  .foot-inner { gap: 0 15px; font-size: 13px; }
  .foot-inner a:last-child { margin-inline-start: 0; }
  #service-state { width: 100%; }
}
@media print { .site-head, .site-foot, .session-message { display: none; } #main { width: 100%; padding: 0; } }
