/* Public documents reuse the mobile workspace tokens. Desktop keeps the
 * document's original presentation, and login does not load this stylesheet. */
.student-document-controls { display:none; }
@media (max-width:768px), (max-height:500px) and (pointer:coarse) {
    body.student-document.student-mobile {
        display:block; min-height:100dvh; margin:0;
        padding:0 0 max(24px, env(safe-area-inset-bottom, 0px));
        background:var(--student-bg); color:var(--student-ink);
        font-size:var(--font-body); line-height:1.75;
    }
    .student-document.student-mobile .student-document-controls {
        display:flex; align-items:center; justify-content:flex-end;
        gap:8px; min-height:44px; margin:0 0 16px;
    }
    .student-document.student-mobile .student-document-controls button {
        display:inline-flex; align-items:center; justify-content:center;
        min-width:64px; min-height:44px; padding:8px 12px;
        border:1px solid var(--student-line); border-radius:12px;
        background:var(--student-surface); color:var(--student-accent);
        font:500 14px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
        cursor:pointer;
    }
    .student-document.student-mobile .student-document-controls button:focus-visible,
    .student-document.student-mobile a:focus-visible {
        outline:2px solid var(--student-accent); outline-offset:3px;
    }
    .student-document.student-mobile .legal-shell {
        width:100%; max-width:760px; margin:0 auto; padding:20px 16px 8px;
    }
    .student-document.student-mobile .legal-card {
        overflow:visible; border:0; border-radius:0; box-shadow:none; background:transparent;
    }
    .student-document.student-mobile .legal-hero {
        padding:0 0 20px; border:0; background:transparent;
    }
    .student-document.student-mobile .legal-brand {
        gap:10px; margin:0 0 14px; font-size:var(--font-note);
        font-weight:600; color:var(--student-accent); letter-spacing:0;
    }
    .student-document.student-mobile .legal-brand img { width:36px; height:36px; }
    .student-document.student-mobile h1 {
        margin:0; color:var(--student-ink); font-size:var(--font-title);
        font-weight:700; line-height:1.5; overflow-wrap:anywhere;
    }
    .student-document.student-mobile .legal-meta {
        margin-top:8px; color:var(--student-muted); font-size:var(--font-note);
    }
    .student-document.student-mobile .legal-body { padding:0; }
    .student-document.student-mobile .notice,
    .student-document.student-mobile .legal-document-section {
        margin:0 0 12px; padding:16px;
        border:1px solid var(--student-line); border-radius:16px;
        background:var(--student-surface); color:var(--student-ink);
    }
    .student-document.student-mobile .notice {
        color:var(--student-accent); font-weight:500; font-size:var(--font-control);
        line-height:1.85;
    }
    .student-document.student-mobile h2 {
        margin:0 0 8px; color:var(--student-ink); font-size:var(--font-body);
        font-weight:650; line-height:1.6;
    }
    .student-document.student-mobile :is(p,ul) {
        color:var(--student-ink); font-size:var(--font-control); line-height:1.85;
        overflow-wrap:anywhere;
    }
    .student-document.student-mobile p { margin:8px 0 0; }
    .student-document.student-mobile ul { margin:8px 0 0; padding-left:1.3em; }
    .student-document.student-mobile li { margin:8px 0; }
    .student-document.student-mobile .data-table {
        display:block; margin:12px 0 4px; border:1px solid var(--student-line);
        border-radius:12px; font-size:var(--font-control); background:var(--student-bg);
    }
    .student-document.student-mobile .data-table :is(tbody,tr,th,td) {
        display:block; width:100%; border-color:var(--student-line);
        color:var(--student-ink); background:transparent; overflow-wrap:anywhere;
    }
    .student-document.student-mobile .data-table th {
        padding:12px 12px 4px; border-bottom:0; font-weight:600;
    }
    .student-document.student-mobile .data-table td { padding:4px 12px 12px; }
    .student-document.student-mobile .legal-footer {
        margin:20px 0 0; padding-top:16px; border-color:var(--student-line);
        color:var(--student-muted); font-size:var(--font-note); line-height:1.8;
    }
    .student-document.student-mobile .legal-actions { display:grid; gap:10px; margin-top:20px; }
    .student-document.student-mobile :is(.legal-action,.return-link) {
        display:flex; align-items:center; justify-content:center; width:100%; min-height:48px;
        margin:0; padding:12px 16px; border:1px solid var(--student-line); border-radius:12px;
        background:var(--student-surface); color:var(--student-accent);
        font-size:var(--font-control); font-weight:500; line-height:1.6; text-align:center;
    }
    .student-document.student-mobile :is(.legal-action.primary,.return-link) {
        border:0; background:linear-gradient(110deg,#4d8ef3,#326de0); color:#fff;
    }
    .student-document.student-mobile[data-student-font="small"] :is(.legal-document-section,.notice) { padding:14px; }
    .student-return-document.student-mobile { padding:20px 16px max(24px, env(safe-area-inset-bottom, 0px)); }
    .student-return-document.student-mobile > .student-document-controls { max-width:560px; margin:0 auto 24px; }
    .student-return-document.student-mobile .return-card {
        width:100%; max-width:560px; margin:0 auto; padding:28px 20px 22px;
        border:1px solid var(--student-line); border-radius:20px;
        background:var(--student-surface); box-shadow:none;
    }
    .student-return-document.student-mobile .return-icon {
        width:56px; height:56px; margin-bottom:20px;
        background:var(--student-accent-surface); color:var(--student-accent);
    }
    .student-return-document.student-mobile .order-id {
        margin:20px 0; background:var(--student-bg); color:var(--student-muted);
        border:1px solid var(--student-line); font-size:var(--font-note); line-height:1.8;
    }
    .student-return-document.student-mobile .return-link { margin-top:24px; text-decoration:none; }
}
