/* Nashifia mobile app shells — Patient PWA + Clinic PWA
   Brand tokens shared; layout shells keep marketing (landing.css) separate. */

:root {
    --ns-app-primary: #19938d;
    --ns-app-primary-deep: #147a75;
    --ns-app-navy: #001f3f;
    --ns-app-ink: #1a2736;
    --ns-app-muted: #5c6b7a;
    --ns-app-surface: #f3f7f7;
    --ns-app-card: #ffffff;
    --ns-app-line: rgba(0, 31, 63, 0.08);
    --ns-app-danger: #dc3545;
    --ns-app-warning: #e6a23c;
    --ns-app-success: #28a745;
    --ns-app-radius: 12px;
    --ns-app-radius-sm: 8px;
    --ns-app-space: 16px;
    --ns-app-bar-h: 52px;
    --ns-app-nav-h: 64px;
    --ns-app-max: 480px;
    --ns-app-shadow: 0 1px 3px rgba(0, 31, 63, 0.06);
    --ns-app-shadow-up: 0 -2px 12px rgba(0, 31, 63, 0.06);
}

/* ---------- Shared shell ---------- */
body.ns-app,
body.clinic-app {
    margin: 0;
    background: var(--ns-app-surface);
    color: var(--ns-app-ink);
    font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.ns-app-shell {
    width: 100%;
    max-width: var(--ns-app-max);
    min-height: 100dvh;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--ns-app-surface);
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(var(--ns-app-nav-h) + env(safe-area-inset-bottom));
}

.ns-app-shell--guest {
    padding-bottom: env(safe-area-inset-bottom);
}

.ns-app-shell--no-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

.ns-app-main {
    padding: 12px var(--ns-app-space) 24px;
}

.ns-app-main--flush {
    padding-left: 0;
    padding-right: 0;
}

/* ---------- App bar ---------- */
.ns-app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--ns-app-bar-h);
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ns-app-line);
}

.ns-app-bar__back,
.ns-app-bar__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--ns-app-navy);
    border-radius: 50%;
    text-decoration: none;
    flex-shrink: 0;
}

.ns-app-bar__back:hover,
.ns-app-bar__action:hover {
    background: rgba(25, 147, 141, 0.08);
    color: var(--ns-app-primary-deep);
}

.ns-app-bar__back i,
.ns-app-bar__action i {
    font-size: 1.4rem;
}

.ns-app-bar__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--ns-app-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-app-bar__brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
    color: var(--ns-app-navy);
}

.ns-app-bar__brand img {
    height: 28px;
    width: auto;
}

.ns-app-bar__brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ns-app-bar__spacer {
    width: 44px;
    flex-shrink: 0;
}

/* ---------- Bottom navigation ---------- */
.ns-app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: var(--ns-app-max);
    margin: 0 auto;
    z-index: 200;
    display: flex;
    background: #fff;
    border-top: 1px solid rgba(0, 31, 63, 0.08);
    box-shadow: none;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: none;
}

.ns-app-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 56px;
    padding: 6px 2px 4px;
    text-decoration: none;
    color: #8a96a3;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
    transition: color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.ns-app-bottom-nav a i {
    font-size: 1.5rem;
    line-height: 1;
}

.ns-app-bottom-nav a.is-active {
    color: var(--ns-app-primary);
}

.ns-app-bottom-nav a:active {
    opacity: 0.75;
}

/* ---------- Install prompt ---------- */
.ns-app-install {
    display: none;
    margin: 0 var(--ns-app-space) 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--ns-app-line);
    border-radius: var(--ns-app-radius);
    box-shadow: var(--ns-app-shadow);
    align-items: center;
    gap: 12px;
}

.ns-app-install.is-visible {
    display: flex;
}

.ns-app-install__copy {
    flex: 1;
    min-width: 0;
}

.ns-app-install__copy strong {
    display: block;
    font-size: 0.875rem;
    color: var(--ns-app-navy);
}

.ns-app-install__copy span {
    font-size: 0.75rem;
    color: var(--ns-app-muted);
}

.ns-app-install__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ns-app-install__dismiss {
    border: 0;
    background: transparent;
    color: var(--ns-app-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ns-app-install__btn {
    border: 0;
    background: var(--ns-app-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    min-height: 36px;
}

/* ---------- Typography helpers ---------- */
.ns-app-greeting {
    font-size: 0.875rem;
    color: var(--ns-app-muted);
    margin: 0 0 2px;
}

.ns-app-headline {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ns-app-navy);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ns-app-section {
    margin-top: 20px;
}

.ns-app-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ns-app-section-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--ns-app-navy);
}

.ns-app-section-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ns-app-primary);
    text-decoration: none;
    white-space: nowrap;
}

.ns-app-location-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--ns-app-muted);
    margin: 0 0 12px;
}

.ns-app-location-chip i {
    color: var(--ns-app-primary);
}

/* ---------- Cards / chips ---------- */
.ns-app-card {
    background: var(--ns-app-card);
    border-radius: var(--ns-app-radius);
    border: 1px solid var(--ns-app-line);
    box-shadow: var(--ns-app-shadow);
    padding: 14px;
}

.ns-app-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -var(--ns-app-space) 0;
    padding-left: var(--ns-app-space);
    padding-right: var(--ns-app-space);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ns-app-chip-row::-webkit-scrollbar {
    display: none;
}

.ns-app-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 72px;
    padding: 4px 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
    text-decoration: none;
    color: var(--ns-app-ink);
    text-align: center;
}

.ns-app-chip:active {
    transform: scale(0.97);
}

.ns-app-chip__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(25, 147, 141, 0.1);
    color: var(--ns-app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    overflow: hidden;
    flex-shrink: 0;
}

.ns-app-chip__icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 1em;
    height: 1em;
    font-size: inherit;
}

.ns-app-chip__icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.ns-app-chip__name {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ns-app-stat-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: var(--ns-app-radius);
    overflow: hidden;
}

.ns-app-stat-chip {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid rgba(0, 31, 63, 0.1);
}

.ns-app-stat-chip:last-child {
    border-right: 0;
}

.ns-app-stat-chip span {
    display: block;
    font-size: 0.6875rem;
    color: var(--ns-app-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ns-app-stat-chip strong {
    font-size: 1.25rem;
    color: var(--ns-app-navy);
    font-weight: 700;
    line-height: 1.1;
}

.ns-app-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 650;
    line-height: 1;
}

.ns-app-status--open {
    background: rgba(40, 167, 69, 0.12);
    color: #1e7e34;
}

.ns-app-status--closed {
    background: rgba(108, 117, 125, 0.12);
    color: #495057;
}

.ns-app-status--serving {
    background: rgba(25, 147, 141, 0.14);
    color: var(--ns-app-primary-deep);
}

.ns-app-status--waiting {
    background: rgba(230, 162, 60, 0.16);
    color: #b36b00;
}

.ns-app-status--danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.ns-app-status--muted {
    background: rgba(0, 31, 63, 0.06);
    color: var(--ns-app-muted);
}

/* ---------- Buttons ---------- */
.ns-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--ns-app-radius-sm);
    font-size: 0.9375rem;
    font-weight: 650;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.ns-app-btn:active {
    transform: scale(0.98);
    opacity: 0.92;
}

.ns-app-btn--primary {
    background: var(--ns-app-primary);
    color: #fff;
}

.ns-app-btn--primary:hover {
    background: var(--ns-app-primary-deep);
    color: #fff;
}

.ns-app-btn--secondary {
    background: #fff;
    color: var(--ns-app-navy);
    border-color: var(--ns-app-line);
}

.ns-app-btn--danger {
    background: #fff;
    color: var(--ns-app-danger);
    border-color: rgba(220, 53, 69, 0.35);
}

.ns-app-btn--danger-solid {
    background: var(--ns-app-danger);
    color: #fff;
}

.ns-app-btn--success {
    background: var(--ns-app-success);
    color: #fff;
}

.ns-app-btn--warning {
    background: #fff;
    color: #b36b00;
    border-color: rgba(230, 162, 60, 0.45);
}

.ns-app-btn--block {
    width: 100%;
}

.ns-app-btn--sm {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.8125rem;
}

.ns-app-btn-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.ns-app-btn-row > * {
    flex: 1 1 0;
    min-width: 0;
}

.ns-app-btn-row form {
    display: flex;
}

.ns-app-btn-row form .ns-app-btn {
    width: 100%;
}

.ns-app-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Empty / toast ---------- */
.ns-app-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: var(--ns-app-radius);
    border: 1px solid var(--ns-app-line);
}

.ns-app-empty i {
    font-size: 2.5rem;
    color: var(--ns-app-muted);
    opacity: 0.55;
}

.ns-app-empty h3 {
    margin: 12px 0 6px;
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--ns-app-navy);
}

.ns-app-empty p {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: var(--ns-app-muted);
}

.ns-app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--ns-app-nav-h) + env(safe-area-inset-bottom) + 12px);
    transform: translateX(-50%) translateY(12px);
    z-index: 300;
    max-width: calc(var(--ns-app-max) - 32px);
    width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: var(--ns-app-radius-sm);
    background: var(--ns-app-navy);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 31, 63, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ns-app-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ns-app-toast--success {
    background: #1e7e34;
}

.ns-app-toast--error {
    background: #b02a37;
}

/* ---------- More list ---------- */
.ns-app-list {
    background: #fff;
    border-radius: var(--ns-app-radius);
    border: 1px solid var(--ns-app-line);
    overflow: hidden;
}

.ns-app-list a,
.ns-app-list button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--ns-app-line);
    background: #fff;
    color: var(--ns-app-ink);
    text-decoration: none;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    min-height: 52px;
}

.ns-app-list a:last-child,
.ns-app-list button:last-child,
.ns-app-list form:last-child button {
    border-bottom: 0;
}

.ns-app-list i:first-child {
    font-size: 1.25rem;
    color: var(--ns-app-primary);
    width: 24px;
    text-align: center;
}

.ns-app-list .ns-app-list__chevron {
    margin-left: auto;
    color: var(--ns-app-muted);
    font-size: 1.1rem;
}

.ns-app-list__danger {
    color: var(--ns-app-danger) !important;
}

.ns-app-list__danger i:first-child {
    color: var(--ns-app-danger);
}

/* ---------- Patient app overrides on landing components ---------- */
body.ns-app .ns-nav,
body.ns-app .ns-footer {
    display: none !important;
}

body.ns-app .ns-page-hero {
    padding: 8px 0 4px;
}

body.ns-app .ns-page-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

body.ns-app .ns-page-lead {
    font-size: 0.875rem;
    margin-bottom: 0;
}

body.ns-app .ns-search {
    margin: 0;
    padding: 0;
}

body.ns-app .ns-search .container {
    padding: 0;
    max-width: none;
}

body.ns-app .ns-search-panel {
    border-radius: var(--ns-app-radius);
    box-shadow: var(--ns-app-shadow);
    border: 1px solid var(--ns-app-line);
    padding: 14px;
    overflow: visible;
}

body.ns-app .ns-search-grid-home,
body.ns-app .ns-search-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

/* Shell is ~480px; don't switch to 4-col desktop grid inside the phone frame */
@media (min-width: 768px) {
    body.ns-app .ns-search-grid-home,
    body.ns-app .ns-search-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.ns-app .ns-field-submit-spacer {
        display: none;
    }
}

body.ns-app .ns-field > label {
    white-space: nowrap;
    margin-bottom: 6px;
}

body.ns-app .ns-field .form-control,
body.ns-app .ns-field .form-select,
body.ns-app .ns-field-category .select2-container .select2-selection--single {
    border: 1px solid rgba(0, 31, 63, 0.16);
    min-height: 44px;
    border-radius: var(--ns-app-radius-sm);
    background-color: #fff;
    box-shadow: none;
}

body.ns-app .ns-input-wrap {
    width: 100%;
}

body.ns-app .ns-field-submit .ns-btn {
    min-height: 44px;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

body.ns-app .ns-clinic-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.ns-app .ns-clinic-card {
    border-radius: var(--ns-app-radius);
    overflow: hidden;
    border: 1px solid var(--ns-app-line);
    box-shadow: var(--ns-app-shadow);
    background: #fff;
}

body.ns-app .ns-clinic-media {
    height: 120px;
}

body.ns-app .ns-clinic-actions {
    display: flex;
    gap: 8px;
}

body.ns-app .ns-clinic-actions .ns-btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
}

body.ns-app .ns-section,
body.ns-app .ns-section-results,
body.ns-app .ns-section-form,
body.ns-app .ns-section-track,
body.ns-app .ns-section-appts,
body.ns-app .ns-section-auth {
    padding-top: 8px;
    padding-bottom: 16px;
}

body.ns-app .ns-clinic-detail {
    padding-top: 8px;
    padding-bottom: 24px;
}

body.ns-app .ns-clinic-main .ns-block {
    background: #fff;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: var(--ns-app-radius);
    padding: 14px;
    margin-bottom: 12px;
}

body.ns-app .ns-clinic-main .ns-block:first-child {
    border-top: 1px solid rgba(0, 31, 63, 0.12);
    padding-top: 14px;
}

body.ns-app .ns-facility-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

body.ns-app .ns-hours-list li {
    gap: 12px;
}

body.ns-app .ns-hours-list li strong {
    color: var(--ns-app-navy);
}

body.ns-app .ns-doctor-card {
    padding: 12px 0;
}

body.ns-app .ns-section .container,
body.ns-app .ns-clinic-detail .container,
body.ns-app .ns-page-hero .container,
body.ns-app .ns-narrow,
body.ns-app .ns-track-wrap,
body.ns-app .ns-appts-wrap,
body.ns-app .ns-auth-wrap {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

body.ns-app .ns-clinic-hero {
    margin: 0;
}

body.ns-app .ns-clinic-cover {
    height: 140px;
    border-radius: 0;
}

body.ns-app .ns-clinic-hero-card {
    margin-top: -36px;
    border-radius: var(--ns-app-radius);
    box-shadow: var(--ns-app-shadow);
}

body.ns-app .ns-mobile-book-bar {
    display: block !important;
    bottom: calc(var(--ns-app-nav-h) + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--ns-app-max);
    padding: 10px 16px;
    padding-bottom: 10px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--ns-app-line);
    z-index: 150;
}

body.ns-app .ns-app-shell:has(.ns-mobile-book-bar) {
    padding-bottom: calc(var(--ns-app-nav-h) + 96px + env(safe-area-inset-bottom));
}

body.ns-app .ns-app-main:has(.ns-mobile-book-bar) {
    padding-bottom: 88px;
}

body.ns-app .ns-book-panel {
    border-radius: var(--ns-app-radius);
    border: 1px solid var(--ns-app-line);
    box-shadow: var(--ns-app-shadow);
    background: #fff;
    padding: 16px;
}

body.ns-app .ns-steps-bar {
    margin-left: calc(-1 * var(--ns-app-space));
    margin-right: calc(-1 * var(--ns-app-space));
    padding-left: var(--ns-app-space);
    padding-right: var(--ns-app-space);
}

body.ns-app .ns-book-nav {
    position: sticky;
    bottom: calc(var(--ns-app-nav-h) + env(safe-area-inset-bottom) + 8px);
    background: #fff;
    padding-top: 8px;
    margin-top: 16px;
    gap: 8px;
}

body.ns-app .ns-book-next,
body.ns-app .ns-book-nav .ns-btn-primary,
body.ns-app .ns-book-nav button[type="submit"] {
    min-height: 48px;
}

body.ns-app .ns-track-page {
    border-radius: var(--ns-app-radius);
    border: 1px solid var(--ns-app-line);
    box-shadow: var(--ns-app-shadow);
    background: #fff;
    padding: 16px;
}

body.ns-app .ns-track-token strong {
    font-size: 2rem;
}

body.ns-app .ns-track-stat strong {
    font-size: 1.35rem;
}

body.ns-app .ns-auth-card {
    border-radius: var(--ns-app-radius);
    box-shadow: var(--ns-app-shadow);
}

body.ns-app .ns-track-banner {
    border-radius: var(--ns-app-radius-sm);
    padding: 14px;
}

body.ns-app .ns-track-banner strong {
    font-size: 1.05rem;
}

body.ns-app .ns-track-stat-wide strong {
    font-size: 1.5rem;
    color: var(--ns-app-navy);
}

body.ns-app .ns-track-token {
    text-align: center;
    padding: 16px;
    margin: 12px 0;
    background: rgba(25, 147, 141, 0.08);
    border-radius: var(--ns-app-radius);
}

body.ns-app .ns-results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    margin-top: 16px;
}

body.ns-app .ns-clinic-aside {
    display: none !important;
}

/* Aside is hidden in the app shell — don't keep the desktop 280px second column */
body.ns-app .ns-clinic-layout {
    display: block;
    width: 100%;
}

body.ns-app .ns-clinic-main {
    width: 100%;
    max-width: none;
}

body.ns-app .ns-clinic-detail,
body.ns-app .ns-clinic-detail .container {
    width: 100%;
    max-width: none;
}

/* Prefer primary brand teal on clinic app buttons that still use Bootstrap */
body.clinic-app .btn-primary {
    background-color: var(--ns-app-primary);
    border-color: var(--ns-app-primary);
}

body.clinic-app .btn-primary:hover,
body.clinic-app .btn-primary:focus {
    background-color: var(--ns-app-primary-deep);
    border-color: var(--ns-app-primary-deep);
}

body.clinic-app .text-primary {
    color: var(--ns-app-primary) !important;
}


/* Compact search for app home — inherits single-column rules from body.ns-app */
.ns-app-search-compact {
    margin-bottom: 8px;
}

/* ---------- Clinic app ---------- */
body.clinic-app {
    --ns-app-primary: #19938d;
    --ns-app-primary-deep: #147a75;
    background: var(--ns-app-surface);
}

body.clinic-app .clinic-app-shell {
    width: 100%;
    max-width: var(--ns-app-max);
    min-height: 100dvh;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--ns-app-surface);
    padding-bottom: calc(var(--ns-app-nav-h) + env(safe-area-inset-bottom));
    overflow-x: clip;
}

body.clinic-app .clinic-app-shell--guest {
    padding-bottom: env(safe-area-inset-bottom);
}

body.clinic-app .clinic-app-content {
    padding: 0 0 24px;
}

body.clinic-app .clinic-app-bottom-nav {
    width: 100%;
    max-width: var(--ns-app-max);
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto;
    transform: none;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid rgba(0, 31, 63, 0.08);
    box-shadow: none;
    z-index: 1030;
}

body.clinic-app .clinic-app-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 56px;
    padding: 6px 2px 4px;
    text-decoration: none;
    color: #8a96a3;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
}

body.clinic-app .clinic-app-bottom-nav a i {
    font-size: 1.5rem;
}

body.clinic-app .clinic-app-bottom-nav a.is-active {
    color: var(--ns-app-primary);
}

body.clinic-app .ns-app-bar__logout {
    margin: 0;
    flex-shrink: 0;
}

body.clinic-app .ns-app-bar__logout .ns-app-bar__action {
    color: var(--ns-app-muted);
}

body.clinic-app .clinic-app-tabs {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: var(--ns-app-radius-sm);
    padding: 3px;
    margin-bottom: 8px;
}

body.clinic-app .clinic-app-tabs .nav-item {
    flex: 1;
    margin: 0;
}

body.clinic-app .clinic-app-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    border-radius: 7px;
    font-weight: 650;
    font-size: 0.875rem;
    color: var(--ns-app-muted);
    padding: 10px 8px;
    min-height: 40px;
    background: transparent;
}

body.clinic-app .clinic-app-tabs .nav-link.active {
    color: #fff;
    background: var(--ns-app-primary);
}

.clinic-queue-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

.clinic-queue-toolbar__link {
    border: 0;
    background: transparent;
    color: var(--ns-app-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.clinic-queue-toolbar__link:hover {
    color: var(--ns-app-danger);
}

.clinic-req-card,
.clinic-queue-card {
    background: #fff;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: var(--ns-app-radius);
    box-shadow: none;
    padding: 14px;
    margin-bottom: 10px;
}

.clinic-queue-card--serving {
    border-color: rgba(25, 147, 141, 0.4);
    background: linear-gradient(180deg, rgba(25, 147, 141, 0.06), #fff 42%);
}

.clinic-queue-card--secondary {
    background: #fbfcfc;
}

.clinic-queue-card--done {
    background: #f7f9f9;
    opacity: 1;
}

.clinic-queue-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.clinic-queue-card__identity {
    min-width: 0;
    flex: 1;
}

.clinic-req-card__name,
.clinic-queue-card__token {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ns-app-navy);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.clinic-queue-card--secondary .clinic-queue-card__token,
.clinic-queue-card--done .clinic-queue-card__token {
    font-size: 1.125rem;
}

.clinic-queue-card__patient {
    margin: 0 0 2px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ns-app-ink);
    line-height: 1.3;
}

.clinic-req-card__meta,
.clinic-queue-card__meta {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ns-app-muted);
    line-height: 1.35;
}

.clinic-queue-card__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 31, 63, 0.08);
}

.clinic-queue-card .ns-app-status {
    flex-shrink: 0;
    margin-top: 2px;
}

.clinic-req-card__row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0 4px;
    font-size: 0.875rem;
}

.clinic-req-card__row dt {
    color: var(--ns-app-muted);
    font-weight: 500;
}

.clinic-req-card__row dd {
    margin: 0;
    font-weight: 600;
    color: var(--ns-app-ink);
    text-align: right;
}

.clinic-app-field {
    margin-bottom: 12px;
}

.clinic-app-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ns-app-muted);
    margin-bottom: 6px;
}

.clinic-app-field .form-control,
.clinic-app-field .form-select {
    min-height: 48px;
    border: 1px solid rgba(0, 31, 63, 0.16);
    border-radius: var(--ns-app-radius-sm);
    font-size: 1rem;
    background-color: #fff;
    box-shadow: none;
}

.clinic-app-splash,
.ns-app-splash {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.clinic-app-splash__logo,
.ns-app-splash__logo {
    display: block;
    width: 168px;
    height: auto;
    max-width: 56vw;
}

.clinic-app-login {
    max-width: 400px;
    margin: 0 auto;
    padding: 32px 16px;
}

.clinic-app-login__card {
    background: #fff;
    border: 1px solid var(--ns-app-line);
    border-radius: var(--ns-app-radius);
    box-shadow: var(--ns-app-shadow);
    padding: 20px;
}

/* Secondary queue actions — looks like a quiet full-width control */
.clinic-actions-more {
    width: 100%;
}

.clinic-actions-more summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: var(--ns-app-radius-sm);
    background: #fff;
    color: var(--ns-app-navy);
    font-weight: 650;
    font-size: 0.875rem;
    user-select: none;
}

.clinic-actions-more summary::-webkit-details-marker {
    display: none;
}

.clinic-actions-more[open] summary {
    margin-bottom: 8px;
    border-color: rgba(25, 147, 141, 0.35);
    color: var(--ns-app-primary-deep);
    background: rgba(25, 147, 141, 0.06);
}

.clinic-actions-more .clinic-queue-card__actions {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (min-width: 768px) {
    body.ns-app,
    body.clinic-app {
        background: #e8eef0;
    }

    .ns-app-shell,
    body.clinic-app .clinic-app-shell {
        box-shadow: 0 0 0 1px var(--ns-app-line), 0 12px 40px rgba(0, 31, 63, 0.08);
        min-height: 100vh;
    }
}

@media (display-mode: standalone) {
    body.ns-app .ns-app-bar,
    body.clinic-app .ns-app-bar {
        padding-top: max(10px, env(safe-area-inset-top));
    }
}
