/* Shared phone and small-tablet adjustments. Loaded after each layout theme. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, video, canvas, svg {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .sidebar {
        width: min(86vw, 310px);
        min-height: 100dvh;
        height: 100dvh;
        overflow-y: auto;
    }

    .sidebar-brand { padding: 1rem; }
    .sidebar-nav { padding-bottom: 1rem; }

    .topbar {
        padding-inline: 0.85rem;
        gap: 0.55rem;
    }

    .topbar-breadcrumb {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .topbar-breadcrumb .page-title {
        font-size: 0.95rem;
    }

    .topbar-actions { gap: 0.45rem; }
    .page-body { padding: 1.1rem 0.9rem; }
    .page-header { margin-bottom: 1.1rem; }
    .page-header h1 { font-size: 1.35rem; }
    .page-header p { font-size: 0.84rem; }
    .panel-card { border-radius: 13px; }
    .panel-card-header { padding: 0.9rem 1rem; }
    .panel-card-body { padding: 1rem; }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .student-hero { padding: 2rem 1rem 3.25rem; }
    .student-stats { gap: 0.65rem; padding-inline: 0.75rem; }
    .stat-pill { padding: 0.6rem 0.9rem; }
    .student-container { padding-inline: 0.9rem; padding-bottom: 2rem; }
}

@media (max-width: 575.98px) {
    .topbar { height: 56px; }
    .topbar-avatar { width: 32px; height: 32px; font-size: 0.76rem; }
    .topbar-actions .btn { padding-inline: 0.55rem; }
    .page-body { padding: 0.85rem 0.7rem; }
    .page-header h1 { font-size: 1.2rem; }
    .page-header p { line-height: 1.35; }
    .panel-card-header { padding: 0.8rem 0.9rem; }
    .panel-card-title { font-size: 0.98rem; }
    .panel-card-body { padding: 0.9rem; }
    .stat-card { padding: 0.95rem; }

    .student-topbar { height: 56px; padding-inline: 0.8rem; }
    .student-topbar-brand { font-size: 0.95rem; gap: 0.4rem; }
    .student-topbar-user { gap: 0.4rem; }
    .student-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
    .student-logout-btn { padding: 5px 8px; font-size: 0; }
    .student-logout-btn .bi { font-size: 1rem; }
    .student-hero-emoji { font-size: 2.6rem; }
    .student-hero-title { font-size: 1.3rem; }
    .student-hero-sub { font-size: 0.86rem; }
    .student-stats { justify-content: stretch; margin-top: -1.1rem; }
    .stat-pill { flex: 1 1 130px; justify-content: center; font-size: 0.78rem; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .story-card-cover { height: 98px; font-size: 2.4rem; }
    .story-card-body { padding: 0.75rem; }
    .story-card-title { font-size: 0.86rem; }
    .story-card-meta { font-size: 0.71rem; }
}

@media (max-width: 359.98px) {
    .story-grid { grid-template-columns: 1fr; }
    .topbar-breadcrumb { display: none; }
}
