
    :root {
        --sys-radius: 28px; /* 🌟 ค่าความโค้งมนส่วนกลาง 🌟 */
    }

    /* ==========================================
       DYNAMIC ISLAND & GLOBAL NOTIFICATION
    ========================================== */
    .sys-dynamic-island {
        position: fixed; top: 12px; left: 50%; transform: translateX(-50%) scale(0.8);
        background: rgba(15, 15, 15, 0.8);
        backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
        min-width: 120px; height: 36px; border-radius: 40px;
        z-index: 10000000; display: flex; align-items: center; justify-content: center;
        padding: 0 16px; gap: 10px; color: #fff; font-size: 13px; font-weight: 600;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
        transition: 0.5s cubic-bezier(0.1, 0.9, 0.2, 1.2);
    }
    .sys-dynamic-island.active { transform: translateX(-50%) scale(1); opacity: 1; min-width: 200px; height: 44px; }
    .sys-di-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
    .sys-di-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }

    /* ==========================================
       SYSTEM OVERLAYS & MODALS
    ========================================== */
    .sys-overlay { 
        position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); 
        -webkit-backdrop-filter: blur(10px); z-index: 1000000; display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .sys-card { background: #121212; border-radius: var(--sys-radius); width: 100%; max-width: 340px; overflow: hidden; border: 1px solid #1c1c1c; animation: sysPop 0.3s cubic-bezier(0.1, 0.8, 0.3, 1.1); }
    @keyframes sysPop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

    .sys-alert-content { padding: 32px 24px; text-align: center; }
    .sys-alert-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
    .sys-alert-msg { font-size: 14px; color: #888; margin-bottom: 24px; line-height: 1.5; }
    .sys-btn-primary { 
        width: 100%; background: #fff; color: #000; border: none; padding: 14px; 
        border-radius: 20px; font-weight: 700; font-size: 15px; cursor: pointer; transition: 0.2s;
    }
    .sys-btn-primary:active { transform: scale(0.96); opacity: 0.9; }

    /* 🌟 SELECT LIST (iOS Capsule Style) 🌟 */
    .sys-sheet-overlay { align-items: flex-end; padding: 12px; z-index: 2000000 !important; }
    .sys-sheet-card { 
        width: 100%; max-width: 450px; 
        background: transparent;
        animation: sysSlideUp 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
        display: flex; flex-direction: column; gap: 8px;
    }
    @keyframes sysSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    
    .sys-list-group { 
        display: flex; flex-direction: column; 
        background: rgba(28, 28, 28, 0.85); 
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-radius: 20px; overflow: hidden; 
    }
    .sys-list-item { 
        width: 100%; background: transparent; border: none; padding: 18px; color: #fff; 
        font-size: 16px; font-weight: 500; cursor: pointer; text-align: center; 
        border-bottom: 0.5px solid rgba(255,255,255,0.1);
        transition: background 0.2s;
    }
    .sys-list-item:last-child { border-bottom: none; }
    .sys-list-item:active { background: rgba(255,255,255,0.1); }
    
    .sys-list-cancel { 
        background: #1c1c1c; border-radius: 20px; color: #fff; 
        font-weight: 700; padding: 18px; font-size: 16px; border: none; cursor: pointer;
        transition: 0.2s;
    }
    .sys-list-cancel:active { transform: scale(0.98); background: #252525; }

    /* 🌟 หน้าต่างค้นหาผู้ใช้ (เช่นตอนแท็กคนในโพสต์) — เดิม element เฉพาะของหน้านี้ (search-sheet/header/
       input-wrap/results/item/avatar) ไม่มี CSS กำหนดไว้เลยสักบรรทัด ใช้ default ดิบของเบราว์เซอร์ล้วนๆ
       (input ขาว ตัวหนังสือชิดกัน ไม่มีระยะห่าง) หลุดธีมดาร์กมินิมอลของทั้งเว็บชัดเจน ออกแบบใหม่ทั้งชุด
       ให้เข้าธีมเดียวกับ .sys-list-group/.pu-* ที่เหลือ (การ์ดกระจกดำโปร่งแสงเลื่อนขึ้นจากล่าง) 🌟 */
    .sys-search-sheet {
        background: rgba(20, 20, 22, 0.92);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-radius: 34px 34px 0 0;
        border: 1px solid rgba(255,255,255,0.08); border-bottom: none;
        padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
        max-height: 70vh; gap: 14px;
    }
    .sys-search-sheet-handle { width: 36px; height: 4px; border-radius: 3px; background: rgba(255,255,255,0.25); margin: 4px auto 0; flex-shrink: 0; }
    .sys-search-header { color: #fff; font-size: 16px; font-weight: 700; text-align: center; flex-shrink: 0; }
    .sys-search-input-wrap {
        display: flex; align-items: center; gap: 10px; flex-shrink: 0;
        background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
        border-radius: 50px; padding: 10px 16px;
    }
    .sys-search-input-wrap input {
        flex: 1; min-width: 0; background: transparent; border: none; outline: none;
        color: #fff; font-size: 15px; font-family: inherit;
    }
    .sys-search-input-wrap input::placeholder { color: rgba(255,255,255,0.4); }
    .sys-search-results { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
    .sys-search-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; cursor: pointer; border-radius: 14px; transition: background 0.15s; color: #fff; font-size: 14px; font-weight: 600; }
    .sys-search-item:active { background: rgba(255,255,255,0.08); }
    .sys-search-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #333; flex-shrink: 0; }

    /* ── USER LIST MODAL (Followers, Likes, etc.) ── */
    .sys-ul-modal { 
        display: none; position: fixed; inset: 0; z-index: 1000000; 
        background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; 
    }
    .sys-ul-card { 
        width: 100%; max-width: 400px; background: rgba(18,18,18,0.8); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
        border-radius: 32px; border: 1px solid rgba(255,255,255,0.08); overflow: hidden; 
        animation: sysPopIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); 
        display: flex; flex-direction: column; box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    }
    .sys-ul-header { 
        padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); 
        text-align: center; font-weight: 850; font-size: 16px; position: relative; flex-shrink: 0; color: #fff;
        letter-spacing: -0.2px; text-transform: none;   /* ไม่บังคับตัวพิมพ์ใหญ่ — ชื่อผู้ใช้ (@...) แสดงตามจริงเป็นตัวพิมพ์เล็ก */
    }
    .sys-ul-close { 
        position: absolute; right: 16px; top: 16px; 
        background: rgba(255,255,255,0.05); border: none; color: #fff; 
        width: 36px; height: 36px; border-radius: 50%; cursor: pointer; 
        display: flex; align-items: center; justify-content: center; font-size: 24px;
        transition: 0.2s;
    }
    .sys-ul-close:active { transform: scale(0.9); background: rgba(255,255,255,0.1); }
    
    .sys-ul-body { flex: 1; overflow-y: auto; padding: 8px 0; max-height: 70vh; }
    
    .sys-ul-row { 
        display: flex; align-items: center; gap: 14px; padding: 14px 20px; 
        cursor: pointer; transition: 0.2s; position: relative; 
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .sys-ul-row:last-child { border-bottom: none; }
    .sys-ul-row:active { background: rgba(255,255,255,0.04); }
    
    .sys-skeleton {
        background: rgba(255,255,255,0.08);
        animation: pulse 1.5s infinite ease-in-out;
    }
    @keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

    @keyframes btn-upload-wave {
        from { left: -80%; }
        to   { left: 140%; }
    }
    .btn-uploading {
        position: relative !important;
        overflow: hidden !important;
        opacity: 0.55 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
    }
    .btn-uploading::after {
        content: '';
        position: absolute;
        top: 0; left: -80%;
        width: 60%; height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
        animation: btn-upload-wave 1.2s ease-in-out infinite;
    }

    .sys-crop-body {
        height: 300px;
        max-height: 55vh;
        overflow: hidden;
        background: #000;
        position: relative;
    }
    /* 🌟 cropperjs สีฟ้า (#39f) เป็นสีดีฟอลต์ของไลบรารีเอง ไม่เข้ากับธีมขาว-ดำล้วนของเว็บเลย
       เปลี่ยนกรอบครอบตัด/เส้นแบ่ง/จุดจับมุมให้เป็นสีขาวแทน ชนกันไม่ได้กับส่วนอื่นของเว็บที่เป็น
       ขาว-ดำ-เทาล้วน 🌟 */
    .sys-crop-body .cropper-view-box { outline-color: #fff; }
    .sys-crop-body .cropper-line { background-color: #fff; }
    .sys-crop-body .cropper-point { background-color: #fff; }
    /* ปุ่มยืนยันของหน้าต่างครอบตัดรูปภาพโดยเฉพาะ — ให้โค้งมนกว่า .sys-btn-primary ปกติ (20px) โดยไม่
       กระทบปุ่มอื่นที่ใช้คลาสเดียวกัน (เช่นปุ่มใน alert dialog) */
    #sys-crop-save-btn { border-radius: 30px; }

    .sys-ul-av-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
    .sys-ul-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #222; border: none; }
    .sys-ul-lock { position: absolute; bottom: -2px; left: -2px; background: #000; color: #fff; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; border: 1.5px solid #000; box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 5; }
    /* คนที่กดใจสตอรี่ — โชว์เป็นหัวใจแดงโปร่งพร้อมข้อความ ในบรรทัดรายละเอียดใต้ชื่อ */
    .sys-ul-liked { color: #ED4956; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
    .sys-ul-liked i { font-size: 14px; line-height: 1; }
    
    .sys-ul-info { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding-right: 5px; }
    .sys-ul-name { font-weight: 800; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.2px; }
    .sys-ul-bio { color: rgba(255,255,255,0.45); font-size: 12px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }

    .sys-ul-action { flex-shrink: 0; }
    /* ปุ่มติดตามแบบข้อความ (แคปซูล) — ไม่มีไอคอน */
    .sys-ul-btn {
        min-width: 78px; height: 30px; padding: 0 14px; border-radius: 16px; border: none;
        display: inline-flex; align-items: center; justify-content: center;
        cursor: pointer; transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
        font-size: 12.5px; font-weight: 700; white-space: nowrap; font-family: inherit;
        background: #fff; color: #000;
    }
    .sys-ul-btn.following { background: rgba(255,255,255,0.12); color: #fff; }
    .sys-ul-btn.pending { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.75); }
    .sys-ul-btn:active { transform: scale(0.9); }
    /* ป้าย "ส่วนตัว" จางๆ หลังชื่อ */
    /* ป้าย "ส่วนตัว" อยู่เหนือชื่อ ตัวเล็กจางๆ */
    .sys-ul-private { color: rgba(255,255,255,0.35); font-weight: 600; font-size: 10px; letter-spacing: 0.2px; line-height: 1.2; }

    /* วงแหวนสตอรี่ในลิสต์ — เว้นระยะจากรูปเหมือนวงแหวนจริงในหน้าโปรไฟล์ */
    .sys-ul-av-wrap.has-story::after,
    .sys-ul-av-wrap.seen-story::after {
        content: ''; position: absolute; inset: -5px; border-radius: 50%;
        border: 2px solid #fff; pointer-events: none;
    }
    .sys-ul-av-wrap.seen-story::after { border-color: rgba(255,255,255,0.25); }   /* ดูแล้ว = เทาจาง */

    @keyframes sysPopIn { from { transform: scale(0.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

    /* 🌟 MODAL: PAPER REPORT (Minimalist & Gray) 🌟 */
    .sys-paper-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px); z-index: 10000001; display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .sys-paper-card {
        background: #1a1a1a; width: 100%; max-width: 380px; border-radius: 4px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5); position: relative;
        animation: sysPaperReveal 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
        border: 1px solid #262626; padding: 40px 30px;
    }
    @keyframes sysPaperReveal { from { transform: scale(0.9) translateY(30px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
    
    .sys-paper-card::after {
        content: ''; position: absolute; top: 0; right: 0; width: 35px; height: 35px;
        background: linear-gradient(225deg, #121212 50%, #262626 50%);
    }
    
    .sys-paper-title { color: #fff; font-size: 20px; font-weight: 950; letter-spacing: -1px; border-bottom: 2px solid #333; padding-bottom: 12px; margin-bottom: 25px; text-transform: uppercase; }
    .sys-paper-field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
    .sys-paper-label { font-size: 10px; font-weight: 800; color: #555; text-transform: uppercase; letter-spacing: 1px; }
    .sys-paper-input { 
        width: 100%; background: #121212; border: 1px solid #262626; border-radius: 8px; color: #fff; 
        padding: 12px 15px; font-size: 14px; font-family: inherit; outline: none; transition: 0.2s;
    }
    .sys-paper-input:focus { border-color: #444; background: #000; }
    .sys-paper-textarea { min-height: 120px; resize: none; }
    
    .sys-paper-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
    .sys-paper-btn-send { background: #fff; color: #000; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 800; font-size: 13px; cursor: pointer; transition: 0.2s; }
    .sys-paper-btn-send:active { transform: scale(0.95); opacity: 0.8; }
    .sys-paper-btn-close { color: #555; font-size: 24px; cursor: pointer; transition: 0.2s; }
    .sys-paper-btn-close:hover { color: #fff; }

    /* ✈️ ส่งรายงาน = อนิเมชันเดียวกับส่งจดหมายหน้าโปรไฟล์ (.paper-sending / @keyframes fold-and-fly ใน profile.html)
       กระดาษสีเทาเดิม พับเป็นเครื่องบินแล้วพุ่งลึกขึ้นฟ้า */
    .sys-paper-overlay { perspective: 2500px; }
    /* เจาะจงกว่า .sys-paper-card (ที่มี animation เปิดฟอร์มของตัวเอง) — ใช้ fold-and-fly ตัวเดียวกับจดหมายเสมอ */
    .sys-paper-card.paper-sending { animation: fold-and-fly 2s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards; }

    /* 🌟 UTILITIES: SMOOTH IMAGE 🌟 */
    .sys-img-smooth { opacity: 0; transition: opacity 0.5s ease-in-out, filter 0.45s ease-out; }
    .sys-img-smooth.loaded { opacity: 1; }
    /* ระหว่างที่ยังเป็นรูปมินิ เบลอบาง ๆ ไว้ พอรูปคมมาถึงค่อยคลายออก — ตาไม่จับรอยต่อ */
    .sys-img-smooth.sys-img-lowres { filter: blur(1.2px); }

    /* ── WHITE PAPER MESSAGE VIEW (Global) ── */
    .sys-env-modal {
        position: fixed; inset: 0; background: rgba(0,0,0,0.92); backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px); z-index: 10000002; display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .sys-paper-view {
        width: 100%; max-width: 380px; background: #fff; padding: 50px 35px; border-radius: 2px;
        box-shadow: 0 15px 45px rgba(0,0,0,0.4); position: relative;
        animation: sysPaperReveal 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
    }
    .sys-paper-view::before {
        content: ''; position: absolute; top: 0; right: 0; width: 40px; height: 40px;
        background: linear-gradient(225deg, rgba(0,0,0,0.05) 50%, #fff 50%);
    }
    .sys-paper-v-title { color: #000; font-size: 20px; font-weight: 950; letter-spacing: -1px; border-bottom: 2.5px solid #000; padding-bottom: 10px; margin-bottom: 25px; text-transform: uppercase; }
    .sys-paper-v-subject { font-size: 15px; font-weight: 700; color: #000; padding: 12px 0; border-bottom: 1.5px solid rgba(0,0,0,0.1); margin-bottom: 15px; text-transform: uppercase; }
    .sys-paper-v-content { font-size: 14px; font-weight: 600; line-height: 1.6; color: #111; min-height: 140px; white-space: pre-wrap; }
    .sys-paper-v-footer { margin-top: 25px; display: flex; align-items: center; }
    /* 📍 ปุ่มดูตำแหน่งที่ผู้ส่งแนบมาในจดหมาย */
    .sys-env-loc {
        margin-left: auto; display: flex; align-items: center; gap: 6px;
        background: #000; color: #fff; border: none; border-radius: 40px;
        padding: 9px 16px; font-size: 11px; font-weight: 900; letter-spacing: 0.3px;
        cursor: pointer; transition: transform 0.2s; touch-action: manipulation; font-family: inherit;
    }
    .sys-env-loc i { font-size: 15px; }
    .sys-env-loc:active { transform: scale(0.9); }
