
    /* ==========================================
       ADMIN PANEL (admin.html)
    ========================================== */
    #view-admin {
        --adm-bg: #000;
        --adm-surface: #111;
        --adm-surface2: #1a1a1a;
        --adm-border: rgba(255,255,255,0.08);
        --adm-txt: #fff;
        --adm-txt2: #888;
        --adm-danger: #ED4956;
        --adm-green: #17c964;
        --adm-warn: #f5a623;
        --adm-blue: #0095F6;
        background: var(--adm-bg);
        color: var(--adm-txt);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        /* 🐞 100vh บน Safari ใหญ่กว่าพื้นที่มองเห็นจริงตอนแถบเครื่องมือโผล่อยู่ — เดิมไม่มีผลเพราะ
           .app-view เคยบังคับความสูงตายตัวทับอยู่แล้ว ดู [[project_hqux_full_page_scroll]] 🌟 */
        min-height: 100vh; min-height: 100dvh;
    }

    /* ── SCREENS ── */
    .adm-screen { display: none; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
    .adm-screen.active { display: flex; }

    /* ── HEADER ── */
    .adm-header {
        position: sticky; top: 0; left: 0; width: 100%; z-index: 100;
        padding: max(16px, env(safe-area-inset-top)) 16px 14px;
        background: rgba(0,0,0,0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--adm-border);
        display: flex; align-items: center; justify-content: space-between;
        flex-shrink: 0;
    }
    .adm-header-center { display: flex; align-items: center; gap: 10px; flex: 1; }
    .adm-back-btn {
        width: 36px; height: 36px; border-radius: 50%; background: transparent;
        display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
        transition: 0.2s; border: none; color: #fff; flex-shrink: 0;
    }
    .adm-back-btn:active { transform: scale(0.88); background: rgba(255,255,255,0.08); }
    .adm-title { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; }
    .adm-badge {
        font-size: 10px; font-weight: 800; background: var(--adm-warn); color: #000;
        padding: 2px 7px; border-radius: 20px; letter-spacing: 0.5px;
    }

    /* ── CONTENT ── */
    .adm-content { flex: 1; padding: 20px 16px 120px; max-width: 640px; margin: 0 auto; width: 100%; }

    /* ── STAT CARDS ── */
    .adm-stats-grid {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px;
    }
    .adm-stat-card {
        background: var(--adm-surface); border: 1px solid var(--adm-border);
        border-radius: 18px; padding: 14px 12px; text-align: center;
    }
    .adm-stat-val { font-size: 22px; font-weight: 900; color: var(--adm-txt); margin-bottom: 2px; }
    .adm-stat-lbl { font-size: 11px; font-weight: 600; color: var(--adm-txt2); }

    /* ── SECTION LABEL ── */
    .adm-sec-lbl {
        font-size: 11px; font-weight: 800; color: var(--adm-txt2); text-transform: uppercase;
        letter-spacing: 1px; margin-bottom: 10px; padding-left: 4px;
    }

    /* ── MENU CARDS ── */
    .adm-card { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 20px; overflow: hidden; margin-bottom: 24px; }
    .adm-menu-item {
        display: flex; align-items: center; gap: 14px; padding: 16px 18px;
        border-bottom: 1px solid var(--adm-border); cursor: pointer; transition: 0.15s;
    }
    .adm-menu-item:last-child { border-bottom: none; }
    .adm-menu-item:active { background: rgba(255,255,255,0.04); transform: scale(0.99); }
    .adm-menu-icon {
        width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center;
        justify-content: center; font-size: 20px; flex-shrink: 0;
    }
    .adm-menu-icon.blue  { color: var(--adm-blue); }
    .adm-menu-icon.green { color: var(--adm-green); }
    .adm-menu-icon.warn  { color: var(--adm-warn); }
    .adm-menu-icon.red   { color: var(--adm-danger); }
    .adm-menu-icon.white { color: #fff; }
    .adm-menu-text { flex: 1; }
    .adm-menu-title { font-size: 15px; font-weight: 700; color: var(--adm-txt); margin-bottom: 2px; }
    .adm-menu-sub { font-size: 12px; font-weight: 500; color: var(--adm-txt2); }
    .adm-menu-arrow { font-size: 22px; color: rgba(255,255,255,0.2); }

    /* ── SEARCH BAR ── */
    .adm-search-wrap {
        display: flex; align-items: center; gap: 10px;
        background: var(--adm-surface); border: 1px solid var(--adm-border);
        border-radius: 16px; padding: 12px 16px; margin-bottom: 16px;
    }
    .adm-search-wrap i { font-size: 20px; color: var(--adm-txt2); flex-shrink: 0; }
    .adm-search-input {
        background: none; border: none; color: var(--adm-txt); font-size: 15px; font-weight: 500;
        outline: none; flex: 1; font-family: inherit;
    }
    .adm-search-input::placeholder { color: var(--adm-txt2); }

    /* ── FILTER TABS ── */
    .adm-filter-tabs {
        display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px;
    }
    .adm-filter-tabs::-webkit-scrollbar { display: none; }
    .adm-tab {
        padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 700;
        background: var(--adm-surface); border: 1px solid var(--adm-border);
        color: var(--adm-txt2); cursor: pointer; white-space: nowrap; transition: 0.2s; flex-shrink: 0;
    }
    .adm-tab.active { background: #fff; color: #000; border-color: #fff; }
    .adm-btn { border: 0; border-radius: 12px; padding: 9px 14px; background: #fff; color: #000; font: 600 13px/1 inherit; cursor: pointer; }
    .adm-btn:active { transform: scale(0.96); }
    .adm-tab:active { transform: scale(0.94); }

    /* ── USER ROW ── */
    .adm-user-row {
        display: flex; align-items: center; gap: 12px; padding: 12px 18px;
        border-bottom: 1px solid var(--adm-border); transition: 0.15s; cursor: pointer;
    }
    .adm-user-row:last-child { border-bottom: none; }
    .adm-user-row:active { background: rgba(255,255,255,0.03); }
    .adm-user-avatar {
        width: 44px; height: 44px; border-radius: 50%; background: var(--adm-surface2);
        object-fit: cover; flex-shrink: 0; border: 1px solid var(--adm-border);
        display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--adm-txt2);
        overflow: hidden;
    }
    .adm-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .adm-user-info { flex: 1; overflow: hidden; }
    .adm-user-name { font-size: 14px; font-weight: 700; color: var(--adm-txt); display: flex; align-items: center; gap: 6px; }
    .adm-user-sub { font-size: 12px; color: var(--adm-txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .adm-user-banned { font-size: 10px; font-weight: 700; background: var(--adm-danger); color: #fff; padding: 2px 6px; border-radius: 6px; }
    /* ไอคอนไอจีมินิมอล — บัญชีที่โคลนข้อมูลมาจากไอจี */
    .adm-ig-badge { font-size: 15px; color: #fff; opacity: 0.85; line-height: 1; }
    .adm-user-admin { font-size: 10px; font-weight: 700; background: var(--adm-warn); color: #000; padding: 2px 6px; border-radius: 6px; }
    .adm-user-action-btn {
        width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.06);
        display: flex; align-items: center; justify-content: center; font-size: 18px;
        cursor: pointer; border: none; color: #fff; flex-shrink: 0; transition: 0.2s;
    }
    .adm-user-action-btn:active { transform: scale(0.88); background: rgba(255,255,255,0.12); }

    /* ── REPORT ROW ── */
    .adm-report-row {
        padding: 14px 18px; border-bottom: 1px solid var(--adm-border);
        cursor: pointer; transition: 0.15s;
    }
    .adm-report-row:last-child { border-bottom: none; }
    .adm-report-row:active { background: rgba(255,255,255,0.03); }
    .adm-report-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
    .adm-report-subject { font-size: 14px; font-weight: 700; color: var(--adm-txt); flex: 1; }
    .adm-report-status {
        font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 8px; white-space: nowrap; flex-shrink: 0;
    }
    .adm-report-status.pending   { background: rgba(245,166,35,0.2); color: var(--adm-warn); }
    .adm-report-status.reviewed  { background: rgba(0,149,246,0.2); color: var(--adm-blue); }
    .adm-report-status.resolved  { background: rgba(23,201,100,0.2); color: var(--adm-green); }
    .adm-report-status.dismissed { background: rgba(255,255,255,0.06); color: var(--adm-txt2); }
    .adm-report-meta { font-size: 12px; color: var(--adm-txt2); }

    /* ── SYSTEM ACTION BTN ── */
    .adm-action-btn {
        width: 100%; padding: 16px 20px; border-radius: 18px; border: none;
        font-size: 14px; font-weight: 700; cursor: pointer; display: flex;
        align-items: center; justify-content: space-between; transition: 0.2s;
        font-family: inherit; margin-bottom: 12px;
    }
    .adm-action-btn:active { transform: scale(0.98); }
    .adm-action-btn.warn-btn { background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.2); color: var(--adm-warn); }
    .adm-action-btn.danger-btn { background: rgba(237,73,86,0.1); border: 1px solid rgba(237,73,86,0.2); color: var(--adm-danger); }

    /* ── EMPTY STATE ── */
    .adm-empty { text-align: center; padding: 50px 20px; color: var(--adm-txt2); }
    .adm-empty i { font-size: 48px; margin-bottom: 12px; display: block; opacity: 0.4; }
    .adm-empty p { font-size: 14px; font-weight: 600; }

    /* ── LOADER ── */
    .adm-loader { text-align: center; padding: 40px; color: var(--adm-txt2); }

    /* ── TOGGLE SWITCH ── */
    .adm-toggle-row {
        display: flex; align-items: center; justify-content: space-between;
        padding: 16px 18px; border-bottom: 1px solid var(--adm-border);
    }
    .adm-toggle-row:last-child { border-bottom: none; }
    .adm-toggle-left { display: flex; align-items: center; gap: 14px; }
    .adm-toggle-text { display: flex; flex-direction: column; gap: 2px; }
    .adm-toggle-title { font-size: 15px; font-weight: 700; color: var(--adm-txt); }
    .adm-toggle-sub   { font-size: 12px; font-weight: 500; color: var(--adm-txt2); }
    .adm-toggle-state { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; margin-top: 2px; display: inline-block; width: fit-content; }
    .adm-toggle-state.open   { background: rgba(23,201,100,0.15); color: var(--adm-green); }
    .adm-toggle-state.closed { background: rgba(237,73,86,0.15);  color: var(--adm-danger); }

    .adm-signup-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
    .adm-signup-field label { font-size: 12px; font-weight: 700; color: var(--adm-txt2); }
    .adm-signup-field .adm-edit-input { width: 100%; }
    .adm-bot-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--adm-border); font-size: 12px; }
    .adm-bot-row b { color: var(--adm-txt); font-weight: 700; }
    .adm-bot-row span { color: var(--adm-txt2); text-align: right; word-break: break-all; }
    .adm-switch {
        position: relative; width: 52px; height: 30px; flex-shrink: 0;
    }
    .adm-switch input { opacity: 0; width: 0; height: 0; }
    .adm-switch-slider {
        position: absolute; cursor: pointer; inset: 0;
        background: rgba(255,255,255,0.12); border-radius: 30px;
        transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        border: 1px solid rgba(255,255,255,0.1);
    }
    .adm-switch-slider::before {
        content: ''; position: absolute;
        width: 24px; height: 24px; left: 2px; top: 2px;
        background: rgba(255,255,255,0.5); border-radius: 50%;
        transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    }
    .adm-switch input:checked + .adm-switch-slider { background: var(--adm-green); border-color: var(--adm-green); }
    .adm-switch input:checked + .adm-switch-slider::before { transform: translateX(22px); background: #fff; }

    /* ── REPORT DETAIL MODAL ── */
    .adm-modal-overlay {
        display: none; position: fixed; inset: 0; z-index: 1000000;
        background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
        justify-content: center; align-items: flex-end; padding: 0;
    }
    .adm-modal-overlay.active { display: flex; }
    .adm-modal-sheet {
        width: 100%; max-width: 640px; background: #161616;
        border-radius: 28px 28px 0 0; border: 1px solid var(--adm-border);
        padding: 12px 20px 40px; max-height: 80vh; overflow-y: auto;
        animation: admSheetIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    @keyframes admSheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .adm-modal-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 4px; margin: 0 auto 16px; }
    .adm-modal-title { font-size: 17px; font-weight: 800; color: var(--adm-txt); margin-bottom: 16px; }
    .adm-modal-field { margin-bottom: 14px; }
    .adm-modal-label { font-size: 11px; font-weight: 800; color: var(--adm-txt2); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
    .adm-modal-val { font-size: 14px; color: var(--adm-txt); font-weight: 500; line-height: 1.5; }
    /* 🛠️ กล่องแก้ข้อมูลบัญชีในหน้าจัดการผู้ใช้ */
    .adm-edit-box {
        margin: 16px 0 4px; padding: 14px; border-radius: 16px;
        background: var(--adm-surface2); border: 1px solid var(--adm-border);
        display: flex; flex-direction: column; gap: 6px;
    }
    .adm-edit-box .adm-modal-label { margin-top: 6px; }
    .adm-edit-input {
        width: 100%; box-sizing: border-box; padding: 11px 12px; margin-bottom: 2px;
        border-radius: 12px; border: 1px solid var(--adm-border);
        background: var(--adm-bg); color: var(--adm-txt);
        font-size: 14px; font-family: inherit; outline: none;
    }
    .adm-edit-input:focus { border-color: var(--adm-blue); }
    .adm-edit-box .adm-modal-btn { margin-top: 10px; }

    /* 🙈 รายการหมวดที่ซ่อนจากหน้าฟีด */
    .adm-hide-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
    .adm-hide-item {
        display: flex; align-items: center; gap: 10px; padding: 9px 10px;
        border-radius: 11px; cursor: pointer; font-size: 14px; transition: 0.15s;
    }
    .adm-hide-item:active { background: rgba(255,255,255,0.06); }
    .adm-hide-item input { width: 17px; height: 17px; accent-color: var(--adm-blue); cursor: pointer; }

    .adm-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
    .adm-modal-btn {
        flex: 1; min-width: 120px; padding: 12px; border-radius: 14px; border: none;
        font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.2s; font-family: inherit;
    }
    .adm-modal-btn:active { transform: scale(0.96); }
    .adm-modal-btn.outline { background: rgba(255,255,255,0.07); color: #fff; }
    .adm-modal-btn.blue-btn   { background: rgba(0,149,246,0.15); color: var(--adm-blue); }
    .adm-modal-btn.green-btn  { background: rgba(23,201,100,0.15); color: var(--adm-green); }
    .adm-modal-btn.danger-modal { background: rgba(237,73,86,0.15); color: var(--adm-danger); }

    /* ── 🤖 บัญชี AI จำลองผู้ใช้ ── */
    #adm-screen-vox [hidden], #adm-screen-art [hidden] { display: none !important; }
    /* 📊 โควตาและการใช้งาน API */
    .adm-q-svc { padding: 14px 16px; border-bottom: 1px solid var(--adm-border); }
    .adm-q-svc:last-child { border-bottom: none; }
    .adm-q-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
    .adm-q-top b { font-size: 14px; color: var(--adm-txt); }
    .adm-q-top span { font-size: 13px; font-weight: 700; color: var(--adm-txt); font-variant-numeric: tabular-nums; }
    .adm-q-bar { height: 6px; border-radius: 3px; background: var(--adm-border); overflow: hidden; margin: 8px 0 6px; }
    .adm-q-bar i { display: block; height: 100%; background: var(--adm-txt); border-radius: 3px; }
    .adm-q-bar.warn i { background: #f5a41c; } .adm-q-bar.full i { background: var(--adm-danger); }
    .adm-q-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--adm-txt2); font-weight: 600; }
    .adm-q-meta .rl { color: var(--adm-danger); }
    .adm-q-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; }
    .adm-q-spark i { flex: 1; background: var(--adm-txt2); opacity: .5; border-radius: 2px 2px 1px 1px; min-height: 1px; }
    .adm-q-spark i:last-child { opacity: 1; background: var(--adm-txt); }
    .adm-q-sys { margin-top: 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; font-size: 12px; color: var(--adm-txt2); }
    .adm-q-sys b { color: var(--adm-txt); font-weight: 600; }
    .adm-q-lim { display: grid; grid-template-columns: 1fr 110px; gap: 8px 10px; align-items: center; padding: 14px 16px; font-size: 13px; color: var(--adm-txt); }
    .adm-q-lim input { margin: 0; width: 100%; }

    /* 🎨 บอทวอลเปเปอร์ */
    .adm-art-styles { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
    .adm-art-style { padding: 7px 12px; border-radius: 16px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--adm-border); color: var(--adm-txt2); background: transparent; }
    .adm-art-style.on { background: var(--adm-txt); color: var(--adm-bg, #000); border-color: transparent; }
    .adm-art-prev { display: block; width: 100%; max-width: 300px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; margin: 12px auto 0; background: #111; }
    .adm-ai-warn { background: rgba(237,73,86,0.12); color: var(--adm-danger); border-radius: 14px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
    .adm-ai-row { padding: 14px 16px; border-bottom: 1px solid var(--adm-border); }
    .adm-ai-row:last-child { border-bottom: none; }
    .adm-ai-top { display: flex; align-items: center; gap: 12px; }
    .adm-ai-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #222; flex-shrink: 0; cursor: pointer; }
    .adm-ai-name { flex: 1; min-width: 0; cursor: pointer; }
    .adm-ai-name b { display: block; font-size: 14px; color: var(--adm-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .adm-ai-name span { font-size: 12px; color: var(--adm-txt2); }
    .adm-ai-life { font-size: 13px; color: var(--adm-txt); margin: 8px 0 4px; line-height: 1.45; }
    .adm-ai-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--adm-txt2); font-weight: 600; }
    .adm-ai-acts { display: flex; gap: 8px; margin-top: 10px; }
    .adm-ai-acts input { flex: 1; min-width: 0; margin: 0; }
    .adm-ai-acts .adm-modal-btn { flex: 0 0 auto; min-width: 0; padding: 10px 14px; }
    .adm-ai-log-row { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--adm-border); font-size: 12.5px; }
    .adm-ai-log-row:last-child { border-bottom: none; }
    .adm-ai-log-row .t { color: var(--adm-txt2); flex-shrink: 0; width: 44px; }
    .adm-ai-log-row .a { font-weight: 700; flex-shrink: 0; }
    .adm-ai-log-row .a.fail { color: var(--adm-danger); }
    .adm-ai-log-row .d { color: var(--adm-txt2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .adm-ai-job { font-size: 12.5px; color: var(--adm-txt2); padding: 6px 2px; }

    /* ── 🛡️ ตัวอย่างสิ่งที่ถูกรายงาน (โพสต์/สตอรี่/คอมเมนต์/บัญชี) ── */
    #adm-report-modal [hidden] { display: none !important; }
    .adm-rp-preview { border: 1px solid var(--adm-border); border-radius: 18px; overflow: hidden; background: #0e0e0e; margin-bottom: 14px; }
    .adm-rp-owner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
    .adm-rp-owner img, .adm-rp-owner .adm-rp-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #222; flex-shrink: 0; }
    .adm-rp-owner-name { font-size: 13px; font-weight: 700; color: var(--adm-txt); }
    .adm-rp-owner-sub { font-size: 11px; color: var(--adm-txt2); }
    .adm-rp-media { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 12px; padding: 0 12px 10px; }
    .adm-rp-media > * { flex: 0 0 auto; width: min(260px, 78%); max-height: 340px; aspect-ratio: 4 / 5; object-fit: cover;
        border-radius: 12px; background: #1a1a1a; scroll-snap-align: start; }
    .adm-rp-media.single > * { width: 100%; max-width: 320px; margin: 0 auto; }
    .adm-rp-media.story > * { aspect-ratio: 9 / 16; max-height: 420px; width: auto; }
    .adm-rp-text { padding: 0 12px 12px; font-size: 14px; color: var(--adm-txt); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
    .adm-rp-comment { margin: 0 12px 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); font-size: 14px; color: var(--adm-txt); }
    .adm-rp-sub { padding: 0 12px 8px; font-size: 11px; font-weight: 800; color: var(--adm-txt2); text-transform: uppercase; letter-spacing: .6px; }
    .adm-rp-gone { padding: 22px 12px; text-align: center; color: var(--adm-txt2); font-size: 13px; }
    .adm-rp-gone i { display: block; font-size: 26px; margin-bottom: 6px; }
    .adm-rp-act { border: 1px solid var(--adm-border); border-radius: 18px; padding: 4px 0 12px; margin-bottom: 4px; }
    .adm-rp-act .adm-toggle-row { padding: 12px 14px; }
    .adm-rp-act textarea { display: block; width: calc(100% - 28px); margin: 0 14px; min-height: 58px; resize: vertical; }
    .adm-rp-act .adm-modal-actions { margin: 10px 14px 0; }
    .adm-rp-confirm { margin: 10px 14px 0; padding: 12px; border-radius: 14px; background: rgba(237,73,86,0.1); color: var(--adm-txt); font-size: 13px; }
    .adm-rp-confirm .adm-modal-actions { margin: 10px 0 0; }


    /* ── 🛠️ คุยกับ Claude Code (เฉพาะเจ้าของ) ── */
    #adm-screen-dev .adm-content { padding-bottom: 0; display: flex; flex-direction: column; min-height: calc(100dvh - 70px); }
    .dv-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--adm-txt2); padding: 2px 4px 12px; }
    .dv-dot { width: 8px; height: 8px; border-radius: 50%; background: #666; flex: none; }
    .dv-dot.on { background: var(--adm-green); box-shadow: 0 0 0 3px rgba(23,201,100,0.18); }
    .dv-list { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 6px 0 18px; }
    .dv-empty { margin: auto; text-align: center; color: var(--adm-txt2); font-size: 13.5px; line-height: 1.6; padding: 40px 12px; }
    .dv-msg { max-width: 88%; padding: 10px 14px; border-radius: 20px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
    .dv-msg.user { align-self: flex-end; background: #fff; color: #000; border-bottom-right-radius: 6px; }
    .dv-msg.assistant { align-self: flex-start; background: #1f1f23; color: #fff; border-bottom-left-radius: 6px; }
    .dv-msg pre { background: rgba(0,0,0,0.45); border-radius: 10px; padding: 9px 11px; overflow-x: auto; font-size: 12.5px; white-space: pre; margin: 6px 0; }
    .dv-msg.user pre { background: rgba(0,0,0,0.07); }
    .dv-msg code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
    .dv-msg :not(pre) > code { background: rgba(255,255,255,0.12); padding: 1px 5px; border-radius: 5px; }
    .dv-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
    .dv-files img, .dv-files video { max-width: 180px; max-height: 180px; border-radius: 12px; display: block; background: #111; }
    .dv-files .dv-fchip { font-size: 12px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,0.08); }
    .dv-tools { align-self: flex-start; display: flex; flex-direction: column; gap: 3px; margin: -4px 0 0 10px; font-size: 11.5px; color: var(--adm-txt2); max-width: 88%; }
    .dv-tools span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dv-meta { align-self: flex-start; font-size: 11px; color: var(--adm-txt2); margin: -4px 0 0 10px; }
    .dv-meta.user { align-self: flex-end; margin: -4px 10px 0 0; }
    .dv-typing { display: inline-flex; gap: 4px; padding: 3px 0; } .dv-typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.55); animation: dvDot 1.2s infinite ease-in-out; }
    .dv-typing i:nth-child(2) { animation-delay: .15s; } .dv-typing i:nth-child(3) { animation-delay: .3s; }
    @keyframes dvDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
    .dv-bar { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 10px 0 calc(env(safe-area-inset-bottom) + 96px); background: linear-gradient(transparent, var(--adm-bg) 28%); }
    .dv-bar textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 160px; resize: none; border: 1px solid var(--adm-border); outline: none; border-radius: 21px;
        background: #141416; color: #fff; padding: 11px 16px; font: inherit; font-size: 15px; line-height: 1.35; box-sizing: border-box; }
    .dv-ib { width: 42px; height: 42px; border-radius: 50%; border: none; flex: none; display: flex; align-items: center; justify-content: center; font-size: 21px; cursor: pointer;
        background: #1c1c1f; color: #fff; }
    .dv-ib.send { background: #fff; color: #000; } .dv-ib.stop { background: var(--adm-danger); color: #fff; }
    .dv-ib:active { transform: scale(0.9); }
    .dv-pend { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 6px; } .dv-pend span { font-size: 12px; background: #1c1c1f; border-radius: 10px; padding: 5px 9px; }
    .dv-pend img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; display: block; }
    /* ⚡ แชทแบบเรียลไทม์: แต่ละข้อความเป็นแถวของตัวเอง (อัปเดตเฉพาะส่วนที่เปลี่ยน ไม่วาดใหม่ทั้งรายการ) */
    .dv-row { display: flex; flex-direction: column; gap: 4px; }
    .dv-row.user { align-items: flex-end; } .dv-row.assistant { align-items: flex-start; }
    .dv-row .dv-meta, .dv-row .dv-tools { margin: 0 10px; }
    .dv-row .dv-sep { align-self: center; margin: 6px 0; }
    .dv-row.in { animation: dvIn .22s cubic-bezier(.2,.8,.3,1); }
    @keyframes dvIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
    .dv-row.sending .dv-msg { opacity: .65; }
    .dv-row.failed .dv-msg { opacity: .5; }
    .dv-meta .dv-fail { color: var(--adm-danger); cursor: pointer; }
    .dv-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: rgba(255,255,255,.7); animation: dvBlink 1s steps(1) infinite; }
    @keyframes dvBlink { 50% { opacity: 0; } }
    .dv-tools .dv-live { color: #fff; animation: dvPulse 1.4s ease-in-out infinite; }
    @keyframes dvPulse { 50% { opacity: .45; } }
    .dv-tools details summary { cursor: pointer; list-style: none; } .dv-tools details summary::-webkit-details-marker { display: none; }
    .dv-tools details[open] { display: flex; flex-direction: column; gap: 3px; }

    /* ── 📊 ทรัพยากรระบบ (MongoDB · R2 · แรม) — โทนขาว/เทา/ดำ ── */
    .adm-res-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
    .adm-res-gauge { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 22px; padding: 16px 8px 14px;
        display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
    .adm-res-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; position: relative;
        background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,0.08) 0); transition: --p 0.6s; }
    .adm-res-ring::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--adm-surface); }
    .adm-res-ring b { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 900; letter-spacing: -0.5px; }
    .adm-res-ring.warn { background: conic-gradient(var(--adm-warn) calc(var(--p) * 1%), rgba(255,255,255,0.08) 0); }
    .adm-res-ring.bad { background: conic-gradient(var(--adm-danger) calc(var(--p) * 1%), rgba(255,255,255,0.08) 0); }
    .adm-res-name { font-size: 13px; font-weight: 800; color: var(--adm-txt); }
    .adm-res-sub { font-size: 11px; font-weight: 600; color: var(--adm-txt2); line-height: 1.35; }
    .adm-res-card { padding: 16px; }
    .adm-res-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .adm-res-head .adm-menu-icon { width: 34px; height: 34px; font-size: 20px; }
    .adm-res-head b { font-size: 15px; font-weight: 800; flex: 1; }
    .adm-res-head small { font-size: 11px; color: var(--adm-txt2); font-weight: 600; }
    .adm-res-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .adm-res-kv > div { background: var(--adm-surface2); border-radius: 14px; padding: 10px 12px; }
    .adm-res-kv span { display: block; font-size: 11px; font-weight: 600; color: var(--adm-txt2); margin-bottom: 3px; }
    .adm-res-kv strong { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
    .adm-res-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 12px 0 6px; }
    .adm-res-bar i { display: block; height: 100%; border-radius: 4px; background: #fff; transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1); }
    .adm-res-bar.warn i { background: var(--adm-warn); } .adm-res-bar.bad i { background: var(--adm-danger); }
    .adm-res-barlbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--adm-txt2); font-weight: 600; }
    .adm-res-top { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
    .adm-res-top-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12.5px; }
    .adm-res-top-row span { color: var(--adm-txt); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .adm-res-top-row em { font-style: normal; color: var(--adm-txt2); font-weight: 600; }
    .adm-res-top-row i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.75); }
    .adm-res-btn { border: 1px solid var(--adm-border); background: transparent; color: var(--adm-txt); border-radius: 12px; padding: 7px 12px; font: 700 12px/1 inherit; cursor: pointer; }
    .adm-res-btn:active { transform: scale(0.95); }
    .adm-res-err { font-size: 12.5px; color: var(--adm-danger); padding: 6px 2px; }
    @media (max-width: 380px) { .adm-res-ring { width: 64px; height: 64px; } .adm-res-ring b { font-size: 15px; } }

    /* ── 🤖 บอทอัตโนมัติ ── */
    .adm-bot-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
    .adm-bot-stats .adm-stat-card { padding: 14px 6px; }
    .adm-bot-create { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
    .adm-bot-create-row { display: flex; gap: 8px; }
    .adm-bot-create-row input { flex: 1; min-width: 0; }
    .adm-bot-quick { display: flex; gap: 6px; flex-wrap: wrap; }
    .adm-bot-quick button { border: 1px solid var(--adm-border); background: var(--adm-surface2); color: var(--adm-txt); border-radius: 10px; padding: 6px 12px; font: 700 12px/1 inherit; cursor: pointer; }
    .adm-bot-prog { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
    .adm-bot-prog i { display: block; height: 100%; background: #fff; transition: width 0.3s; }
    .adm-bot-note { font-size: 12px; color: var(--adm-txt2); line-height: 1.5; }
    .adm-bot-slider { padding: 14px 16px; border-bottom: 1px solid var(--adm-border); }
    .adm-bot-slider:last-child { border-bottom: none; }
    .adm-bot-slider-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
    .adm-bot-slider-top b { font-size: 14px; font-weight: 700; }
    .adm-bot-slider-top span { font-size: 13px; font-weight: 800; color: var(--adm-txt); font-variant-numeric: tabular-nums; }
    .adm-bot-slider small { display: block; font-size: 11.5px; color: var(--adm-txt2); margin-top: 6px; }
    .adm-bot-slider input[type=range] { width: 100%; accent-color: #fff; }
    .adm-bot-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 16px; }
    .adm-bot-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--adm-surface2); border-radius: 12px; padding: 7px 11px; font-size: 12.5px; font-weight: 700; }
    .adm-bot-chip i { font-size: 15px; color: var(--adm-txt2); }
    .adm-bot-danger { width: 100%; border: 1px solid rgba(237,73,86,0.4); background: rgba(237,73,86,0.08); color: var(--adm-danger); border-radius: 16px; padding: 14px; font: 800 14px/1 inherit; cursor: pointer; }

