:root {
    --navy-950: #03263a;
    --navy-900: #073f61;
    --navy-800: #0a527b;
    --blue-600: #1479b8;
    --teal-600: #0d9488;
    --teal-500: #14b8a6;
    --red-600: #e51f37;
    --red-500: #ef334b;
    --green-700: #047857;
    --green-100: #d1fae5;
    --surface: #f3f7fb;
    --surface-blue: #eaf3f8;
    --white: #ffffff;
    --text: #153244;
    --muted: #64748b;
    --border: #dce6ec;
    --danger: #c62828;
    --danger-soft: #ffebee;
    --success: #0f766e;
    --success-soft: #ecfdf5;
    --shadow-sm: 0 10px 28px rgba(3, 38, 58, 0.08);
    --shadow-md: 0 20px 50px rgba(3, 38, 58, 0.14);
    --radius-sm: 13px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --bottom-nav-height: 84px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--surface);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img, svg { display: block; }
svg { fill: currentColor; }
[hidden] { display: none !important; }

.portal-skip {
    position: fixed;
    left: 14px;
    top: -100px;
    z-index: 1000;
    padding: 10px 14px;
    color: white;
    background: var(--navy-950);
    border-radius: 10px;
}
.portal-skip:focus { top: 12px; }

.portal-container {
    width: min(calc(100% - 28px), 760px);
    margin-inline: auto;
}
.portal-container--narrow { max-width: 560px; }
.portal-main { padding: 18px 0 36px; }
.portal-main--with-nav { padding-bottom: calc(var(--bottom-nav-height) + 28px + env(safe-area-inset-bottom)); }

.portal-page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding-top: env(safe-area-inset-top);
    background: rgba(243, 247, 251, 0.92);
    border-bottom: 1px solid rgba(220, 230, 236, 0.84);
    backdrop-filter: blur(16px);
}
.portal-page-header__inner {
    width: min(calc(100% - 28px), 760px);
    min-height: 74px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
}
.portal-page-heading { min-width: 0; text-align: center; }
.portal-page-heading h1 {
    margin: 0;
    overflow: hidden;
    color: var(--navy-950);
    font-size: 1.05rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-page-heading p {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.icon-button, .home-link, .mini-brand {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--navy-800);
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 5px 18px rgba(3, 38, 58, 0.05);
}
.icon-button { border: 1px solid var(--border); }
.icon-button svg, .home-link svg { width: 21px; height: 21px; }
.mini-brand img { width: 36px; height: 36px; object-fit: contain; }

.portal-alert {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 13px 14px;
    border: 1px solid;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 600;
}
.portal-alert__icon {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
}
.portal-alert--error { color: #8f1d1d; background: var(--danger-soft); border-color: #ffcdd2; }
.portal-alert--error .portal-alert__icon { background: var(--danger); }
.portal-alert--success { color: #065f46; background: var(--success-soft); border-color: #a7f3d0; }
.portal-alert--success .portal-alert__icon { background: var(--success); }
.portal-alert--info { color: var(--navy-800); background: #eff8ff; border-color: #bfe3f6; }
.portal-alert--info .portal-alert__icon { background: var(--blue-600); }

/* Authentication */
.portal-auth-page {
    min-height: 100vh;
    color: white;
    background:
        radial-gradient(circle at 84% 10%, rgba(255,255,255,.14), transparent 25%),
        radial-gradient(circle at 8% 82%, rgba(255,255,255,.1), transparent 27%),
        linear-gradient(145deg, #03263a 0%, #0a527b 54%, #0d9488 100%);
}
.auth-shell {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}
.auth-decoration {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.auth-decoration--one { width: 190px; height: 190px; top: -70px; right: -65px; }
.auth-decoration--two { width: 240px; height: 240px; bottom: -100px; left: -90px; }
.auth-content { width: min(100%, 430px); }
.portal-brand {
    width: max-content;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 24px;
}
.portal-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 4px;
    background: rgba(255,255,255,.95);
    border-radius: 17px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.portal-brand span { display: grid; line-height: 1.05; }
.portal-brand strong { font-size: 1.15rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.portal-brand small { margin-top: 5px; color: rgba(255,255,255,.76); font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-intro { margin-bottom: 22px; text-align: center; }
.auth-intro--compact { margin-bottom: 18px; }
.auth-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 15px;
    color: white;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    box-shadow: 0 15px 36px rgba(0,0,0,.14);
}
.auth-icon svg { width: 37px; height: 37px; }
.auth-intro h1 { margin: 0; font-size: clamp(1.75rem, 8vw, 2.25rem); font-weight: 900; letter-spacing: -.035em; }
.auth-intro p { max-width: 360px; margin: 7px auto 0; color: rgba(255,255,255,.82); font-size: .85rem; font-weight: 500; }
.auth-card {
    padding: 22px;
    color: var(--text);
    background: white;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 26px;
    box-shadow: 0 22px 60px rgba(0,0,0,.2);
}
.portal-form { display: grid; gap: 18px; }
.field-block { display: grid; gap: 8px; }
.field-block label { color: var(--navy-950); font-size: .8rem; font-weight: 800; }
.field-block small { color: var(--muted); font-size: .68rem; }
.field-control { position: relative; }
.field-control__icon {
    position: absolute;
    left: 9px;
    top: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    color: var(--navy-800);
    background: var(--surface-blue);
    border-radius: 11px;
    pointer-events: none;
}
.field-control__icon svg { width: 20px; height: 20px; }
.field-control input {
    width: 100%;
    height: 56px;
    padding: 0 15px 0 57px;
    color: var(--navy-950);
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 15px;
    outline: none;
    font-size: .95rem;
    font-weight: 650;
    transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}
.field-control input:focus { background: white; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(20,121,184,.1); }
.field-control input:invalid:not(:placeholder-shown) { border-color: #e57373; }

.portal-primary-button, .portal-secondary-button {
    min-height: 52px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    border-radius: 15px;
    font-size: .88rem;
    font-weight: 850;
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.portal-primary-button {
    color: white;
    background: linear-gradient(135deg, var(--navy-900), var(--blue-600), var(--teal-600));
    border: 0;
    box-shadow: 0 13px 25px rgba(10,82,123,.24);
}
.portal-primary-button svg, .portal-secondary-button svg { width: 20px; height: 20px; }
.portal-primary-button:hover, .portal-secondary-button:hover { transform: translateY(-1px); }
.portal-primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; transform: none; }
.portal-secondary-button {
    color: var(--navy-800);
    background: #f0f9ff;
    border: 1.5px solid #add8ef;
}
.auth-security-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px;
    margin-top: 16px;
    padding: 12px;
    color: var(--muted);
    background: var(--surface-blue);
    border-radius: 13px;
    font-size: .7rem;
    font-weight: 550;
}
.auth-security-note svg { width: 19px; height: 19px; color: var(--navy-800); }
.auth-switch { margin: 16px 0 0; color: rgba(255,255,255,.78); text-align: center; font-size: .8rem; }
.auth-switch a { color: white; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.auth-back-link { display: block; width: max-content; margin: 14px auto 0; color: rgba(255,255,255,.74); font-size: .72rem; }

/* Shared loading and toast */
.portal-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3,38,58,.52);
    backdrop-filter: blur(5px);
}
.portal-loading-card {
    width: min(100%, 260px);
    display: grid;
    justify-items: center;
    gap: 15px;
    padding: 28px;
    color: var(--navy-950);
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}
.portal-loading-card img { width: 58px; height: 58px; object-fit: contain; }
.portal-loading-card strong { font-size: .82rem; }
.portal-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dbeaf2;
    border-top-color: var(--teal-600);
    border-radius: 50%;
    animation: portal-spin .8s linear infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }
.portal-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom));
    z-index: 900;
    max-width: calc(100% - 30px);
    padding: 11px 15px;
    transform: translate(-50%, 18px);
    color: white;
    background: var(--navy-950);
    border-radius: 11px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    font-size: .76rem;
    font-weight: 650;
    transition: .22s ease;
}
.portal-toast.show { transform: translate(-50%, 0); opacity: 1; }
.portal-toast.error { background: #991b1b; }
.portal-toast.success { background: #065f46; }

/* Dashboard */
.welcome-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 2px 14px;
}
.welcome-kicker { color: var(--muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.welcome-row h2, .appointments-title-row h2 { margin: 2px 0 0; color: var(--navy-950); font-size: 1.52rem; font-weight: 900; letter-spacing: -.04em; }
.welcome-row p { margin: 1px 0 0; color: var(--muted); font-size: .72rem; }
.logout-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--red-600);
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 13px;
}
.logout-button svg { width: 21px; height: 21px; }
.notice-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    color: #7c2d12;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 17px;
}
.notice-banner__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #ea580c;
    background: #ffedd5;
    border-radius: 12px;
}
.notice-banner__icon svg { width: 21px; height: 21px; }
.notice-banner strong { display: block; font-size: .79rem; }
.notice-banner p { margin: 3px 0 0; font-size: .72rem; line-height: 1.45; }
.doctor-dashboard-card {
    padding: 18px;
    color: white;
    background:
        radial-gradient(circle at 95% 5%, rgba(255,255,255,.13), transparent 30%),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}
.doctor-dashboard-card__top { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.doctor-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: white;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 18px;
}
.doctor-avatar svg { width: 31px; height: 31px; }
.doctor-dashboard-card__copy { min-width: 0; }
.doctor-dashboard-card__copy span { color: rgba(255,255,255,.65); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.doctor-dashboard-card__copy h3 { margin: 3px 0 0; overflow: hidden; font-size: 1rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.doctor-dashboard-card__copy p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: .72rem; }
.doctor-dashboard-card .portal-primary-button { background: linear-gradient(135deg, var(--red-600), var(--red-500)); box-shadow: 0 12px 24px rgba(229,31,55,.25); }
.appointments-link-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
    padding: 15px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}
.appointments-link-card__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--blue-600);
    background: #e0f2fe;
    border-radius: 13px;
}
.appointments-link-card__icon svg { width: 22px; height: 22px; }
.appointments-link-card > span:nth-child(2) { min-width: 0; display: grid; }
.appointments-link-card strong { color: var(--navy-950); font-size: .82rem; }
.appointments-link-card small { color: var(--muted); font-size: .67rem; }
.appointments-link-card__arrow { width: 20px; height: 20px; fill: none; stroke: var(--navy-800); stroke-width: 2; }
.live-status-card {
    margin-top: 13px;
    padding: 18px;
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}
.live-status-card__head { display: flex; align-items: center; justify-content: space-between; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    color: var(--success);
    background: #ccfbf1;
    border-radius: 999px;
    font-size: .61rem;
    font-weight: 900;
    letter-spacing: .08em;
}
.live-pill i { width: 7px; height: 7px; background: var(--teal-500); border-radius: 50%; box-shadow: 0 0 0 4px rgba(20,184,166,.14); }
.mini-refresh {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--blue-600);
    background: #e0f2fe;
    border: 0;
    border-radius: 12px;
}
.mini-refresh svg { width: 19px; height: 19px; }
.mini-refresh.loading svg { animation: portal-spin .8s linear infinite; }
.live-status-card > p { margin: 16px 0 3px; color: var(--muted); font-size: .73rem; font-weight: 650; }
.live-status-card > strong { display: block; color: var(--navy-950); font-size: 3.4rem; line-height: 1; font-weight: 950; letter-spacing: -.05em; }
.live-status-card > small { display: block; margin-top: 9px; color: var(--muted); font-size: .63rem; }
.guideline-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px;
    margin-top: 13px;
    padding: 14px;
    background: #eff8ff;
    border: 1px solid #cce7f5;
    border-radius: 17px;
}
.guideline-card__icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--blue-600); background: white; border-radius: 12px; }
.guideline-card__icon svg { width: 20px; height: 20px; }
.guideline-card strong { display: block; color: var(--navy-950); font-size: .77rem; }
.guideline-card p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; }

/* Booking */
.token-booking-card, .booking-success-card {
    padding: 22px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.booking-success-card { margin-bottom: 14px; color: #065f46; background: var(--success-soft); border-color: #a7f3d0; }
.booking-success-card__icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; color: white; background: var(--success); border-radius: 50%; font-size: 1.4rem; font-weight: 900; }
.booking-success-card h2 { margin: 0; color: #064e3b; font-size: 1.2rem; }
.booking-success-card > p { margin: 5px 0 16px; font-size: .74rem; }
.booking-success-token { width: 118px; height: 118px; display: grid; place-content: center; margin: 0 auto 14px; background: white; border: 3px solid #34d399; border-radius: 50%; }
.booking-success-token small { color: var(--muted); font-size: .62rem; }
.booking-success-token strong { color: var(--success); font-size: 2.8rem; line-height: 1; }
.booking-success-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.booking-success-details div { padding: 10px; background: rgba(255,255,255,.72); border-radius: 12px; }
.booking-success-details dt { color: var(--muted); font-size: .6rem; }
.booking-success-details dd { margin: 2px 0 0; color: #064e3b; font-size: .72rem; font-weight: 800; }
.token-live-label { width: max-content; display: flex; align-items: center; gap: 6px; margin: 0 auto 16px; padding: 6px 10px; color: var(--success); background: #ccfbf1; border-radius: 999px; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.token-live-label i { width: 7px; height: 7px; background: var(--teal-500); border-radius: 50%; }
.token-booking-card h2 { margin: 0; color: var(--navy-950); font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.token-booking-card > p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.token-circle {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    margin: 26px auto 18px;
    background: #f0fdfa;
    border: 3px solid var(--teal-500);
    border-radius: 50%;
    box-shadow: 0 13px 30px rgba(20,184,166,.16);
}
.token-circle strong { color: var(--teal-600); font-size: 3.6rem; line-height: 1; font-weight: 950; letter-spacing: -.06em; }
.token-date { width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 auto 24px; padding: 8px 12px; color: var(--muted); background: #f8fafc; border: 1px solid var(--border); border-radius: 11px; font-size: .7rem; }
.token-date svg { width: 16px; height: 16px; }
.token-refresh-button { margin-bottom: 10px; }
.token-help-note { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; padding: 11px; color: var(--muted); background: #f8fafc; border-radius: 12px; text-align: left; font-size: .65rem; }
.token-help-note svg { width: 18px; height: 18px; color: var(--blue-600); }
.portal-confirm-dialog { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 20px; }
.portal-confirm-dialog__backdrop { position: absolute; inset: 0; background: rgba(3,38,58,.58); backdrop-filter: blur(4px); }
.portal-confirm-dialog__card { position: relative; width: min(100%, 380px); padding: 24px; text-align: center; background: white; border-radius: 24px; box-shadow: var(--shadow-md); }
.portal-confirm-dialog__icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; color: white; background: var(--blue-600); border-radius: 50%; font-size: 1.2rem; font-weight: 900; }
.portal-confirm-dialog__card h2 { margin: 0; color: var(--navy-950); font-size: 1.2rem; }
.portal-confirm-dialog__card p { margin: 8px 0 20px; color: var(--muted); font-size: .8rem; }
.portal-confirm-dialog__card p strong { color: var(--blue-600); font-size: 1.1rem; }
.portal-confirm-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* Appointments */
.appointments-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.appointments-list { display: grid; gap: 12px; }
.appointment-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
    background: white;
    border: 1.5px solid #cfe0e9;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.appointment-card--completed { background: #f0fdfa; border-color: #99f6e4; }
.appointment-card--cancelled { background: #fff7f7; border-color: #fecaca; }
.appointment-card__icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--blue-600); background: #e0f2fe; border-radius: 14px; }
.appointment-card--completed .appointment-card__icon { color: var(--success); background: #ccfbf1; }
.appointment-card--cancelled .appointment-card__icon { color: var(--danger); background: #fee2e2; }
.appointment-card__icon svg { width: 23px; height: 23px; }
.appointment-card__content { min-width: 0; }
.appointment-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.appointment-card__heading > div { min-width: 0; }
.appointment-card h3 { margin: 0; overflow: hidden; color: var(--navy-950); font-size: .85rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.appointment-card__heading p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: .65rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.appointment-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: .56rem; font-weight: 900; text-transform: uppercase; }
.appointment-status--active, .appointment-status--neutral { color: #075985; background: #e0f2fe; }
.appointment-status--completed { color: #065f46; background: #a7f3d0; }
.appointment-status--cancelled { color: #991b1b; background: #fecaca; }
.appointment-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.appointment-meta span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; color: var(--muted); background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-size: .6rem; font-weight: 650; }
.appointment-meta svg { width: 12px; height: 12px; }
.appointments-empty-card { padding: 34px 20px; text-align: center; background: white; border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-sm); }
.appointments-empty-card > span { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 15px; color: #93a9b6; background: var(--surface-blue); border-radius: 50%; }
.appointments-empty-card > span svg { width: 38px; height: 38px; }
.appointments-empty-card h2 { margin: 0; color: var(--navy-950); font-size: 1.08rem; }
.appointments-empty-card p { margin: 6px 0 18px; color: var(--muted); font-size: .75rem; }

/* Bottom navigation */
.portal-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
    height: var(--bottom-nav-height);
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    align-items: center;
    padding: 7px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(220,230,236,.94);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(3,38,58,.22);
    backdrop-filter: blur(16px);
}
.portal-bottom-nav a {
    min-height: 62px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 3px;
    color: #76909f;
    border-radius: 16px;
    font-size: .61rem;
    font-weight: 750;
}
.portal-bottom-nav svg { width: 22px; height: 22px; }
.portal-bottom-nav a.active { color: var(--navy-800); background: var(--surface-blue); }
.portal-bottom-nav__book { color: white !important; background: linear-gradient(135deg, var(--red-600), var(--red-500)) !important; box-shadow: 0 10px 22px rgba(229,31,55,.24); }
.portal-bottom-nav__book.active { outline: 3px solid rgba(229,31,55,.16); }

:focus-visible { outline: 3px solid rgba(20,121,184,.35); outline-offset: 3px; }

@media (min-width: 560px) {
    .portal-main { padding-top: 24px; }
    .auth-card { padding: 28px; }
    .doctor-dashboard-card { padding: 22px; }
    .token-booking-card, .booking-success-card { padding: 30px; }
    .appointment-card { padding: 18px; }
}

@media (min-width: 800px) {
    .portal-page-header__inner { min-height: 84px; }
    .portal-page-heading h1 { font-size: 1.2rem; }
    .portal-main--with-nav { padding-bottom: 42px; }
    .portal-bottom-nav {
        position: sticky;
        left: auto;
        right: auto;
        bottom: 18px;
        width: min(calc(100% - 28px), 500px);
        margin: 0 auto 18px;
    }
    .portal-toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.token-refresh-button.loading svg { animation: portal-spin .8s linear infinite; }


/* Language switcher */
.language-switcher{display:flex;align-items:center;gap:3px;padding:4px;background:rgba(255,255,255,.94);border:1px solid rgba(7,63,97,.12);border-radius:999px;box-shadow:0 8px 24px rgba(7,63,97,.12);z-index:1000}
.language-switcher a{display:grid;place-items:center;min-width:38px;height:32px;padding:0 10px;border-radius:999px;color:#526575;text-decoration:none;font-size:12px;font-weight:900}
.language-switcher a.active{background:#073f61;color:#fff}
.portal-language-switcher{position:fixed;top:max(10px,env(safe-area-inset-top));right:12px}
html[lang="si"] body{font-family:"Noto Sans Sinhala","Inter",sans-serif}
@media(max-width:480px){.portal-language-switcher{top:max(7px,env(safe-area-inset-top));right:8px}.language-switcher a{min-width:34px;height:29px;padding:0 8px}}
