/* =====================================================================
   Threads Inbox — gaya tampilan
   Prinsip: tenang, lega, satu warna aksen. Semua ukuran huruf memakai
   skala di :root supaya proporsional di semua layar. Warna & ukuran
   diatur lewat variabel supaya mudah diganti tanpa mencari di seluruh file.
   ===================================================================== */

:root {
    /* Warna */
    --paper: #f4f5f7;        /* latar aplikasi */
    --surface: #ffffff;      /* panel, kartu, bubble masuk */
    --ink: #16181d;          /* teks utama */
    --ink-2: #464b57;        /* teks sekunder */
    --muted: #7c8190;        /* keterangan kecil */
    --line: #e3e5ea;         /* garis pemisah */
    --line-strong: #d3d6de;  /* garis yang perlu sedikit lebih terlihat (scrollbar, hover) */
    --accent: #3542d8;       /* warna utama: tombol, bubble keluar */
    --accent-hover: #2c38c4;
    --accent-ink: #ffffff;
    --accent-soft: #eef0fd;
    --danger: #b9382e;
    --danger-soft: #fbeceb;
    --success: #1e7b4b;
    --success-soft: #e8f4ed;

    /* Huruf: sans yang proporsional untuk antarmuka, serif untuk momen "display" */
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Newsreader", Georgia, "Times New Roman", serif;

    /* Skala ukuran huruf. Pakai variabel ini, jangan angka acak, supaya hierarki tetap rapi. */
    --text-2xs: 11.5px;   /* waktu & status kecil */
    --text-xs: 12.5px;    /* label, keterangan */
    --text-sm: 13.5px;    /* pratinjau, teks bantu */
    --text-md: 14.5px;    /* teks antarmuka utama */
    --text-lg: 15px;      /* isi pesan, nama di kepala percakapan */
    --text-xl: 20px;      /* judul panel */
    --text-2xl: 30px;     /* judul display kecil */
    --text-3xl: 36px;     /* judul display halaman login */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --sidebar-width: 360px;
    --content-width: 680px;  /* lebar maksimal percakapan supaya baris teks tidak terlalu panjang */

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0e0f13;
        --surface: #16181d;
        --ink: #ecedf1;
        --ink-2: #b9bdc8;
        --muted: #8a8f9c;
        --line: #25282f;
        --line-strong: #343842;
        --accent: #8c96ff;
        --accent-hover: #a3abff;
        --accent-ink: #0e0f13;
        --accent-soft: #1b1e36;
        --danger: #f08a80;
        --danger-soft: #2c1816;
        --success: #6fcf9a;
        --success-soft: #142a1e;
        color-scheme: dark;
    }
}

/* ---------- Dasar ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Elemen dengan atribut hidden harus selalu tersembunyi, apa pun display-nya. */
[hidden] { display: none !important; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--text-md)/1.55 var(--font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); }

button, input, textarea { font: inherit; color: inherit; }

::placeholder { color: var(--muted); opacity: 1; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 20px; height: 20px; flex: none; }

/* Judul besar memakai serif. Hanya untuk momen tertentu (login, hubungkan, layar kosong). */
.display {
    font-family: var(--font-display);
    font-weight: 500;
    font-optical-sizing: auto;
    letter-spacing: -0.015em;
    line-height: 1.12;
}

/* Angka (jam, jumlah) dibuat sama lebar supaya tidak "bergoyang" saat berubah. */
.count, .chat-time, .chat-badge, .msg-meta, #char-count { font-variant-numeric: tabular-nums; }

/* Scrollbar tipis supaya panel tetap bersih. */
.chat-list, .messages, .attachments { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- Tombol ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--radius-md);
    font-size: var(--text-md); font-weight: 600; letter-spacing: -0.005em;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }

.icon-button {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 10px;
    background: transparent; color: var(--muted);
    cursor: pointer; list-style: none;
    transition: background-color .15s, color .15s;
}
.icon-button:hover { background: var(--paper); color: var(--ink); }
.icon-button.is-busy .icon { animation: spin 1s linear infinite; }

.link-button {
    border: 0; padding: 0; background: none;
    color: var(--accent); font-weight: 600; cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pesan pemberitahuan ---------- */

.notice {
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: var(--text-sm); line-height: 1.45;
}
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-success { background: var(--success-soft); color: var(--success); }

/* ---------- Halaman login & hubungkan ---------- */

.auth {
    min-height: 100%;
    display: grid; place-items: center;
    padding: 48px 16px;
}

/* Satu lembar putih di atas latar abu-abu: cukup garis tipis, tanpa bayangan. */
.auth-card {
    width: 100%; max-width: 420px;
    display: grid; gap: 22px;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

/* Logo selalu memakai warna merek asli (tidak ikut warna aksen mode gelap yang lebih terang). */
.brand-mark { width: 36px; height: 36px; color: #3542d8; margin-bottom: 6px; }

.auth-card .display { font-size: var(--text-3xl); }

/* Judul dan kalimat pembuka dibuat berdekatan supaya terbaca sebagai satu kelompok. */
.auth-card .display + .lede { margin-top: -12px; }

.lede { color: var(--ink-2); font-size: var(--text-md); line-height: 1.6; }

.form { display: grid; gap: 16px; margin-top: 2px; }

.field { display: grid; gap: 7px; font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); }

.field input {
    height: 46px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: var(--radius-md);
    background: var(--surface); color: var(--ink);
    font-size: var(--text-md); font-weight: 400;
    transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: var(--line-strong); }
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.form .btn { margin-top: 6px; }

.checklist {
    margin: 0; padding: 16px 18px;
    list-style: none;
    background: var(--paper); border-radius: var(--radius-md);
    display: grid; gap: 10px;
    color: var(--ink-2); font-size: var(--text-sm);
}
.checklist li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
/* Tanda centang digambar dengan CSS mask supaya warnanya ikut variabel aksen. */
.checklist li::before {
    content: ""; flex: none;
    width: 16px; height: 16px; margin-top: 2px;
    background: var(--accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 18px; border-top: 1px solid var(--line);
    font-size: var(--text-sm); color: var(--muted);
}

/* ---------- Kerangka aplikasi ---------- */

.page-app { overflow: hidden; }

.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh; height: 100dvh;
}

/* ---------- Panel kiri ---------- */

.sidebar {
    display: flex; flex-direction: column; min-height: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 14px 14px 20px;
}

.sidebar-title { display: flex; align-items: center; gap: 10px; }
.sidebar-title h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }

.count {
    min-width: 22px; height: 22px; padding: 0 7px;
    border-radius: 11px;
    background: var(--accent-soft); color: var(--accent);
    font-size: var(--text-2xs); font-weight: 700; line-height: 22px; text-align: center;
}

/* Filter berbentuk "segmented control": satu jalur abu-abu, pilihan aktif berwarna putih. */
.filters {
    display: flex; gap: 2px;
    margin: 0 16px 10px; padding: 3px;
    background: var(--paper); border-radius: 10px;
}
.filter {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    height: 30px; padding: 0 8px;
    border: 0; border-radius: 8px;
    background: transparent; color: var(--muted);
    font-size: var(--text-xs); font-weight: 600; cursor: pointer;
    transition: color .15s, background-color .15s;
}
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

.sidebar > .notice { margin: 2px 16px 10px; }

.chat-list {
    flex: 1; min-height: 0; overflow-y: auto;
    margin: 0; padding: 4px 8px 12px; list-style: none;
}

.chat-item {
    width: 100%;
    display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center;
    padding: 11px 12px; border: 0; border-radius: var(--radius-md);
    background: transparent; text-align: left; cursor: pointer;
    transition: background-color .12s;
}
.chat-item:hover { background: var(--paper); }
.chat-item.is-active { background: var(--accent-soft); }

.chat-main { min-width: 0; display: grid; gap: 2px; }

.chat-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }

.chat-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--text-md); font-weight: 600; letter-spacing: -0.01em;
}
.chat-kind { flex: none; font-size: var(--text-2xs); color: var(--muted); }
.chat-time { margin-left: auto; flex: none; font-size: var(--text-2xs); color: var(--muted); }

.chat-preview {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--text-sm); color: var(--muted);
}

/* Belum dibaca: nama lebih tebal, pratinjau lebih gelap, plus angka kecil. Tanpa warna tambahan lain. */
.chat-item.is-unread .chat-name { font-weight: 700; }
.chat-item.is-unread .chat-preview { color: var(--ink-2); }
.chat-item.is-unread .chat-time { color: var(--accent); font-weight: 600; }

.chat-badge {
    flex: none; align-self: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}

.list-empty {
    padding: 48px 24px; text-align: center;
    color: var(--muted); font-size: var(--text-sm); line-height: 1.6;
}
.list-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: var(--text-md); font-weight: 600; }

.sidebar-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 12px 12px 20px;
    border-top: 1px solid var(--line);
}

.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-text { display: grid; min-width: 0; font-size: var(--text-xs); line-height: 1.35; }
.me-text strong { font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu { position: relative; }
.menu summary::-webkit-details-marker { display: none; }
/* Menu melayang memang perlu bayangan supaya terpisah dari isi di belakangnya. */
.menu-panel {
    position: absolute; right: 0; bottom: 44px; z-index: 10;
    min-width: 200px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(16, 18, 24, .10);
}
.menu-panel button {
    width: 100%; padding: 9px 12px;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; text-align: left; font-size: var(--text-sm); cursor: pointer;
}
.menu-panel button:hover { background: var(--paper); }

/* ---------- Avatar ---------- */

.avatar {
    width: 42px; height: 42px; flex: none;
    border-radius: 50%; object-fit: cover;
    background: var(--line);
}
.avatar-sm { width: 34px; height: 34px; }
.avatar-initial {
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: var(--text-md);
}
.avatar-sm.avatar-initial { font-size: var(--text-xs); }

/* ---------- Panel kanan ---------- */

.conversation { position: relative; min-width: 0; min-height: 0; display: flex; }

.empty-state {
    margin: auto; padding: 24px;
    max-width: 340px; text-align: center;
    display: grid; gap: 10px;
    color: var(--muted); font-size: var(--text-sm); line-height: 1.6;
}
.empty-state .display { font-size: var(--text-2xl); color: var(--ink); }

.thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.thread-head {
    display: flex; align-items: center; gap: 12px;
    height: 64px; flex: none; padding: 0 16px 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.thread-avatar { display: flex; flex: none; }
.thread-avatar .avatar { width: 38px; height: 38px; }
.thread-who { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.thread-who strong { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-who span { font-size: var(--text-xs); color: var(--muted); }

.back-button { display: none; }

.messages {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 36px 24px 16px;
}
.messages > * { max-width: var(--content-width); margin-left: auto; margin-right: auto; }

/* Postingan asal: satu-satunya elemen "berani" — serif dengan garis aksen di kiri. */
.context {
    margin-top: 0; margin-bottom: 32px;
    padding: 2px 0 2px 20px;
    border-left: 2px solid var(--accent);
}
.context-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.context p {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: 19px; line-height: 1.5; letter-spacing: -0.005em;
    color: var(--ink);
    white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Pemisah hari: teks kecil di tengah dengan garis tipis di kiri-kanan. */
.day-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 4px auto 22px;
    font-size: var(--text-2xs); font-weight: 600; color: var(--muted);
}
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Bubble pesan */
.msg { display: flex; flex-direction: column; margin-bottom: 18px; }
.msg-in { align-items: flex-start; }
.msg-out { align-items: flex-end; }

.msg-author { font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); margin: 0 8px 6px; }

.bubble {
    max-width: min(76%, 520px);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: var(--text-lg); line-height: 1.5;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-in .bubble {
    background: var(--surface); border: 1px solid var(--line);
    border-bottom-left-radius: 6px;
}
.msg-out .bubble {
    background: var(--accent); color: var(--accent-ink);
    border-bottom-right-radius: 6px;
}
.msg-out.is-failed .bubble { opacity: .5; }
.bubble.has-media { padding: 4px; }
.bubble.has-media .bubble-text { padding: 8px 12px 6px; }

.media-grid { display: grid; gap: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-grid.is-single { grid-template-columns: 1fr; }
.media-grid a { display: block; }
.media-grid img, .media-grid video {
    display: block; width: 100%; max-height: 280px; object-fit: cover;
    border-radius: 16px; background: var(--line);
}
.media-grid.is-single img, .media-grid.is-single video { max-height: 360px; object-fit: contain; }

.msg-meta {
    display: flex; gap: 10px; align-items: center;
    margin: 6px 8px 0; font-size: var(--text-2xs); color: var(--muted);
}
.msg-meta a { color: inherit; text-decoration: none; }
.msg-meta a:hover { color: var(--ink); text-decoration: underline; }
.msg-status-processing { color: var(--ink-2); }
.msg-status-failed { color: var(--danger); font-weight: 600; }

.msg-error { max-width: min(76%, 520px); margin: 4px 8px 0; font-size: var(--text-xs); line-height: 1.45; color: var(--danger); text-align: right; }

/* ---------- Kolom balasan ---------- */

.composer {
    flex: none;
    padding: 8px 24px 18px;
}
.composer > * { max-width: var(--content-width); margin-left: auto; margin-right: auto; }

.composer-target { font-size: var(--text-xs); color: var(--muted); margin-bottom: 8px; padding: 0 6px; }
.composer-target strong { color: var(--ink-2); font-weight: 600; }

.composer-error {
    margin-bottom: 8px; padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--danger-soft); color: var(--danger); font-size: var(--text-sm);
}

/* Kotak tulis: permukaan putih bergaris tipis, menyala lembut saat aktif. */
.composer-row {
    display: flex; align-items: flex-end; gap: 4px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.composer-row:hover { border-color: var(--line-strong); }
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.attach-button { flex: none; }

.composer textarea {
    flex: 1; min-height: 36px; max-height: 160px;
    padding: 7px 6px; resize: none;
    border: 0; background: transparent; outline: none;
    font-size: var(--text-lg); line-height: 1.45;
}

.send-button {
    flex: none; display: grid; place-items: center;
    width: 36px; height: 36px;
    border: 0; border-radius: 11px;
    background: var(--accent); color: var(--accent-ink);
    cursor: pointer;
    transition: background-color .15s;
}
.send-button:hover:not(:disabled) { background: var(--accent-hover); }
.send-button:disabled { background: transparent; color: var(--muted); cursor: default; }
.send-button .icon { width: 18px; height: 18px; }

.composer-meta {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 8px; padding: 0 8px;
    font-size: var(--text-2xs); color: var(--muted);
}
.composer-meta .is-over { color: var(--danger); font-weight: 600; }

.attachments { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.attachment {
    position: relative; flex: none;
    width: 68px; height: 68px;
    border-radius: var(--radius-md); overflow: hidden;
    background: var(--line);
}
.attachment img, .attachment video { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-kind {
    position: absolute; left: 5px; bottom: 5px;
    padding: 0 6px; border-radius: 5px;
    background: rgba(0, 0, 0, .6); color: #fff;
    font-size: 10.5px; font-weight: 600; line-height: 17px;
}
.attachment-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; padding: 0;
    border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, .6); color: #fff;
    font-size: 15px; line-height: 22px; cursor: pointer;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 20;
    transform: translateX(-50%);
    max-width: min(480px, calc(100% - 32px));
    padding: 11px 16px; border-radius: var(--radius-md);
    background: var(--ink); color: var(--surface);
    font-size: var(--text-sm); line-height: 1.45;
    box-shadow: 0 10px 30px rgba(16, 18, 24, .18);
}

/* ---------- Halaman dokumen (privasi, ketentuan) ---------- */

/* Lebar baris dibatasi supaya teks panjang nyaman dibaca. */
.doc { max-width: 720px; margin: 0 auto; padding: 64px 24px 80px; }

.doc-head {
    display: grid; gap: 14px;
    margin-bottom: 40px; padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}
.doc-head a { display: inline-flex; width: max-content; }
.doc-head .display { font-size: var(--text-3xl); }
.doc-meta { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }

.doc h2 { margin: 36px 0 10px; font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--ink-2); line-height: 1.7; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { margin: 10px 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.doc li::marker { color: var(--muted); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--accent); text-underline-offset: 2px; }

.doc-en { margin-top: 48px; padding-top: 4px; border-top: 1px solid var(--line); }

.doc-foot {
    display: flex; flex-wrap: wrap; gap: 20px;
    margin-top: 48px; padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: var(--text-sm);
}
.doc-foot a, .auth-links a { color: var(--muted); text-decoration: none; }
.doc-foot a:hover, .auth-links a:hover { color: var(--ink); text-decoration: underline; }

/* Tautan kecil di bawah form login & halaman status (privasi dan ketentuan). */
.auth-links { display: flex; justify-content: center; gap: 20px; font-size: var(--text-xs); }

/* Daftar fakta (kode konfirmasi, tanggal) di halaman status penghapusan data. */
.facts {
    margin: 0; display: grid; gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md);
    overflow: hidden;
}
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--surface); font-size: var(--text-sm); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Layar kecil (HP) ---------- */

@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .conversation { display: none; }
    .app.show-thread .sidebar { display: none; }
    .app.show-thread .conversation { display: flex; }
    .sidebar { border-right: 0; }
    .sidebar-head { padding: 16px 10px 12px 16px; }
    .filters { margin: 0 12px 8px; }
    .sidebar > .notice { margin: 2px 12px 8px; }
    .chat-list { padding: 4px 4px 12px; }
    .sidebar-foot { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) 16px; }
    .back-button { display: inline-grid; margin-left: -6px; }
    .thread-head { height: 58px; padding: 0 10px; gap: 10px; }
    .messages { padding: 22px 14px 8px; }
    .composer { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
    .bubble, .msg-error { max-width: 86%; }
    .bubble { font-size: var(--text-md); }
    .context { margin-bottom: 26px; padding-left: 16px; }
    .context p { font-size: 17.5px; }
    .composer-meta span:first-child { display: none; }
    .composer-meta { justify-content: flex-end; }
}

/* Halaman login di HP: tanpa lembar putih, langsung di atas latar supaya lapang. */
@media (max-width: 480px) {
    .auth { place-items: start center; padding: 56px 20px 32px; }
    .auth-card { padding: 0; background: transparent; border: 0; border-radius: 0; }
    .auth-card .display { font-size: var(--text-2xl); }
    .doc { padding: 40px 20px 56px; }
    .doc-head .display { font-size: var(--text-2xl); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
