/* ============================================================
   Mobile read-only app shell
   ============================================================ */

.mobile-app {
    display: none;
}

@media screen and (max-width: 720px) {
    :root {
        --mobile-blue: #3b82f6;
        --mobile-ink: #172033;
        --mobile-muted: #64748b;
        --mobile-line: #e2e8f0;
        --mobile-soft: #eef2f7;
        --mobile-card: #ffffff;
        --mobile-bg: #f8fafc;
    }

    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        overflow: hidden;
        background: #f1f5f9;
    }

    body {
        display: block;
        padding: 0;
        color: #172033;
    }

    .config-banner,
    .sidebar,
    .container,
    .stats-shell {
        display: none !important;
    }

    .ds-login-wrapper {
        padding: 18px;
    }

    .ds-login-card {
        max-width: 390px;
        padding: 34px 24px;
        border-radius: 12px;
    }

    .mobile-app {
        --mobile-blue: #3b82f6;
        --mobile-ink: #172033;
        --mobile-muted: #64748b;
        --mobile-line: #e2e8f0;
        --mobile-soft: #eef2f7;
        --mobile-card: #ffffff;
        --mobile-bg: #f8fafc;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        width: 100vw;
        max-width: 480px;
        height: 100dvh;
        margin: 0 auto;
        background: var(--mobile-bg);
        box-shadow: 0 0 40px rgba(15, 23, 42, 0.1);
        overflow: hidden;
    }

    .mobile-pull-refresh {
        position: fixed;
        left: 50%;
        top: calc(12px + env(safe-area-inset-top));
        z-index: 20;
        min-width: 104px;
        padding: 8px 12px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.9);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 850;
        line-height: 1;
        text-align: center;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 0);
        transition: opacity 0.16s ease, transform 0.18s ease, background 0.16s ease;
    }

    .mobile-pulling .mobile-pull-refresh,
    .mobile-pull-refresh.refreshing {
        opacity: 1;
    }

    .mobile-pull-refresh.ready,
    .mobile-pull-refresh.refreshing {
        background: #2563eb;
    }

    .mobile-header {
        display: grid;
        grid-template-columns: auto 40px;
        align-items: center;
        column-gap: 10px;
        min-height: 62px;
        padding: calc(16px + env(safe-area-inset-top)) 20px 12px;
        background: var(--mobile-card);
    }

    .mobile-header-month-picker {
        width: auto;
        display: grid;
        grid-template-columns: 32px auto 32px;
        align-items: center;
        justify-items: center;
        gap: 8px;
        justify-self: start;
    }

    .mobile-header h1 {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 34px;
        margin: 0;
        color: #0f172a;
        font-size: 1.16rem;
        font-weight: 900;
        line-height: 34px;
        letter-spacing: 0;
        text-align: center;
        white-space: nowrap;
    }

    .mobile-header-icon {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--mobile-ink);
        line-height: 1;
    }

    .mobile-header-month-picker .mobile-header-icon {
        position: relative;
        font-size: 0;
        overflow: hidden;
    }

    .mobile-header-month-picker .mobile-header-icon::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 10px;
        height: 10px;
        border-left: 3px solid currentColor;
        border-bottom: 3px solid currentColor;
        box-sizing: border-box;
    }

    .mobile-header-month-picker [data-mobile-action="prev-month"]::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-header-month-picker [data-mobile-action="next-month"]::before {
        transform: translate(-50%, -50%) rotate(225deg);
    }

    .mobile-export-btn {
        justify-self: end;
    }

    .mobile-export-btn span {
        display: none;
    }

    .mobile-export-btn svg,
    .mobile-bottom-nav svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-export-btn svg {
        width: 23px;
        height: 23px;
        stroke-width: 2.4;
    }

    .mobile-app:not(.mobile-tab-workbench) .mobile-header {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .mobile-app:not(.mobile-tab-workbench) .mobile-header-month-picker {
        width: 100%;
        grid-template-columns: 1fr;
        justify-self: center;
    }

    .mobile-app:not(.mobile-tab-workbench) .mobile-header-month-picker .mobile-header-icon,
    .mobile-app:not(.mobile-tab-workbench) .mobile-header .mobile-export-btn {
        display: none;
    }

    .mobile-main {
        min-height: 0;
        background: var(--mobile-bg);
        overflow: hidden;
    }

    .mobile-tab-panel {
        display: none;
        height: 100%;
        min-height: 0;
        overflow-y: auto;
    }

    .mobile-tab-panel.active {
        display: block;
    }

    .mobile-tab-panel[data-mobile-panel="workbench"].active {
        display: flex;
        flex-direction: column;
        background: var(--mobile-card);
        overflow: hidden;
    }

    .mobile-view-switch {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        margin: 12px 20px 10px;
        padding: 4px;
        border-radius: 999px;
        background: var(--mobile-soft);
    }

    .mobile-view-switch button {
        min-height: 42px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #52637a;
        font-size: 0.86rem;
        font-weight: 900;
    }

    .mobile-view-switch button.active {
        background: var(--mobile-card);
        color: #0f172a;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    }

    .mobile-student-filters {
        flex: 0 0 auto;
        display: flex;
        gap: 12px;
        padding: 12px 20px;
        border-bottom: 1px solid var(--mobile-line);
        background: var(--mobile-card);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mobile-student-filters::-webkit-scrollbar,
    .mobile-week-strip::-webkit-scrollbar,
    .global-modal-nav::-webkit-scrollbar {
        display: none;
    }

    .mobile-filter-chip {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 6px 12px;
        border: 1px solid var(--mobile-line);
        border-radius: 20px;
        background: #f8fafc;
        color: #64748b;
        font-size: 0.85rem;
        font-weight: 600;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .mobile-filter-chip.active {
        border-color: var(--student-color);
        background: var(--student-color);
        color: #ffffff;
    }

    .mobile-filter-avatar,
    .mobile-avatar {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
        border-radius: 0;
        display: block;
        object-fit: contain;
        object-position: center bottom;
        background-color: transparent;
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center bottom;
    }

    .mobile-filter-chip strong {
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
    }

    .mobile-workbench-view {
        display: none;
        min-height: 0;
    }

    .mobile-show-week .mobile-week-view,
    .mobile-show-month .mobile-month-view {
        display: flex;
    }

    .mobile-week-view {
        flex: 1 1 auto;
        flex-direction: column;
        gap: 0;
        padding: 12px 20px 0;
        background: var(--mobile-bg);
        overflow: hidden;
    }

    .mobile-week-strip {
        flex: 0 0 auto;
        display: flex;
        gap: 0;
        width: 100%;
        margin: 0 0 10px;
        padding: 2px 0 10px;
        background: var(--mobile-bg);
        box-shadow: 0 1px 0 rgba(226, 232, 240, 0.9);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

    .mobile-week-page {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
        padding: 0 1px;
        box-sizing: border-box;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .mobile-week-day {
        min-width: 0;
        min-height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 5px 2px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: var(--mobile-muted);
    }

    .mobile-week-day.active {
        border-color: var(--mobile-blue);
        background: #eff6ff;
        color: #1d4ed8;
    }

    .mobile-week-day.out-month {
        opacity: 0.38;
    }

    .mobile-week-day span {
        font-size: 0.64rem;
        font-weight: 800;
    }

    .mobile-week-day strong {
        color: var(--mobile-ink);
        font-size: 0.94rem;
        font-weight: 900;
        line-height: 1;
    }

    .mobile-week-day small {
        display: flex;
        justify-content: center;
        gap: 2px;
        min-height: 5px;
        line-height: 1;
    }

    .mobile-week-day small span {
        width: 5px;
        height: 5px;
        border-radius: 999px;
    }

    .mobile-week-view > .mobile-day-head {
        display: none;
    }

    .mobile-timeline-scroller {
        flex: 1 1 auto;
        min-height: 0;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scroll-behavior: smooth;
        background:
            linear-gradient(var(--mobile-bg) 20%, rgba(248, 250, 252, 0)) center top,
            linear-gradient(rgba(248, 250, 252, 0), var(--mobile-bg) 80%) center bottom,
            radial-gradient(farthest-side at 50% 0, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) center top,
            radial-gradient(farthest-side at 50% 100%, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) center bottom,
            var(--mobile-bg);
        background-repeat: no-repeat;
        background-size: 100% 32px, 100% 32px, 100% 14px, 100% 14px, 100% 100%;
        background-attachment: local, local, scroll, scroll, scroll;
    }

    .mobile-timeline {
        position: relative;
        width: 100%;
        min-height: 480px;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
        padding: 8px 8px 12px 0;
        border: 1px solid var(--mobile-line);
        border-radius: 8px;
        background: var(--mobile-card);
        box-sizing: border-box;
        transition: box-shadow 0.18s ease, transform 0.18s ease;
    }

    .mobile-week-scrolling .mobile-timeline {
        transform: translateY(-1px);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.11);
    }

    .mobile-time-axis,
    .mobile-time-lane {
        position: relative;
        min-height: 452px;
    }

    .mobile-time-axis {
        border-right: 1px solid var(--mobile-line);
    }

    .mobile-time-mark {
        position: absolute;
        right: 8px;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 0.6rem;
        font-weight: 750;
    }

    .mobile-time-lane::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(to bottom, transparent calc(12.5% - 1px), #f1f5f9 calc(12.5% - 1px), #f1f5f9 12.5%, transparent 12.5%);
        background-size: 100% 12.5%;
        pointer-events: none;
    }

    .mobile-timeline-event {
        position: absolute;
        left: 0;
        right: 0;
        min-height: 38px;
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 5px 8px;
        border: 1px solid color-mix(in srgb, var(--student-color) 34%, #ffffff);
        border-left: 4px solid var(--student-color);
        border-radius: 8px;
        background: color-mix(in srgb, var(--student-color) 11%, #ffffff);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
        overflow: hidden;
    }

    .mobile-timeline-time {
        color: var(--student-color);
        font-size: 0.66rem;
        font-weight: 900;
        line-height: 1.18;
    }

    .mobile-timeline-time strong,
    .mobile-timeline-time span {
        display: block;
    }

    .mobile-timeline-main strong,
    .mobile-agenda-info strong {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        color: var(--mobile-ink);
        font-size: 0.9rem;
        font-weight: 950;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-timeline-main strong {
        gap: 6px;
        font-size: 0.82rem;
    }

    .mobile-timeline-main span,
    .mobile-agenda-info span {
        display: inline-block;
        margin-top: 7px;
        padding: 5px 8px;
        border-radius: 5px;
        background: var(--mobile-soft);
        color: #52637a;
        font-size: 0.68rem;
        font-weight: 850;
    }

    .mobile-timeline-main span {
        margin-top: 4px;
        padding: 3px 6px;
        font-size: 0.62rem;
    }

    .mobile-timeline-main .mobile-avatar {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    .mobile-timeline-empty,
    .mobile-empty-state {
        position: static;
        padding: 18px;
        border: 1px dashed var(--mobile-line);
        border-radius: 8px;
        background: var(--mobile-card);
        color: var(--mobile-muted);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
        font-size: 0.84rem;
        font-weight: 850;
        text-align: center;
    }

    .mobile-timeline-empty {
        position: absolute;
        left: 10px;
        right: 10px;
        top: 42%;
    }

    .mobile-month-view {
        flex: 1 1 auto;
        flex-direction: column;
        padding: 12px 14px 0;
        background: var(--mobile-bg);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-month-view::after {
        content: "";
        flex: 0 0 auto;
        display: block;
        height: calc(96px + env(safe-area-inset-bottom));
    }

    .mobile-month-card,
    .mobile-agenda-card {
        border-radius: 8px;
        background: var(--mobile-card);
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
    }

    .mobile-month-card {
        padding: 14px 10px 10px;
    }

    .mobile-month-head {
        display: grid;
        grid-template-columns: 32px 1fr 32px;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mobile-month-head strong {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        color: var(--mobile-ink);
        font-size: 1rem;
        font-weight: 900;
        line-height: 32px;
        text-align: center;
    }

    .mobile-month-head button {
        width: 32px;
        height: 32px;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border: 1px solid var(--mobile-line);
        border-radius: 8px;
        background: var(--mobile-card);
        color: var(--mobile-ink);
        font-size: 1.2rem;
        font-weight: 800;
        line-height: 1;
    }

    .mobile-month-weekdays,
    .mobile-month-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 5px;
    }

    .mobile-month-weekdays {
        margin-bottom: 7px;
        color: var(--mobile-muted);
        font-size: 0.66rem;
        font-weight: 850;
        text-align: center;
    }

    .mobile-month-grid {
        grid-auto-rows: minmax(52px, auto);
        row-gap: 6px;
    }

    .mobile-month-day {
        min-width: 0;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 3px;
        padding: 5px 1px 4px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: var(--mobile-ink);
    }

    .mobile-month-day.active {
        border-color: var(--mobile-blue);
        background: #eff6ff;
    }

    .mobile-month-blank {
        visibility: hidden;
    }

    .mobile-month-day strong {
        flex: 0 0 auto;
        font-size: 0.8rem;
        font-weight: 900;
        line-height: 1;
    }

    .mobile-month-dots {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-height: 12px;
    }

    .mobile-month-pill {
        width: 96%;
        max-width: 96%;
        height: 12px;
        min-height: 12px;
        padding: 0 2px;
        border-radius: 3px;
        color: #ffffff;
        font-size: 6.9px;
        font-weight: 800;
        line-height: 12px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    .mobile-month-pill.compact {
        font-size: 6.6px;
        font-weight: 850;
    }

    .mobile-month-pill.tiny {
        font-size: 6.3px;
    }

    .mobile-month-more {
        color: var(--mobile-muted);
        font-size: 0.58rem;
        font-weight: 900;
        line-height: 1;
    }

    .mobile-agenda-card {
        flex: 0 0 auto;
        margin-top: 12px;
        padding: 18px 12px;
        background: var(--mobile-bg);
        box-shadow: none;
    }

    .mobile-day-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 12px;
        margin: 0 0 10px;
    }

    .mobile-day-head strong,
    .mobile-section-title {
        display: block;
        color: var(--mobile-ink);
        font-size: 0.98rem;
        font-weight: 950;
        letter-spacing: 0;
    }

    .mobile-day-head small {
        color: var(--mobile-muted);
        font-size: 0.72rem;
        font-weight: 850;
    }

    .mobile-agenda-list,
    .mobile-card-list,
    .mobile-sync-mini-log {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-agenda-item {
        display: grid;
        grid-template-columns: 72px 2px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        min-height: 68px;
        padding: 12px 14px;
        border: 1px solid #edf2f7;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .mobile-agenda-item.completed,
    .mobile-timeline-event.completed {
        opacity: 0.58;
        filter: saturate(0.72);
        background: color-mix(in srgb, var(--student-color) 6%, #f8fafc);
    }

    .mobile-agenda-item.completed .mobile-agenda-divider {
        opacity: 0.42;
    }

    .mobile-month-pill.completed {
        opacity: 0.54;
        filter: saturate(0.7);
    }

    .mobile-agenda-time {
        color: var(--student-color);
        font-weight: 900;
        line-height: 1.12;
        text-align: right;
    }

    .mobile-agenda-time strong,
    .mobile-agenda-time span {
        display: block;
    }

    .mobile-agenda-time strong {
        font-size: 0.92rem;
        letter-spacing: 0;
    }

    .mobile-agenda-time span {
        margin-top: 7px;
        color: color-mix(in srgb, var(--student-color) 62%, #64748b);
        font-size: 0.72rem;
        font-weight: 750;
    }

    .mobile-agenda-divider {
        width: 2px;
        height: 52px;
        border-radius: 99px;
        background: var(--student-color);
        opacity: 0.9;
    }

    .mobile-tab-panel[data-mobile-panel="stats"],
    .mobile-tab-panel[data-mobile-panel="mine"] {
        padding: 18px 14px calc(92px + env(safe-area-inset-bottom));
        background: var(--mobile-bg);
        -webkit-overflow-scrolling: touch;
    }

    .mobile-tab-panel[data-mobile-panel="stats"] .mobile-card-list {
        gap: 14px;
    }

    .mobile-tab-panel[data-mobile-panel="stats"] #mobileHourCards {
        gap: 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035);
    }

    .mobile-section-title {
        margin: 8px 0 14px;
    }

    .mobile-tuition-card {
        position: relative;
        height: 86px;
        overflow: hidden;
        border: 1px solid #f1f5f9;
        border-radius: 12px;
        background: var(--mobile-card);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
    }

    .mobile-tuition-fill {
        position: absolute;
        inset: 0 auto 0 0;
        width: var(--progress);
        background: var(--student-color);
        min-width: 0;
    }

    .mobile-tuition-card[style*="--progress:0%"] .mobile-tuition-fill {
        width: 0;
    }

    .mobile-tuition-layer {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 18px;
    }

    .mobile-tuition-base {
        z-index: 1;
        color: var(--mobile-ink);
    }

    .mobile-tuition-contrast {
        z-index: 2;
        color: #ffffff;
        clip-path: inset(0 calc(100% - var(--progress)) 0 0);
        pointer-events: none;
    }

    .mobile-tuition-card strong,
    .mobile-tuition-card span,
    .mobile-tuition-card b {
        display: block;
    }

    .mobile-tuition-card strong {
        font-size: 0.98rem;
        font-weight: 950;
        line-height: 1.08;
        white-space: nowrap;
    }

    .mobile-tuition-card span {
        margin-top: 7px;
        font-size: 0.72rem;
        font-weight: 850;
        line-height: 1.16;
        opacity: 0.9;
    }

    .mobile-tuition-card b {
        font-size: 1.42rem;
        font-weight: 950;
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-hour-row {
        width: 100%;
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 24px;
        border: 0;
        border-bottom: 1px solid var(--mobile-line);
        background: var(--mobile-card);
        color: var(--mobile-ink);
        font-size: 0.9rem;
        font-weight: 900;
    }

    .mobile-hour-row:first-child {
        border-radius: 12px 12px 0 0;
    }

    .mobile-hour-row:last-child {
        border-bottom: 0;
        border-radius: 0 0 12px 12px;
    }

    .mobile-hour-row strong {
        color: var(--student-color);
        font-size: 0.94rem;
    }

    .mobile-hour-row span {
        color: var(--mobile-ink);
        font-size: 0.94rem;
        font-weight: 950;
    }

    .mobile-mine-profile,
    .mobile-mine-status,
    .mobile-settings-log-card {
        border-radius: 8px;
        background: var(--mobile-card);
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
    }

    .mobile-mine-profile {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px;
    }

    .mobile-mine-avatar {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border-radius: 16px;
        background: #dbeafe;
        color: #1d4ed8;
        font-size: 1.1rem;
        font-weight: 950;
    }

    .mobile-mine-info strong,
    .mobile-mine-status strong {
        display: block;
        color: var(--mobile-ink);
        font-size: 0.95rem;
        font-weight: 950;
        line-height: 1.25;
    }

    .mobile-mine-info span,
    .mobile-mine-status span {
        display: block;
        margin-top: 5px;
        color: var(--mobile-muted);
        font-size: 0.74rem;
        font-weight: 750;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .mobile-settings-log-card {
        margin-top: 12px;
        border: 1px solid #e5e7eb;
        overflow: hidden;
    }

    .mobile-settings-log-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 5px;
        background: #f1f5f9;
        border-bottom: 1px solid #e5e7eb;
    }

    .mobile-settings-log-tabs button {
        min-width: 0;
        min-height: 34px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0;
    }

    .mobile-settings-log-tabs button.active {
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
    }

    .mobile-settings-log-list {
        background: #ffffff;
    }

    .mobile-settings-log-row {
        padding: 12px 14px;
        border-top: 1px solid #eef2f7;
    }

    .mobile-settings-log-row:first-child {
        border-top: 0;
    }

    .mobile-settings-log-head {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .mobile-settings-log-head span {
        color: #334155;
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1.2;
        white-space: nowrap;
    }

    .mobile-settings-log-head b {
        flex: 0 0 auto;
        padding: 2px 7px;
        border-radius: 999px;
        background: #e6f4ea;
        color: #137333;
        font-size: 0.64rem;
        font-weight: 900;
        line-height: 1.45;
    }

    .mobile-settings-log-row.is-error .mobile-settings-log-head b {
        background: #fee2e2;
        color: #b91c1c;
    }

    .mobile-settings-log-row p {
        margin: 7px 0 0;
        color: #334155;
        font-size: 0.76rem;
        font-weight: 760;
        line-height: 1.42;
        overflow-wrap: anywhere;
    }

    .mobile-settings-log-empty {
        padding: 18px 14px;
        color: #94a3b8;
        font-size: 0.76rem;
        font-weight: 850;
        text-align: center;
    }

    .mobile-version-stamp {
        margin: 14px 0 0;
        color: #94a3b8;
        font-size: 0.68rem;
        font-weight: 800;
        text-align: center;
    }

    .mobile-mine-account {
        width: 100%;
        border: 0;
        text-align: left;
    }

    .mobile-mine-account i {
        width: 9px;
        height: 9px;
        margin-left: auto;
        border-right: 2px solid #cbd5e1;
        border-bottom: 2px solid #cbd5e1;
        transform: rotate(-45deg);
    }

    .mobile-mine-status {
        margin-top: 10px;
        padding: 14px 16px;
    }

    .mobile-settings-list {
        margin: 12px 0 18px;
        border-radius: 8px;
        background: var(--mobile-card);
        overflow: hidden;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
    }

    .mobile-settings-list button {
        width: 100%;
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 18px;
        border: 0;
        border-bottom: 1px solid var(--mobile-line);
        background: var(--mobile-card);
        color: var(--mobile-ink);
        font-size: 0.9rem;
        font-weight: 900;
        text-align: left;
    }

    .mobile-settings-list button:last-child {
        border-bottom: 0;
    }

    .mobile-settings-list i {
        width: 8px;
        height: 8px;
        border-right: 2px solid #cbd5e1;
        border-bottom: 2px solid #cbd5e1;
        transform: rotate(-45deg);
    }

    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--mobile-line);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.06);
    }

    .mobile-bottom-nav button {
        min-width: 0;
        min-height: 44px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--mobile-muted);
        font-size: 0.68rem;
        font-weight: 850;
    }

    .mobile-bottom-nav svg {
        width: 20px;
        height: 20px;
        display: block;
        margin: 0 auto 3px;
        stroke-width: 2;
    }

    .mobile-bottom-nav button.active {
        background: #eff6ff;
        color: var(--mobile-blue);
    }

    #toast {
        top: auto;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: calc(100vw - 36px);
        min-width: 0;
        border-radius: 8px;
        font-size: 0.82rem;
    }

    #toast.show {
        top: auto;
    }

    .modal-overlay.active,
    .mobile-app ~ .modal-overlay.active,
    body:has(.mobile-app) .modal-overlay.active {
        align-items: stretch;
        justify-content: center;
        padding: 0;
        z-index: 900;
        background: rgba(15, 23, 42, 0.48);
    }

    .global-settings-modal,
    .student-settings-modal {
        width: 100vw !important;
        max-width: 480px !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: var(--mobile-bg) !important;
        overflow: hidden !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .global-modal-header,
    .student-settings-modal > h3 {
        flex: 0 0 auto !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: calc(18px + env(safe-area-inset-top)) 20px 14px !important;
        border-bottom: 1px solid var(--mobile-line) !important;
        background: var(--mobile-card) !important;
    }

    .global-modal-header h3,
    .student-settings-modal > h3 {
        font-size: 1.2rem !important;
        line-height: 1.15 !important;
    }

    .global-modal-header {
        align-items: flex-start !important;
    }

    .global-modal-header p {
        max-width: 280px !important;
        margin-top: 8px !important;
        font-size: 0.78rem !important;
        line-height: 1.35 !important;
    }

    .global-modal-body {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .global-modal-nav {
        width: 100% !important;
        flex: 0 0 auto !important;
        display: flex !important;
        gap: 8px !important;
        padding: 12px 14px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--mobile-line) !important;
        background: var(--mobile-card) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
    }

    .global-modal-nav button {
        flex: 0 0 auto !important;
        min-width: 118px !important;
        min-height: 42px !important;
        padding: 8px 10px !important;
        border-radius: 999px !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    .global-modal-content,
    .student-settings-modal .student-editor {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 18px 18px calc(92px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background: var(--mobile-bg) !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
    }

    .global-tab-pane.active {
        display: block !important;
        min-height: 100%;
    }

    .student-settings-modal .student-editor {
        padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
    }

    .student-settings-modal .modal-actions {
        position: fixed !important;
        left: 50% !important;
        bottom: 0 !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        max-width: 480px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid var(--mobile-line) !important;
        background: rgba(255, 255, 255, 0.96) !important;
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08) !important;
        z-index: 2 !important;
    }

    .student-settings-modal .modal-actions [data-action="add-student"] {
        display: none !important;
    }

    .student-settings-modal .modal-actions button {
        min-height: 48px !important;
        border-radius: 0 !important;
        font-size: 0.94rem !important;
    }

    .setting-group,
    .cloud-account-panel,
    .danger-setting-group,
    .profile-options-panel {
        padding: 14px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    .student-settings-modal .student-master-detail {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .student-editor-nav {
        width: 100% !important;
        position: static !important;
    }

    .student-nav-list {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
    }

    .student-nav-item {
        flex: 0 0 150px !important;
    }

    .student-detail-card {
        min-width: 0 !important;
        padding: 14px !important;
    }

    .student-detail-card .student-card-head {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .student-detail-card .student-form-title,
    .student-detail-card .student-status-toggle {
        min-width: 0 !important;
    }

    .student-form-grid,
    .profile-options-grid,
    .settings-action-grid,
    .global-settings-modal .btns-2x2 {
        grid-template-columns: 1fr !important;
    }

    .global-settings-modal button,
    .global-settings-modal input,
    .global-settings-modal select,
    .student-settings-modal button,
    .student-settings-modal input,
    .student-settings-modal select {
        max-width: 100% !important;
    }

    .mobile-student-manager {
        position: fixed;
        inset: 0;
        z-index: 950;
        display: none;
        justify-content: center;
        background: rgba(15, 23, 42, 0.46);
    }

    .mobile-student-manager.active {
        display: flex;
    }

    .mobile-student-page {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100vw;
        max-width: 480px;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        background: var(--mobile-bg);
        box-shadow: 0 0 34px rgba(15, 23, 42, 0.18);
        transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
        will-change: transform;
    }

    .mobile-student-list-page {
        transform: translateX(100%);
    }

    .mobile-student-manager.active .mobile-student-list-page {
        transform: translateX(0);
    }

    .mobile-student-edit-page {
        grid-template-rows: auto minmax(0, 1fr) auto;
        transform: translateX(100%);
    }

    .mobile-student-manager.is-editing .mobile-student-list-page {
        transform: translateX(-24%);
    }

    .mobile-student-manager.is-editing .mobile-student-edit-page {
        transform: translateX(0);
    }

    .mobile-subpage-header {
        min-height: 68px;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
        border-bottom: 1px solid var(--mobile-line);
        background: rgba(255, 255, 255, 0.98);
    }

    .mobile-subpage-back {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 10px;
        background: #eef2f7;
        color: var(--mobile-ink);
        font-size: 2rem;
        line-height: 1;
    }

    .mobile-subpage-header strong,
    .mobile-subpage-header span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-subpage-header strong {
        color: var(--mobile-ink);
        font-size: 1.05rem;
        font-weight: 950;
        line-height: 1.2;
    }

    .mobile-subpage-header span {
        margin-top: 3px;
        color: var(--mobile-muted);
        font-size: 0.72rem;
        font-weight: 750;
    }

    .mobile-subpage-scroll {
        min-height: 0;
        padding: 14px 14px calc(94px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }

    .mobile-student-add {
        width: 100%;
        min-height: 50px;
        margin-bottom: 12px;
        border: 1px dashed #93a4b8;
        border-radius: 8px;
        background: #fff;
        color: #172033;
        font-size: 0.92rem;
        font-weight: 900;
    }

    .mobile-student-card-list {
        display: flex;
        flex-direction: column;
        gap: 9px;
    }

    .mobile-student-card {
        width: 100%;
        min-height: 72px;
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto 12px;
        align-items: center;
        gap: 11px;
        padding: 12px;
        border: 1px solid color-mix(in srgb, var(--student-color) 26%, #e2e8f0);
        border-left: 5px solid var(--student-color);
        border-radius: 8px;
        background: #fff;
        color: var(--mobile-ink);
        text-align: left;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
    }

    .mobile-student-card.is-disabled {
        opacity: 0.58;
    }

    .mobile-student-avatar {
        width: 32px;
        height: 36px;
        object-fit: contain;
        object-position: center bottom;
    }

    .mobile-student-card-main {
        min-width: 0;
    }

    .mobile-student-card-main strong,
    .mobile-student-card-main small,
    .mobile-student-card em {
        display: block;
    }

    .mobile-student-card-main strong {
        color: var(--mobile-ink);
        font-size: 0.94rem;
        font-weight: 950;
        line-height: 1.15;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-student-card-main small {
        margin-top: 4px;
        color: var(--mobile-muted);
        font-size: 0.72rem;
        font-weight: 750;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-student-card em {
        padding: 4px 7px;
        border-radius: 999px;
        background: #d1fae5;
        color: #047857;
        font-size: 0.64rem;
        font-style: normal;
        font-weight: 900;
        white-space: nowrap;
    }

    .mobile-student-card.is-disabled em {
        background: #e2e8f0;
        color: #64748b;
    }

    .mobile-student-card i {
        width: 9px;
        height: 9px;
        border-right: 2px solid #cbd5e1;
        border-bottom: 2px solid #cbd5e1;
        transform: rotate(-45deg);
    }

    .mobile-student-form-scroll {
        padding-bottom: calc(108px + env(safe-area-inset-bottom));
    }

    .mobile-student-form-section {
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--mobile-line);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.045);
    }

    .mobile-student-form-section h4 {
        margin: 0 0 12px;
        color: var(--mobile-ink);
        font-size: 0.92rem;
        font-weight: 950;
    }

    .mobile-student-hero {
        display: grid;
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 12px;
        align-items: end;
        margin-bottom: 13px;
    }

    .mobile-student-hero-avatar {
        width: 50px;
        height: 58px;
        object-fit: contain;
        object-position: center bottom;
        filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--student-color) 22%, transparent));
    }

    .mobile-form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mobile-student-form-section label,
    .mobile-field-block {
        display: flex;
        flex-direction: column;
        gap: 7px;
        color: var(--mobile-muted);
        font-size: 0.72rem;
        font-weight: 850;
    }

    .mobile-student-form-section input,
    .mobile-student-form-section select {
        width: 100%;
        min-height: 42px;
        padding: 0 11px;
        border: 1px solid #d7e0ea;
        border-radius: 8px;
        background: #f8fafc;
        color: var(--mobile-ink);
        font-size: 0.92rem;
        font-weight: 800;
    }

    .mobile-student-switch {
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        margin-bottom: 13px;
        padding: 0 12px;
        border-radius: 8px;
        background: #f8fafc;
    }

    .mobile-student-switch input {
        width: 22px;
        min-height: 22px;
        padding: 0;
    }

    .mobile-avatar-choices,
    .mobile-color-row {
        display: flex;
        gap: 9px;
        align-items: center;
        margin: -4px -4px 0;
        padding: 5px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mobile-avatar-choices::-webkit-scrollbar,
    .mobile-color-row::-webkit-scrollbar {
        display: none;
    }

    .mobile-avatar-choices button {
        flex: 0 0 96px;
        min-height: 78px;
        display: grid;
        grid-template-rows: 38px auto;
        justify-items: center;
        align-items: center;
        padding: 8px;
        border: 1px solid var(--mobile-line);
        border-radius: 8px;
        background: #f8fafc;
        color: var(--mobile-ink);
        font-size: 0.76rem;
        font-weight: 900;
    }

    .mobile-avatar-choices button.active {
        border-color: #3b82f6;
        background: #eff6ff;
        color: #1d4ed8;
    }

    .mobile-avatar-upload {
        display: grid;
        gap: 7px;
        margin-top: 9px;
    }

    .mobile-avatar-upload label,
    .mobile-avatar-upload button {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--mobile-line);
        border-radius: 8px;
        background: #ffffff;
        color: #2563eb;
        font-size: 0.82rem;
        font-weight: 900;
    }

    .mobile-avatar-upload input {
        display: none;
    }

    .mobile-avatar-upload button {
        color: #64748b;
    }

    .mobile-avatar-upload small {
        color: var(--mobile-muted);
        font-size: 0.74rem;
        font-weight: 750;
    }

    .mobile-color-dot {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        margin: 3px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: var(--dot);
        box-shadow: 0 0 0 1px #cbd5e1;
    }

    .mobile-color-dot.active {
        box-shadow: 0 0 0 3px #1d4ed8;
    }

    .mobile-color-row input[type="color"] {
        width: 46px;
        min-height: 34px;
        flex: 0 0 46px;
        padding: 2px;
    }

    .mobile-student-delete {
        width: 100%;
        min-height: 44px;
        margin-top: 14px;
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fff5f5;
        color: #b91c1c;
        font-size: 0.86rem;
        font-weight: 900;
    }

    .mobile-student-bottom {
        position: sticky;
        bottom: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--mobile-line);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
    }

    .mobile-student-bottom button {
        min-height: 48px;
        border: 0;
        border-radius: 8px;
        color: #fff;
        font-size: 0.94rem;
        font-weight: 950;
    }

    .mobile-rules-manager {
        position: fixed;
        inset: 0;
        z-index: 940;
        display: none;
        justify-content: center;
        background: rgba(15, 23, 42, 0.46);
    }

    .mobile-rules-manager.active {
        display: flex;
    }

    .mobile-rules-page {
        width: 100vw;
        max-width: 480px;
        height: 100dvh;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        background: #f4f7fb;
        color: #0f1f35;
        box-shadow: 0 0 34px rgba(15, 23, 42, 0.18);
    }

    .mobile-rules-header {
        min-height: 76px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: calc(15px + env(safe-area-inset-top)) 26px 15px;
        border-bottom: 1px solid #dbe3ee;
        background: #ffffff;
    }

    .mobile-rules-back {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #142033;
        font-size: 2.2rem;
        font-weight: 800;
        line-height: 1;
    }

    .mobile-rules-header h2 {
        margin: 0;
        color: #0f1f35;
        font-size: 1.28rem;
        font-weight: 950;
        letter-spacing: 0;
        line-height: 1.1;
        text-align: left;
    }

    .mobile-rules-scroll {
        min-height: 0;
        padding: 22px 24px calc(80px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }

    .mobile-account-scroll {
        padding: 18px 16px calc(30px + env(safe-area-inset-bottom));
    }

    .mobile-account-signout {
        width: 100%;
        min-height: 56px;
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #ffffff;
        color: #b91c1c;
        font-size: 0.95rem;
        font-weight: 950;
        letter-spacing: 0;
    }

    .mobile-rules-card {
        margin-bottom: 20px;
        padding: 22px 20px;
        border: 1px solid #dbe3ee;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }

    .mobile-rules-card h3 {
        margin: 0 0 14px;
        color: #102033;
        font-size: 1.02rem;
        font-weight: 950;
        letter-spacing: 0;
        line-height: 1.15;
    }

    .mobile-rules-card p {
        margin: 0 0 18px;
        color: #60728d;
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1.5;
    }

    .mobile-rules-action-grid,
    .mobile-rules-student-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .mobile-rules-action-grid button,
    .mobile-rules-student-btn {
        min-width: 0;
        min-height: 48px;
        border: 1px solid #dbe3ee;
        border-radius: 8px;
        background: #ffffff;
        color: #050b16;
        font-size: 0.82rem;
        font-weight: 850;
        line-height: 1.2;
        text-align: center;
    }

    .mobile-rules-lock {
        width: 100%;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        margin-top: 14px;
        padding: 0 12px;
        border: 1px solid #8bf0c2;
        border-radius: 8px;
        background: #e9fff5;
        color: #00604f;
        font-size: 0.82rem;
        font-weight: 850;
        line-height: 1.25;
        text-align: center;
    }

    .mobile-rules-lock.unlocked {
        border-color: #fecaca;
        background: #fff5f5;
        color: #a82121;
    }

    .mobile-lock-icon {
        flex: 0 0 auto;
        min-width: 18px;
        font-size: 0.86rem;
    }

    .mobile-rules-student-btn {
        border-left: 4px solid var(--student-color);
        padding: 0 8px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .share-card-offscreen {
        position: absolute;
        left: -9999px;
        top: 0;
        width: 480px;
        pointer-events: none;
    }

    .share-card-offscreen,
    .share-card-offscreen * {
        box-sizing: border-box;
    }

    .mobile-share-card {
        width: 480px;
        padding: 22px;
        background: #f8fafc;
        color: #172033;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .share-card-header {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) 68px;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .share-card-avatar {
        width: 58px;
        height: 58px;
        border-radius: 50%;
        object-fit: cover;
        background: #e2e8f0;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    }

    .share-card-title {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .share-card-title strong {
        color: #0f172a;
        font-size: 24px;
        font-weight: 950;
        line-height: 1.05;
    }

    .share-card-title span {
        color: #475569;
        font-size: 14px;
        font-weight: 850;
        line-height: 1.1;
    }

    .share-card-title small {
        color: #64748b;
        font-size: 11px;
        font-weight: 750;
        line-height: 1.1;
    }

    .share-card-summary {
        min-height: 56px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .share-card-summary b {
        color: #0f172a;
        font-size: 24px;
        font-weight: 950;
        line-height: 1;
    }

    .share-card-summary span {
        margin-top: 4px;
        color: #64748b;
        font-size: 9px;
        font-weight: 850;
        line-height: 1;
    }

    .share-card-meta {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
    }

    .share-calendar-panel {
        padding: 16px 14px 14px;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
    }

    .share-weekdays,
    .share-calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
    }

    .share-weekdays {
        margin-bottom: 8px;
        color: #94a3b8;
        font-size: 10px;
        font-weight: 900;
        text-align: center;
    }

    .share-day-cell {
        height: 68px;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 7px 4px 5px;
        border-radius: 10px;
        background: #f8fafc;
        overflow: hidden;
    }

    .share-day-cell.active-day {
        background: #f1f5f9;
    }

    .share-day-blank {
        background: transparent;
    }

    .share-day-date {
        flex: 0 0 auto;
        color: #172033;
        font-size: 13px;
        font-weight: 950;
        line-height: 1;
    }

    .share-day-slots {
        width: 100%;
        height: 38px;
        display: grid;
        grid-template-rows: 1fr 1fr;
        gap: 3px;
        margin-top: 6px;
    }

    .share-slot {
        min-width: 0;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .share-event-pill {
        width: 100%;
        height: 16px;
        border-radius: 999px;
        background: var(--event-color);
        color: #ffffff;
        font-size: 8.5px;
        font-weight: 950;
        line-height: 16px;
        text-align: center;
        white-space: nowrap;
    }

    .share-event-pill.completed {
        opacity: 0.56;
        filter: saturate(0.72);
    }

    .mobile-share-modal {
        position: fixed;
        inset: 0;
        z-index: 1200;
        display: none;
        align-items: center;
        justify-content: center;
        padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
        background: rgba(15, 23, 42, 0.56);
    }

    .mobile-share-modal.active {
        display: flex;
    }

    .mobile-share-modal-panel {
        width: min(100%, 430px);
        max-height: 92dvh;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 12px;
        padding: 14px;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
        overflow: auto;
    }

    .mobile-share-modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-share-modal-head strong {
        color: #0f172a;
        font-size: 1rem;
        font-weight: 950;
        line-height: 1;
    }

    .mobile-share-modal-head button {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 50%;
        background: #f1f5f9;
        color: #172033;
        font-size: 1.35rem;
        font-weight: 500;
        line-height: 34px;
    }

    .mobile-share-loader {
        min-height: 280px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: #f8fafc;
        color: #64748b;
        font-size: 0.9rem;
        font-weight: 850;
    }

    .mobile-share-loader[hidden],
    #mobileShareRenderedImg[hidden] {
        display: none;
    }

    #mobileShareRenderedImg {
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
        background: #f8fafc;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    .mobile-share-modal-panel p {
        margin: 0;
        color: #64748b;
        font-size: 0.8rem;
        font-weight: 800;
        text-align: center;
    }

    .mobile-overview-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 28px;
    }

    .mobile-stats-range {
        border: 1px solid #edf2f7;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
        overflow: hidden;
    }

    .mobile-stats-range-head {
        width: 100%;
        min-height: 48px;
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr) auto 14px;
        align-items: center;
        gap: 8px;
        border: 0;
        background: transparent;
        padding: 0 14px;
        color: var(--mobile-ink);
        text-align: left;
    }

    .mobile-stats-range-head span {
        min-width: 0;
        color: var(--mobile-ink);
        font-size: 0.82rem;
        font-weight: 900;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-stats-range-head strong {
        color: var(--mobile-blue);
        font-weight: 950;
    }

    .mobile-stats-range-head em {
        color: #94a3b8;
        font-size: 0.72rem;
        font-style: normal;
        font-weight: 850;
        white-space: nowrap;
    }

    .mobile-stats-range-icon {
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--mobile-blue);
    }

    .mobile-stats-range-icon svg,
    .mobile-stats-range-chevron {
        width: 100%;
        height: 100%;
    }

    .mobile-stats-range-chevron {
        color: #94a3b8;
        transition: transform 0.18s ease;
    }

    .mobile-stats-range.open .mobile-stats-range-chevron {
        transform: rotate(180deg);
    }

    .mobile-stats-range-body {
        display: none;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 14px 14px;
        border-top: 1px solid #f1f5f9;
    }

    .mobile-stats-range.open .mobile-stats-range-body {
        display: grid;
    }

    .mobile-stats-range-body label,
    .mobile-bill-tools label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
    }

    .mobile-stats-range-body label span,
    .mobile-bill-tools label span {
        color: var(--mobile-muted);
        font-size: 0.72rem;
        font-weight: 850;
    }

    .mobile-stats-range-body select,
    .mobile-stats-range-body input,
    .mobile-bill-tools select {
        min-width: 0;
        width: 100%;
        height: 38px;
        border: 1px solid #dbe3ee;
        border-radius: 8px;
        background: #f8fafc;
        color: var(--mobile-ink);
        font-size: 0.82rem;
        font-weight: 900;
        padding: 0 10px;
    }

    .mobile-stats-custom-range {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid #eef2f7;
    }

    .mobile-stats-date-separator {
        justify-self: center;
        color: #94a3b8;
        font-size: 0.8rem;
        font-weight: 950;
    }

    .mobile-stats-date-field {
        position: relative;
        min-width: 0;
        height: 44px;
        display: block;
    }

    .mobile-stats-date-field input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        z-index: 2;
    }

    .mobile-stats-date-text {
        min-width: 0;
        width: 100%;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 26px 0 10px;
        border: 1px solid #dbe3ee;
        border-radius: 8px;
        background: #f8fafc;
        color: var(--mobile-ink);
        font-size: 0.86rem;
        font-weight: 950;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        pointer-events: none;
    }

    .mobile-stats-date-field::after {
        content: "";
        position: absolute;
        right: 10px;
        top: 50%;
        width: 12px;
        height: 12px;
        border: 2px solid #0f172a;
        border-radius: 2px;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .mobile-stats-date-field::before {
        content: "";
        position: absolute;
        right: 12px;
        top: calc(50% - 8px);
        width: 8px;
        height: 4px;
        border-top: 2px solid #0f172a;
        border-bottom: 2px solid #0f172a;
        pointer-events: none;
        z-index: 1;
    }

    .mobile-stats-hero {
        border-radius: 12px;
        background: linear-gradient(135deg, #1c2638 0%, #0f172a 100%);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
        color: #ffffff;
        padding: 18px;
    }

    .mobile-stats-hero-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
        gap: 14px;
        align-items: start;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-stats-hero-row div:last-child {
        text-align: right;
    }

    .mobile-stats-hero span {
        display: block;
        color: rgba(255, 255, 255, 0.68);
        font-size: 0.72rem;
        font-weight: 850;
        line-height: 1.25;
    }

    .mobile-stats-hero strong {
        display: block;
        margin-top: 6px;
        color: #ffffff;
        font-size: 1.28rem;
        font-weight: 950;
        line-height: 1;
    }

    .mobile-stats-hero .mobile-stats-money {
        color: #37c871;
        font-size: 1.72rem;
    }

    .mobile-stats-hero-foot {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding-top: 13px;
    }

    .mobile-stats-hero-foot span {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.78rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .mobile-bill-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 12px;
        border: 1px solid var(--mobile-line);
        border-radius: 12px;
        background: #fff;
        padding: 16px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
    }

    .mobile-bill-summary {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        gap: 9px;
        border: 0;
        border-radius: 8px;
        background: #f8fafc;
        padding: 16px;
    }

    .mobile-bill-line {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        color: var(--mobile-ink);
        font-size: 0.82rem;
        font-weight: 900;
        line-height: 1.2;
    }

    .mobile-bill-line span {
        color: var(--mobile-ink);
        font-size: 0.82rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .mobile-bill-line strong {
        color: var(--mobile-ink);
        font-size: 0.84rem;
        font-weight: 950;
        text-align: right;
    }

    .mobile-bill-divider {
        height: 1px;
        border-top: 1px dashed #cbd5e1;
        margin: 2px 0 4px;
    }

    .mobile-bill-line.pending span {
        color: #64748b;
    }

    .mobile-bill-line.pending strong {
        color: #ef4444;
    }

    .mobile-bill-line.settled span,
    .mobile-bill-line.settled strong {
        font-size: 0.98rem;
    }

    .mobile-bill-line.settled strong {
        color: #07823b;
    }

    .mobile-bill-tools button {
        grid-column: 1 / -1;
        min-width: 0;
        height: 48px;
        border-radius: 8px;
        border: 1px solid #3b82f6;
        background: #3b82f6;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 950;
        padding: 0 14px;
    }

    .mobile-bill-tools .mobile-bill-secondary {
        height: 40px;
        border-color: #dbe3ee;
        background: #ffffff;
        color: #172033;
        font-size: 0.82rem;
    }
}

@media print {
    .mobile-app,
    .mobile-pull-refresh,
    .mobile-share-modal,
    .mobile-rules-manager,
    .mobile-student-manager {
        display: none !important;
    }
}
