/* External links: never let custom intent:// URLs navigate inside NERI's WebView. */
.message-content a.as-external-link{
    cursor:pointer;
    text-decoration:underline;
    text-decoration-thickness:1px;
    text-underline-offset:2px;
}
.message-content a.as-external-link::after{
    content:" ↗";
    font-size:.82em;
    opacity:.7;
}

/* MODE MAINTENANCE — full-screen, ngeblok interaksi ke app di baliknya
   selama flag "maintenance" dari val.town nyala. */
.maintenance-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.maintenance-card { background: var(--bg-sidebar); border: 1px solid var(--border-modal); border-radius: 18px; padding: 32px 26px; max-width: 340px; width: 100%; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.maintenance-icon { font-size: 40px; margin-bottom: 10px; }
.maintenance-title { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.maintenance-message { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 20px; white-space: pre-line; }
.maintenance-retry-btn { background: var(--accent-solid); color: var(--accent-solid-text); border: none; padding: 10px 22px; border-radius: 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.maintenance-retry-btn:disabled { opacity: 0.6; cursor: default; }

/* ==== NERI FOR STUDENTS ==== */
.students-page { display: flex; flex-direction: column; height: 100vh; background: var(--bg-body); color: var(--text-main); }
.students-topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-modal); flex-shrink: 0; }
.students-back-btn { background: none; border: none; font-size: 20px; color: var(--text-main); cursor: pointer; padding: 4px 8px; }
.students-topbar-title { font-weight: 800; font-size: 15px; flex: 1; }
.students-xp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 14px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--text-main); }

.students-screen { flex: 1; overflow-y: auto; padding: 20px 18px 40px; }
.students-heading { font-size: 18px; font-weight: 800; margin-bottom: 18px; text-align: center; }

.students-lang-grid, .students-level-grid { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.students-lang-card, .students-level-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--bg-input-wrapper); border: 1.5px solid var(--border-modal); border-radius: 16px; padding: 18px; cursor: pointer; text-align: center; transition: transform .15s, border-color .15s; }
.students-lang-card:active, .students-level-card:active { transform: scale(.97); }
.students-lang-flag { font-size: 34px; }
.students-lang-name { font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.students-lang-native { font-size: 12px; color: var(--text-muted); }
.students-level-name { font-weight: 800; font-size: 15px; }
.students-level-desc { font-size: 12px; color: var(--text-muted); }
.students-level-progress { font-size: 11px; color: var(--text-main); font-weight: 700; margin-top: 4px; }

.students-path-summary { max-width: 420px; margin: 0 auto 20px; text-align: center; }
.students-path-title { font-weight: 800; font-size: 15px; }
.students-path-xp { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.students-unit-path { display: flex; flex-direction: column; align-items: center; max-width: 420px; margin: 0 auto; }
.students-unit-row { display: flex; flex-direction: column; align-items: center; }
.students-unit-row:nth-child(even) { align-self: flex-end; margin-right: 12%; }
.students-unit-row:nth-child(odd) { align-self: flex-start; margin-left: 12%; }
.students-unit-node { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; border: none; cursor: pointer; transition: transform .15s; }
.students-unit-node:active:not(:disabled) { transform: scale(.94); }
.students-unit-node.locked { background: var(--bg-input-wrapper); color: var(--text-muted); cursor: not-allowed; box-shadow: 0 4px 0 var(--border-modal); }
.students-unit-node.unlocked { background: var(--accent-solid); color: var(--accent-solid-text); box-shadow: 0 4px 0 var(--accent-solid-hover); }
.students-unit-node.completed { background: var(--bg-input-wrapper); color: var(--text-main); border: 2px solid var(--text-main); box-shadow: 0 4px 0 var(--border-modal); }
.students-unit-label { text-align: center; font-size: 11.5px; font-weight: 700; max-width: 110px; margin-top: 8px; margin-bottom: 28px; }
.students-unit-xp-tag { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-top: 2px; }

.students-progress-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.students-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); }
.students-dot.active { background: var(--text-main); border-color: var(--text-main); }
.students-dot.done { background: var(--text-muted); border-color: var(--text-muted); }

.students-exercise-card { max-width: 440px; margin: 0 auto; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 18px; padding: 24px 20px; text-align: center; }
.students-exercise-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px; }
.students-exercise-sentence { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 10px; }
.students-exercise-hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; min-height: 16px; }
.students-exercise-input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-modal); background: var(--bg-body); color: var(--text-main); font-size: 15px; text-align: center; outline: none; margin-bottom: 14px; }
.students-exercise-input:focus { border-color: var(--accent-focus); }
.students-exercise-feedback { font-size: 13.5px; font-weight: 600; min-height: 20px; margin-bottom: 14px; }
.students-exercise-feedback.correct { color: var(--text-main); }
.students-exercise-feedback.wrong { color: #ef5350; }
.students-primary-btn { background: var(--accent-solid); color: var(--accent-solid-text); border: none; padding: 12px 28px; border-radius: 14px; font-size: 14.5px; font-weight: 800; cursor: pointer; width: 100%; }
.students-primary-btn:active { transform: scale(.98); }

.students-convo-box { max-width: 460px; margin: 0 auto; min-height: 200px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.students-convo-bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.students-convo-bubble.tutor { align-self: flex-start; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-bottom-left-radius: 4px; }
.students-convo-bubble.user { align-self: flex-end; background: var(--bg-user-msg); color: var(--text-user-msg); border-bottom-right-radius: 4px; }
.students-convo-bubble.loading { opacity: .6; font-style: italic; }
.students-convo-loading { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px 0; }
.students-convo-input-row { max-width: 460px; margin: 14px auto 0; display: flex; gap: 8px; }
.students-convo-input-row .students-exercise-input { margin-bottom: 0; text-align: left; }
.students-send-btn { background: var(--accent-solid); color: var(--accent-solid-text); border: none; width: 44px; border-radius: 12px; font-size: 17px; cursor: pointer; flex-shrink: 0; }

.students-results-card { max-width: 360px; margin: 40px auto 0; text-align: center; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 20px; padding: 34px 24px; }
.students-results-icon { font-size: 46px; margin-bottom: 8px; }
.students-results-title { font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.students-results-xp { font-size: 24px; font-weight: 900; color: var(--text-main); margin-bottom: 8px; }
.students-results-detail { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }

/* MATHEMATICS / LATEX RENDERING */
.message-content .katex { font-size: 1.08em; }
.message-content .katex-display { margin: 1em 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
/* ==== CHANGELOG / UPDATE NOTIFICATION ==== */
    .changelog-bell-btn {
        position: relative; background: transparent; border: none;
        color: var(--text-main); font-size: 19px; cursor: pointer;
        width: 40px; height: 40px; border-radius: 50%;
        transition: background .2s, transform .2s;
    }
    .changelog-bell-btn:hover { background: var(--text-hover); }
    .changelog-bell-btn:active { transform: scale(.92); }
    .changelog-bell-dot {
        position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
        border-radius: 50%; background: #ef5350;
        border: 2px solid var(--bg-body); display: none;
    }
    .changelog-bell-dot.visible { display: block; }
    .changelog-overlay {
        position: fixed; inset: 0; z-index: 800; background: rgba(0,0,0,.62);
        backdrop-filter: blur(5px); display: none; align-items: center;
        justify-content: center; padding: 20px; animation: fadeInOverlay .2s ease;
    }
    .changelog-overlay.show { display: flex; }
    .changelog-card {
        width: min(430px, 100%); max-height: min(680px, 88vh); overflow-y: auto;
        background: var(--bg-modal); color: var(--text-main);
        border: 1px solid var(--border-modal); border-radius: 22px;
        box-shadow: 0 18px 60px rgba(0,0,0,.42);
        animation: scaleUp .22s cubic-bezier(.16,1,.3,1);
    }
    .changelog-header {
        display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 16px;
        border-bottom: 1px solid var(--border-modal);
    }
    .changelog-icon {
        width: 42px; height: 42px; border-radius: 14px; display: grid;
        place-items: center; background: var(--bg-input-wrapper);
        border: 1px solid var(--border-modal); font-size: 21px; flex-shrink: 0;
    }
    .changelog-title-wrap { flex: 1; min-width: 0; }
    .changelog-kicker {
        color: var(--text-muted); font-size: 10.5px; font-weight: 800;
        letter-spacing: .8px; text-transform: uppercase; margin-bottom: 3px;
    }
    .changelog-title { font-size: 19px; font-weight: 850; line-height: 1.2; }
    .changelog-version {
        display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 10px;
        background: var(--text-main); color: var(--bg-body);
        font-size: 10.5px; font-weight: 800;
    }
    .changelog-close {
        background: transparent; border: none; color: var(--text-muted);
        cursor: pointer; font-size: 18px; padding: 2px 4px;
    }
    .changelog-body { padding: 18px 22px 8px; }
    .changelog-intro {
        font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px;
    }
    .changelog-list { display: flex; flex-direction: column; gap: 10px; }
    .changelog-item {
        display: flex; gap: 11px; padding: 12px 13px;
        border: 1px solid var(--border-modal); border-radius: 14px;
        background: var(--bg-input-wrapper);
    }
    .changelog-item-icon { font-size: 17px; flex-shrink: 0; }
    .changelog-item-title { font-size: 13px; font-weight: 800; margin-bottom: 3px; }
    .changelog-item-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
    .changelog-footer {
        display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px;
    }
    .changelog-action {
        border: none; padding: 10px 17px; border-radius: 12px;
        background: var(--accent-solid); color: var(--accent-solid-text);
        font-weight: 800; font-size: 12.5px; cursor: pointer;
    }
    .changelog-action.secondary {
        background: var(--bg-input-wrapper); color: var(--text-main);
        border: 1px solid var(--border-modal);
    }
:root {
        --bg-body: #131314;
        --bg-sidebar: #1e1f20;
        --bg-chat-custom: transparent;
        --text-main: #e3e3e3;
        --text-muted: #aaaaaa;
        --bg-user-msg: #282a2c;
        --text-user-msg: #ffffff;
        --bg-bot-msg: transparent;
        --bg-code-header: #1e1f20;
        --bg-code-box: #0f1011;
        --bg-input-wrapper: #1e1f20;
        --border-input: transparent;
        --bg-thinking: #1a1b1c;
        --bg-modal: #1e1f20;
        --border-modal: #333335;
        --input-text-color: #fff;
        --bg-dropdown: #282a2c;
        --text-hover: #3c4043;
        --toggle-inactive-bg: #282a2c;
        --toggle-active-bg: rgba(255, 255, 255, 0.12);
        --toggle-active-border: rgba(255, 255, 255, 0.55);
        --toggle-active-text: #ffffff;
        --accent-solid: #e9e9ea;
        --accent-solid-hover: #cfcfd0;
        --accent-solid-text: #131314;
        --accent-focus: rgba(255, 255, 255, 0.35);
    }

    [data-theme="light"] {
        --bg-body: #ffffff;
        --bg-sidebar: #f8f9fa;
        --bg-chat-custom: transparent;
        --text-main: #1f1f1f;
        --text-muted: #5f6368;
        --bg-user-msg: #e9eef6;
        --text-user-msg: #1f1f1f;
        --bg-bot-msg: transparent;
        --bg-code-header: #e1e3e4;
        --bg-code-box: #f0f2f4;
        --bg-input-wrapper: #f1f3f4;
        --border-input: #dadce0;
        --bg-thinking: #e9eef6;
        --bg-modal: #ffffff;
        --border-modal: #e0e0e0;
        --input-text-color: #1f1f1f;
        --bg-dropdown: #ffffff;
        --text-hover: #f1f3f4;
        --toggle-inactive-bg: #e1e3e4;
        --toggle-active-bg: rgba(0, 0, 0, 0.08);
        --toggle-active-border: rgba(0, 0, 0, 0.55);
        --toggle-active-text: #1f1f1f;
        --accent-solid: #1a1a1a;
        --accent-solid-hover: #333333;
        --accent-solid-text: #ffffff;
        --accent-focus: rgba(0, 0, 0, 0.3);
    }

    body[data-bg="cyber"] {
        background-color: #0a0b10;
        background-image: linear-gradient(rgba(18, 24, 38, 0.8) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 24, 38, 0.8) 1px, transparent 1px);
        background-size: 30px 30px;
        transition: background 0.4s ease;
    }
    body[data-bg="soft"] { 
        background: radial-gradient(circle at top right, #1f1a30, #0f1015); 
        transition: background 0.4s ease;
    }

    body[data-bubble="pink-love"] .message-wrapper.user .message-content {
        background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(255, 117, 140, 0.3) !important;
    }
    body[data-bubble="blue-ocean"] .message-wrapper.user .message-content {
        background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3) !important;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif; transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
    html { height: 100%; }
    body {
        display: flex; background-color: var(--bg-body); color: var(--text-main);
        height: 100vh; height: 100dvh; height: var(--app-height, 100dvh);
        overflow: hidden;
    }

    /* ANIMATED OVERLAY */
    .sidebar-overlay { 
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
        background: rgba(0,0,0,0.5); z-index: 150; backdrop-filter: blur(3px); 
        animation: fadeInOverlay 0.3s forwards ease;
    }

    .sidebar { width: 260px; max-width: 85vw; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-modal); display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 160; }
    .sidebar-header { padding: 14px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--border-modal); }
    .new-chat-btn { flex: 1; padding: 10px; background: var(--accent-solid); color: var(--accent-solid-text); border: none; border-radius: 20px; font-weight: bold; cursor: pointer; text-align: center; transition: transform 0.2s, background 0.2s; }
    .new-chat-btn:hover { background: var(--accent-solid-hover); transform: translateY(-1px); }
    .close-sidebar-btn { display: none; background: transparent; border: none; color: var(--text-main); font-size: 20px; cursor: pointer; padding: 0 8px; }

    /* SEARCH SIDEBAR — cari di judul & isi obrolan (nempel di bawah
       header, di atas daftar history). */
    .sidebar-search { display: flex; align-items: center; gap: 6px; margin: 10px 12px 6px; padding: 8px 10px; border-radius: 20px; background: var(--bg-body); border: 1px solid var(--border-modal); }
    .sidebar-search-icon { font-size: 12.5px; opacity: .6; flex-shrink: 0; }
    .sidebar-search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; color: var(--input-text-color); font-size: 13px; font-family: inherit; }
    .sidebar-search input::placeholder { color: var(--text-muted); }
    .sidebar-search-clear { display: none; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 4px; flex-shrink: 0; }
    .sidebar-search-clear.visible { display: flex; }
    .sidebar-search-clear:hover { color: #ef5350; }
    .history-item-main { display: flex; flex-direction: column; gap: 2px; overflow: hidden; flex: 1; min-width: 0; }
    .history-snippet { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
    .history-item mark, .history-snippet mark { background: rgba(66, 133, 244, 0.35); color: inherit; border-radius: 3px; padding: 0 1px; }
    .history-empty-search { padding: 28px 18px; text-align: center; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
    
    .chat-history-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
    .history-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text-main); cursor: pointer; transition: all 0.2s ease; }
    .history-item:hover { background-color: var(--text-hover); transform: translateX(3px); }
    .history-item.active { background-color: rgba(128, 128, 128, 0.18); font-weight: 600; color: var(--text-main); }
    .history-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
    .delete-chat-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; opacity: 0; transition: opacity 0.2s, color 0.2s; padding: 2px 6px; }
    .history-item:hover .delete-chat-btn { opacity: 1; }
    .delete-chat-btn:hover { color: #ef5350; }

    .app-container { flex: 1; display: flex; flex-direction: column; height: 100vh; height: 100dvh; height: var(--app-height, 100dvh); position: relative; min-width: 0; min-height: 0; }
    .top-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; padding-top: max(12px, env(safe-area-inset-top)); position: relative; z-index: 50; gap: 6px; }
    .header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
    .toggle-sidebar-btn { background: transparent; border: none; color: var(--text-main); font-size: 20px; cursor: pointer; transition: transform 0.2s; flex-shrink: 0; }
    .toggle-sidebar-btn:active { transform: scale(0.9); }
    .app-logo { font-size: 18px; font-weight: 500; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .model-badge { font-size: 11px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--text-muted); padding: 2px 8px; border-radius: 20px; font-weight: bold; margin-left: 6px; display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
    
    /* MODEL PICKER (dipindah ke area chat, seperti di Claude) */
    .model-picker-wrapper { position: relative; }
    .model-picker-btn { display: flex; align-items: center; gap: 4px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--text-main); padding: 6px 10px 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
    .model-picker-btn:hover { border-color: rgba(66, 133, 244, 0.5); }
    .model-picker-caret { fill: var(--text-muted); flex-shrink: 0; }
    .model-picker-menu { display: none; position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 220px; background: var(--bg-sidebar); border: 1px solid var(--border-modal); border-radius: 14px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 60; animation: scaleUp 0.15s ease; }
    .model-picker-option { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: none; color: var(--text-main); padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
    .model-picker-option:hover { background: rgba(128,128,128,0.12); }
    .model-picker-option-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
    .model-picker-option-text strong { font-size: 13px; font-weight: 600; }
    .model-picker-option-text small { font-size: 11px; color: var(--text-muted); }
    .model-picker-check { opacity: 0; font-size: 13px; color: var(--text-main); }
    .model-picker-option.active .model-picker-check { opacity: 1; }
    .model-picker-option.active { background: rgba(128, 128, 128, 0.12); }

    /* ATTACH MENU (tombol + pengganti tombol upload gambar langsung) */
    .attach-menu-wrapper { position: relative; }
    .attach-plus-btn { font-size: 20px; font-weight: 400; line-height: 1; }
    .attach-menu { display: none; position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 140px; background: var(--bg-sidebar); border: 1px solid var(--border-modal); border-radius: 14px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 60; animation: scaleUp 0.15s ease; }
    .attach-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: none; color: var(--text-main); padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; font-size: 13px; }
    .attach-menu-item:hover { background: rgba(128,128,128,0.12); }
    .attach-menu-icon { font-size: 15px; }

    /* IMAGE PREVIEW STYLES */
    .image-preview-container { position: relative; width: max-content; margin-bottom: 6px; }
    .image-preview-container img { max-width: 100px; max-height: 100px; border-radius: 8px; border: 1px solid var(--border-modal); object-fit: cover; }
    .remove-img-btn { position: absolute; top: -6px; right: -6px; background: #ef5350; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; cursor: pointer; font-weight: bold; }

    /* Preview lampiran dokumen (PDF/Word) K-Oss Max — chip info nama file +
       jumlah karakter, beda dari preview gambar yang pakai thumbnail. */
    .document-preview-container { position: relative; width: max-content; max-width: 100%; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 12px; padding: 8px 26px 8px 12px; }
    .document-preview-icon { font-size: 20px; flex-shrink: 0; }
    .document-preview-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .document-preview-name { font-size: 12.5px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .document-preview-meta { font-size: 11px; color: var(--text-muted); }
    .document-preview-container .remove-img-btn { top: 6px; right: 6px; }

    .uploaded-img-chat { max-width: 250px; border-radius: 12px; margin-bottom: 8px; display: block; border: 1px solid var(--border-modal); }

    .menu-container { position: relative; flex-shrink: 0; }
    .three-dots-btn { background: transparent; border: none; color: var(--text-main); font-size: 22px; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; transition: background 0.2s; }
    .three-dots-btn:hover { background: var(--text-hover); }

    /* DROPDOWN ANIMATION */
    .dropdown-menu { 
        display: none; position: absolute; right: 0; top: 45px; background-color: var(--bg-dropdown); 
        min-width: 210px; border-radius: 8px; box-shadow: 0px 8px 25px rgba(0,0,0,0.3); z-index: 100; 
        border: 1px solid var(--border-modal); overflow: hidden;
        animation: slideDownFade 0.25s cubic-bezier(0, 0, 0.2, 1);
    }
    .dropdown-menu button { background: transparent; border: none; width: 100%; text-align: left; padding: 12px 16px; color: var(--text-main); font-size: 14px; cursor: pointer; transition: background 0.2s; }
    .dropdown-menu button:hover { background-color: var(--text-hover); }

    .main-content { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
    .chat-box { flex: 1; overflow-y: auto; padding: 10px 16px var(--input-height, 260px) 16px; display: flex; flex-direction: column; width: 100%; max-width: 760px; margin: 0 auto; gap: 28px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
    
    /* CHAT BUBBLE ANIMATION */
    .message-wrapper { display: flex; width: 100%; animation: messageSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; position: relative; flex-direction: column; }
    .message-wrapper.user { align-items: flex-end; }
    .message-wrapper.bot { align-items: flex-start; }
    
    .message-content { line-height: 1.6; font-size: 15.5px; word-wrap: break-word; color: var(--text-main); }
    .message-wrapper.user .message-content { background-color: var(--bg-user-msg); color: var(--text-user-msg); padding: 12px 20px; border-radius: 22px; max-width: 85%; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    .message-wrapper.bot .message-content { background-color: var(--bg-bot-msg); padding: 4px 0px; max-width: 100%; width: 100%; }

    .chat-action-bar { display: flex; gap: 8px; margin-top: 6px; opacity: 0.8; transition: opacity 0.2s; }
    .chat-action-bar:hover { opacity: 1; }
    .chat-action-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; transition: all 0.2s; }
    .chat-action-btn:hover { color: var(--text-main); background: rgba(0,0,0,0.08); transform: translateY(-1px); }

    /* KARTU BAGIKAN — dirender OFFSCREEN (bukan display:none, biar
       html2canvas bisa nge-capture layout beneran), lalu di-screenshot jadi
       PNG buat dibagikan ke WA/IG story dsb lewat Web Share API. Lihat
       shareMessageAsImage(). Warna ikut var(--bg-body) dkk, otomatis
       ngikutin tema gelap/terang yang lagi aktif karena numpang di body. */
    .share-card-root { position: fixed; left: -9999px; top: 0; width: 640px; z-index: -1; pointer-events: none; }
    .share-card { background: var(--bg-body); color: var(--text-main); padding: 30px 28px 22px; }
    .share-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
    .share-card-logo-icon { font-size: 24px; }
    .share-card-logo-text { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
    .share-card-question { font-size: 14.5px; font-weight: 600; color: var(--text-muted); padding: 12px 16px; border-left: 3px solid var(--text-muted); background: var(--bg-input-wrapper); border-radius: 8px; margin-bottom: 18px; line-height: 1.55; white-space: pre-line; }
    .share-card-answer { font-size: 15px; line-height: 1.65; }
    .share-card-answer img, .share-card-answer canvas { max-width: 100%; }
    .share-card-footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-modal); font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
    .feedback-btn.active { background: rgba(128, 128, 128, 0.18); border-radius: 6px; transform: scale(1.1); }
    .fallback-notice { font-size: 11.5px; color: #f4b400; margin-bottom: 6px; font-style: italic; }
    .coder-transition-badge {
        display: inline-flex; align-items: center; gap: 10px;
        padding: 8px 14px; border-radius: 20px;
        background: var(--bg-input-wrapper); border: 1px solid var(--border-modal);
        margin-bottom: 10px; animation: fadeIn 0.3s ease;
    }
    .coder-blob-mini {
        width: 20px; height: 20px; position: relative; flex-shrink: 0;
        background: radial-gradient(circle at 32% 28%, #c9a3ff, #8b5cf6 60%, #6d28d9 100%);
        border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
        animation: voiceBlobIdle 2.2s ease-in-out infinite;
        box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.5);
    }
    .coder-eye-mini {
        position: absolute; top: 42%; width: 2.6px; height: 4.8px;
        background: #ffffff; border-radius: 50%;
    }
    .coder-eye-mini.left { left: 30%; }
    .coder-eye-mini.right { right: 30%; }
    .coder-transition-text { font-size: 12.5px; font-weight: 600; color: var(--text-main); }

    .spam-toast {
        position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-20px);
        background: #d93025; color: #fff; padding: 10px 18px; border-radius: 10px;
        font-size: 13px; font-weight: 600; z-index: 600; box-shadow: 0 4px 14px rgba(0,0,0,0.3);
        opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
        max-width: 85vw; text-align: center;
    }
    .spam-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    .edit-box-container { width: 100%; max-width: 85%; display: flex; flex-direction: column; gap: 8px; animation: fadeIn 0.3s ease; }
    .edit-textarea { width: 100%; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--input-text-color); padding: 10px; border-radius: 12px; font-size: 15px; outline: none; resize: vertical; }
    .edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
    .edit-btn { border: none; padding: 6px 14px; border-radius: 16px; font-size: 12px; font-weight: bold; cursor: pointer; transition: transform 0.2s; }
    .edit-btn:active { transform: scale(0.95); }
    .edit-btn.save { background: var(--accent-solid); color: var(--accent-solid-text); }
    .edit-btn.cancel { background: var(--border-modal); color: var(--text-main); }

    /* THINKING ACCORDION ANIMATION */
    .thinking-accordion { background-color: var(--bg-thinking); border: 1px solid var(--border-modal); border-radius: 10px; margin-bottom: 14px; overflow: hidden; transition: all 0.3s ease; }
    .thinking-accordion-btn { width: 100%; background: transparent; border: none; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; color: var(--text-main); font-weight: 600; font-size: 12.5px; }
    .arrow-icon { transition: transform 0.3s ease; }
    .thinking-accordion-content { display: none; padding: 12px 14px; font-size: 13.5px; color: var(--text-muted); border-top: 1px solid var(--border-modal); white-space: pre-line; font-style: italic; animation: fadeIn 0.3s ease; }
    .thinking-accordion.open .thinking-accordion-content { display: block; }
    .thinking-accordion.open .arrow-icon { transform: rotate(180deg); }

    /* AGENT TRACE — log langkah tool (search/draft_email dst) yang diambil
       model. Netral, BUKAN merah — merah dipakai khusus buat peringatan
       (rate limit dll), jadi gak boleh dipakai buat status normal kayak ini. */
    .tool-trace-list { display: flex; flex-direction: column; gap: 7px; font-style: normal; white-space: normal; }
    .tool-trace-item { display: flex; align-items: flex-start; gap: 8px; }
    .plan-list { list-style: none; margin: 6px 0 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
    .plan-list li { display: flex; gap: 7px; align-items: flex-start; }
    .plan-list li.done { opacity: .75; text-decoration: line-through; text-decoration-color: rgba(128,128,128,.5); }
    .plan-list li.in_progress { font-weight: 600; }
    .plan-list .plan-mark { flex: 0 0 auto; }
    .code-run-out { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--bg-code-box); border: 1px solid var(--border-modal); font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
    .tool-trace-icon { flex-shrink: 0; }
    .tool-trace-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .tool-trace-links { display: flex; flex-direction: column; gap: 2px; }
    .tool-trace-links a { font-size: 12px; color: var(--text-main); text-decoration: underline; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tool-trace-links a:hover { text-decoration: underline; opacity: 1; }
    .tool-trace-accordion .thinking-accordion-btn { color: var(--text-muted); }

    /* LIVE AGENT CHECKLIST — tiap tool call nongol dulu sebagai "pending"
       (spinner) begitu model mutusin manggilnya, terus di-update in-place
       jadi "done"/"failed" pas hasilnya bener-bener kelar. Ini yang bikin
       user liat progress agent-nya real-time, bukan cuma sekali tampil pas
       semua udah kelar. */
    .tool-trace-spinner {
        display: inline-block; width: 13px; height: 13px; margin-top: 3px;
        border-radius: 50%; border: 2px solid var(--border-modal); border-top-color: var(--text-main);
        animation: agentTraceSpin .65s linear infinite; flex-shrink: 0;
    }
    @keyframes agentTraceSpin { to { transform: rotate(360deg); } }
    .tool-trace-item.pending .tool-trace-body { opacity: .8; }
    .tool-trace-item.failed .tool-trace-body { color: #ef5350; }
    .tool-trace-item.trace-item-enter { animation: traceItemIn .25s ease; }
    @keyframes traceItemIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
    .tool-trace-item.trace-item-settle .tool-trace-icon { animation: traceItemSettle .3s ease; }
    @keyframes traceItemSettle { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
    .live-trace-heading { display: inline-flex; align-items: center; gap: 6px; }
    .agent-inline-notice { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 8px; }
    .agent-inline-notice.error { color: #ef5350; }

    /* Tombol "Buka draft email" — dipakai baik pas live streaming maupun
       pas direkonstruksi ulang dari riwayat, biar gak ilang setelah
       jawaban selesai/chat di-reload. */
    .action-card-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
    .action-card-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: #2a2a2a; color: #fff; text-decoration: none; font-weight: 600; border: 1px solid rgba(255,255,255,0.12); width: fit-content; }

    /* KARTU PRODUK (tool search_shop) — baris horizontal yang bisa
       di-scroll, tiap kartu = gambar+harga+toko, diklik buka ke toko
       aslinya lewat openExternalUrl (buka app Shopee/Tokopedia/Lazada
       kalau ada, browser kalau enggak). */
    .shop-card-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .shop-card { flex: 0 0 130px; scroll-snap-align: start; display: flex; flex-direction: column; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text-main); transition: transform .15s ease; }
    .shop-card:active { transform: scale(.96); }
    .shop-card-img-wrap { width: 100%; height: 108px; background: var(--bg-code-box); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
    .shop-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .shop-card-img-wrap.shop-card-img-error::after { content: "🛍️"; font-size: 26px; opacity: .4; }
    .shop-card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .shop-card-title { font-size: 11.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .shop-card-price { font-size: 13px; font-weight: 700; color: var(--text-main); }
    .shop-card-source { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .source-card-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 8px 0 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .source-card { flex: 0 0 235px; scroll-snap-align: start; display: flex; flex-direction: column; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 15px; overflow: hidden; text-decoration: none; color: var(--text-main); transition: transform .15s ease, border-color .15s ease; box-shadow: 0 3px 14px rgba(0,0,0,.08); }
    .source-card:hover { border-color: rgba(120, 120, 140, .5); }
    .source-card:active { transform: scale(.975); }
    .source-card-media { position: relative; width: 100%; height: 128px; background: var(--bg-code-box); overflow: hidden; display: flex; align-items: center; justify-content: center; }
    .source-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .source-card-media.no-image::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(125, 95, 255, .20), transparent 45%), radial-gradient(circle at 80% 80%, rgba(55, 145, 255, .14), transparent 50%); }
    .source-card-fallback { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 12px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); display: flex; align-items: center; justify-content: center; overflow: hidden; }
    .source-card-fallback img { width: 28px; height: 28px; object-fit: contain; }
    .source-card-overlay { position: absolute; inset: auto 0 0 0; padding: 22px 9px 8px; background: linear-gradient(transparent, rgba(0,0,0,.68)); color: #fff; font-size: 10px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
    .source-card-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .source-card-date { flex-shrink: 0; opacity: .82; }
    .source-card-body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
    .source-card-title { font-size: 12px; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .source-card-snippet { font-size: 10.5px; line-height: 1.4; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .source-card-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; }
    .source-card-favicon { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; flex-shrink: 0; background: #fff; }
    .source-card-source { min-width: 0; flex: 1; font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .source-card-arrow { font-size: 11px; opacity: .65; flex-shrink: 0; }
    @media(max-width:700px){ .source-card { flex-basis: 205px; } .source-card-media { height: 112px; } }

    /* KARTU VISUAL (chart & diagram Kanata) — pengganti placeholder
       ```chart / ```mermaid setelah dirender jadi canvas Chart.js /
       diagram Mermaid beneran (lihat renderPendingVisuals()). */
    .as-visual-pending { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 10px 2px; }
    .as-chart-card, .as-mermaid-card { background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); border-radius: 14px; padding: 14px; margin: 12px 0; }
    .as-chart-card canvas { max-width: 100%; }
    .as-chart-title { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; color: var(--text-muted); }
    .as-mermaid-card { overflow-x: auto; text-align: center; }
    .as-visual-error { font-size: 11.5px; color: #ef5350; margin-bottom: 6px; }

    /* Lightweight rendering hints for long coding responses */
    .message-content pre { contain: layout paint; }
    .message-content .hljs { overflow-wrap: normal; }
    .message-content pre { background-color: var(--bg-code-box); border-radius: 12px; padding: 14px; margin: 12px 0; overflow-x: auto; border: 1px solid var(--border-modal); }
    .message-content img { max-width: 100%; height: auto; border-radius: 14px; margin: 8px 0; display: block; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }

    /* K-Image 2.5: loading khusus */
    .img-loading-card { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 12px 0; animation: fadeIn 0.3s ease; max-width: 340px; width: 100%; }
    .img-loading-canvas { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; isolation: isolate; border: 1px solid var(--border-modal); background: var(--bg-code-box); }
    .img-loading-blob { position: absolute; width: 70%; height: 70%; border-radius: 50%; filter: blur(38px); opacity: 0.75; will-change: transform; z-index: 0; }
    .img-loading-blob.b1 { top: -10%; left: -8%; background: #8b5cf6; animation: imgBlob1 7s ease-in-out infinite; }
    .img-loading-blob.b2 { bottom: -12%; right: -10%; background: #6d28d9; animation: imgBlob2 8s ease-in-out infinite; }
    .img-loading-blob.b3 { top: 28%; left: 30%; width: 50%; height: 50%; background: #c9a3ff; opacity: 0.55; animation: imgBlob3 9s ease-in-out infinite; }
    .img-loading-grain { position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%); background-size: 260% 100%; animation: imgShimmer 2.2s ease-in-out infinite; mix-blend-mode: soft-light; }
    .img-loading-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
    .img-loading-status { font-weight: 500; animation: imgTextFade 1.8s ease-in-out infinite; }
    .img-loading-time { font-variant-numeric: tabular-nums; opacity: 0.7; }
    @keyframes imgShimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }
    @keyframes imgBlob1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(38%,30%) scale(1.15); } }
    @keyframes imgBlob2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-35%,-32%) scale(0.9); } }
    @keyframes imgBlob3 { 0%,100% { transform: translate(0,0) scale(0.9); } 50% { transform: translate(-25%,28%) scale(1.2); } }
    @keyframes imgTextFade { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
    @media (prefers-reduced-motion: reduce) { .img-loading-blob, .img-loading-grain, .img-loading-status { animation: none; } }

    /* K-Oss Image: kartu hasil, preview & download */
    .gen-image-card { position: relative; display: inline-block; max-width: 100%; margin: 8px 0; }
    .gen-image-card img { margin: 0; cursor: zoom-in; }
    .gen-image-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
    .gen-image-btn { border: none; cursor: pointer; width: 34px; height: 34px; border-radius: 10px; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(20,20,28,0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .15s ease, background .15s ease; }
    .gen-image-btn:hover { background: rgba(109,40,217,0.85); transform: translateY(-1px); }
    .img-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; animation: fadeIn 0.2s ease; }
    .img-lightbox img { max-width: 94vw; max-height: 74vh; object-fit: contain; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }
    .img-lightbox-caption { max-width: 92vw; color: #d8d8e0; font-size: 13px; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .img-lightbox-actions { display: flex; gap: 10px; }
    .img-lightbox-actions button { border: none; cursor: pointer; padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.14); }
    .img-lightbox-actions button.primary { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
    .message-content code { font-family: 'Fira Code', Consolas, monospace; font-size: 13px; }
    .code-header { display: flex; justify-content: space-between; align-items: center; background: var(--bg-code-header); padding: 6px 14px; font-size: 11px; border-top-left-radius: 12px; border-top-right-radius: 12px; color: var(--text-muted); margin-top: 12px; margin-bottom: -12px; border: 1px solid var(--border-modal); border-bottom: none; }
    .action-code-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: 4px; transition: color 0.2s; }
    .action-code-btn:hover { color: var(--text-main); }

    .typing-indicator { display: flex; gap: 5px; padding: 12px 0; animation: fadeIn 0.3s ease; }
    .dot { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
    .dot:nth-child(1) { animation-delay: -0.32s; }
    .dot:nth-child(2) { animation-delay: -0.16s; }

    /* SPRITE "EMBER BESI BULAT TERBALIK" — muncul saat AI sedang berpikir/mengetik */
    .ai-thinking-sprite { display: flex; align-items: center; gap: 12px; padding: 10px 0 14px 0; animation: fadeIn 0.3s ease; }
    .sprite-bucket-svg {
        display: block; overflow: visible;
        animation: sprite-wobble 1.1s ease-in-out infinite;
        transform-origin: 50% 73%; /* poros goyang di bibir bawah ember */
        filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
    }
    .sprite-handle { animation: sprite-handle-swing 1.1s ease-in-out infinite; transform-origin: 50% 60%; }
    .sprite-eye-dot { transform-box: fill-box; transform-origin: center; animation: sprite-blink 2.6s infinite; }
    .sprite-thought-dots { display: flex; gap: 4px; align-items: center; }

    .ember-sprite-stage { position: relative; display: inline-flex; align-items: center; justify-content: center; }
    .ember-orbit-wrap {
        position: absolute; top: 50%; left: 50%; width: 46px; height: 46px;
        margin-top: -23px; margin-left: -23px;
        animation: emberOrbitSpin 3.2s linear infinite;
        pointer-events: none;
    }
    .ember-orbit-dot {
        position: absolute; top: 0; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
        border-radius: 50%;
        background: radial-gradient(circle at 32% 28%, #c9a3ff, #8b5cf6 60%, #6d28d9 100%);
        box-shadow: 0 0 8px 2px rgba(139, 92, 246, 0.65);
    }
    @keyframes emberOrbitSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
    .sprite-eyes-group {
        transform-box: fill-box; transform-origin: center;
        animation: sprite-glance 3.2s ease-in-out infinite;
    }
    @keyframes sprite-glance {
        0%, 100% { transform: translate(0, 0); }
        25% { transform: translate(1.6px, -0.8px); }
        50% { transform: translate(0, 1px); }
        75% { transform: translate(-1.6px, -0.8px); }
    }

    /* EKSPRESI SPRITE — animasi beda buat tiap mood */
    .sprite-mood-sad { animation: sprite-droop 2.4s ease-in-out infinite !important; }
    .sprite-mood-happy { animation: sprite-bounce-happy 0.9s ease-in-out infinite !important; }
    .sprite-mood-mail { animation: sprite-mail-bob 1.3s ease-in-out infinite !important; }
    .sprite-mood-confused { animation: sprite-confused-tilt 1.8s ease-in-out infinite !important; }
    .sprite-mood-excited { animation: sprite-excited-bounce 0.7s ease-in-out infinite !important; }
    /* tanda tanya (mood confused) & kilau (mood excited) — dianimasiin
       terpisah dari body-nya biar kerasa "hidup", beda ritme dari sprite. */
    .sprite-question-mark { transform-box: fill-box; transform-origin: center; animation: sprite-question-bob 1.8s ease-in-out infinite; }
    .sprite-sparkle { transform-box: fill-box; transform-origin: center; animation: sprite-sparkle-twinkle 1s ease-in-out infinite; }
    .sprite-sparkle-2 { animation-delay: 0.35s; }
    .mood-sprite-row { display: flex; margin-bottom: 6px; }
    @keyframes sprite-droop {
        0%, 100% { transform: rotate(-2deg) translateY(0); }
        50% { transform: rotate(2deg) translateY(1px); }
    }
    @keyframes sprite-bounce-happy {
        0%, 100% { transform: rotate(-8deg) translateY(0) scale(1); }
        50% { transform: rotate(8deg) translateY(-5px) scale(1.03); }
    }
    @keyframes sprite-mail-bob {
        0%, 100% { transform: rotate(0deg) translateY(0); }
        50% { transform: rotate(-2deg) translateY(-2px); }
    }
    /* goyang gak beraturan (bukan simetris kayak mood lain) — kesan ragu/
       bingung, bukan cuma "mikir tenang" biasa */
    @keyframes sprite-confused-tilt {
        0%, 100% { transform: rotate(-7deg); }
        30% { transform: rotate(4deg); }
        60% { transform: rotate(-3deg); }
    }
    @keyframes sprite-question-bob {
        0%, 100% { transform: translateY(0) rotate(-6deg); opacity: 0.75; }
        50% { transform: translateY(-3px) rotate(6deg); opacity: 1; }
    }
    /* pantulan lebih cepat & lebih besar dari mood happy — kesan antusias */
    @keyframes sprite-excited-bounce {
        0%, 100% { transform: translateY(0) scale(1); }
        50% { transform: translateY(-6px) scale(1.05); }
    }
    @keyframes sprite-sparkle-twinkle {
        0%, 100% { opacity: 0.3; transform: scale(0.6) rotate(0deg); }
        50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
    }
    /* amplop yang "dibawa" pas mood mail — ngambang & goyang sendiri,
       beda ritme dari body-nya biar kerasa hidup */
    .sprite-envelope-group { transform-box: fill-box; transform-origin: center; animation: sprite-envelope-float 1.3s ease-in-out infinite; }
    @keyframes sprite-envelope-float {
        0%, 100% { transform: translateY(0) rotate(-5deg); }
        50% { transform: translateY(-5px) rotate(5deg); }
    }
    .sprite-envelope-flap { transform-box: fill-box; transform-origin: center; animation: sprite-envelope-flap-wiggle 1.3s ease-in-out infinite; }
    @keyframes sprite-envelope-flap-wiggle {
        0%, 100% { transform: scaleY(1); }
        50% { transform: scaleY(0.8); }
    }
    .sprite-envelope-spark { transform-box: fill-box; transform-origin: center; animation: sprite-envelope-spark-pulse 1.3s ease-in-out infinite; }
    @keyframes sprite-envelope-spark-pulse {
        0%, 100% { opacity: 0.35; transform: scale(0.8); }
        50% { opacity: 1; transform: scale(1.2); }
    }
    .sprite-loading-label { font-size: 12px; color: var(--text-muted); }
    .error-sprite-row { display: flex; align-items: center; gap: 10px; }
    /* WELCOME SCREEN (chat kosong) — centered hero, gaya Gemini/Claude.
       Ganti dari style "chat bubble kiri" lama; sekarang jadi elemen
       tersendiri yang ngisi & nge-center di area chatBox (flex:1 di
       dalam .chat-box yang udah flex column). */
    .welcome-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 50vh; padding: 24px 16px; }
    .welcome-hero { max-width: 460px; }
    .welcome-sprite-row { display: flex; justify-content: center; margin-bottom: 14px; }
    .welcome-greeting { font-size: 27px; font-weight: 700; margin: 0 0 6px; color: var(--text-main); }
    .welcome-sub { font-size: 14.5px; color: var(--text-main); opacity: .85; margin: 0 0 22px; }
    .welcome-quote { font-size: 13px; color: var(--text-muted); font-style: italic; line-height: 1.7; opacity: .9; }
    .welcome-quote b { font-style: normal; color: var(--text-main); }
    .sprite-thought-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.4s infinite ease-in-out both; }
    .sprite-thought-dots span:nth-child(1) { animation-delay: -0.32s; }
    .sprite-thought-dots span:nth-child(2) { animation-delay: -0.16s; }

    @keyframes sprite-wobble {
        0%, 100% { transform: rotate(-6deg) translateY(0); }
        50% { transform: rotate(6deg) translateY(-4px); }
    }
    @keyframes sprite-handle-swing {
        0%, 100% { transform: rotate(3deg); }
        50% { transform: rotate(-5deg); }
    }
    @keyframes sprite-blink {
        0%, 88%, 100% { transform: scaleY(1); }
        94% { transform: scaleY(0.15); }
    }

    /* SPLASH SCREEN — layar pembuka bermerek saat app dimuat */
    .splash-screen {
        position: fixed; inset: 0; z-index: 500;
        display: flex; align-items: center; justify-content: center;
        background: #0d0d0e;
        transition: opacity 0.5s ease, visibility 0.5s ease;
        opacity: 1; visibility: visible;
    }
    .splash-screen.splash-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
    .splash-content { display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .splash-title { margin-top: 18px; font-size: 22px; font-weight: 700; letter-spacing: 0.3px; color: #ffffff; animation: fadeIn 0.6s ease; }
    .splash-subtitle { font-size: 12px; color: #9a9a9d; margin-top: 2px; letter-spacing: 0.5px; }
    .splash-loader { display: flex; gap: 5px; margin-top: 22px; }
    .splash-loader span { width: 6px; height: 6px; border-radius: 50%; background: #8a8a8d; animation: bounce 1.4s infinite ease-in-out both; }
    .splash-loader span:nth-child(1) { animation-delay: -0.32s; }
    .splash-loader span:nth-child(2) { animation-delay: -0.16s; }

    .input-container { padding: 10px 20px calc(16px + env(safe-area-inset-bottom)) 20px; width: 100%; max-width: 760px; margin: 0 auto; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
    .prompt-chips-wrapper { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .prompt-chips-wrapper::-webkit-scrollbar { display: none; }
    
    .chip-btn { background: var(--bg-input-wrapper); color: var(--text-main); border: 1px solid var(--border-modal); padding: 5px 12px; border-radius: 16px; font-size: 12px; white-space: nowrap; cursor: pointer; transition: all 0.2s ease; }
    .chip-btn:hover { border-color: var(--text-muted); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); }

    .toggle-search-container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; row-gap: 8px; }
    .search-toggle-btn { background-color: var(--toggle-inactive-bg); color: var(--text-main); border: 1px solid var(--border-modal); padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: 0 0 auto; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
    .search-toggle-btn:hover { border-color: rgba(66, 133, 244, 0.5); }
    .search-toggle-btn.active { background-color: var(--toggle-active-bg); border-color: var(--toggle-active-border); color: var(--toggle-active-text); font-weight: 600; box-shadow: 0 0 12px rgba(66, 133, 244, 0.25); }

    /* Badge streak ngobrol harian — muncul di header sebelah nama app,
       disembunyikan (display:none) kalau streak-nya 0 (belum pernah chat
       atau baru direset). Diisi/diupdate oleh renderStreakBadge(). */
    .streak-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--text-main); margin-left: 8px; white-space: nowrap; flex-shrink: 0; }

    /* DEWAN AI — accordion nunjukkin catatan analisis Kanata sebelum
       jawaban akhir dari K-Oss dirender di bawahnya (lihat
       buildCouncilAccordionHtml/runCouncilTurn). Reuse struktur
       .thinking-accordion yang sama kayak trace tool-call, cuma beda isi. */
    .council-accordion .thinking-accordion-btn { color: var(--text-main); }
    .council-member { padding: 4px 0; }
    .council-member + .council-member { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-modal); }
    .council-member-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); margin-bottom: 6px; }
    .council-member-notes { font-size: 13px; line-height: 1.5; }
    .council-member-notes p:first-child { margin-top: 0; }
    .council-member-notes p:last-child { margin-bottom: 0; }

    .input-wrapper { display: flex; background-color: var(--bg-input-wrapper); border: 1px solid var(--border-input); border-radius: 28px; padding: 8px 14px 8px 16px; align-items: flex-end; gap: 6px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: border-color 0.2s, box-shadow 0.2s; }
    .input-wrapper:focus-within { border-color: var(--accent-focus); box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15); }
    textarea { flex: 1; background: transparent; border: none; color: var(--input-text-color); font-size: 16px; outline: none; resize: none; max-height: 140px; min-height: 24px; line-height: 24px; }
    textarea::placeholder { color: var(--text-muted); }
    
    .tool-icon-btn { background: transparent; border: none; font-size: 18px; cursor: pointer; padding: 6px; border-radius: 50%; opacity: 0.7; color: var(--text-main); transition: transform 0.2s, opacity 0.2s; }
    .tool-icon-btn:hover { opacity: 1; transform: scale(1.1); }
    .tool-icon-btn.recording { color: #ef5350; animation: pulse 1s infinite; opacity: 1; }

    /* ==== VOICE MODE (STT bawaan browser + TTS speechSynthesis bawaan
       browser — sengaja gak pakai API TTS eksternal biar ringan/gratis).
       Sprite cuma bola ungu polos yang "gerak-gerak" lewat animasi CSS
       border-radius (blob organik) + scale, beda animasi tiap state biar
       user ngerti fase percakapannya (dengerin/mikir/ngomong) tanpa perlu
       teks status pun sebenarnya udah kebaca dari geraknya. */
    .voice-mode-overlay {
        display: none; position: fixed; inset: 0; z-index: 300;
        background: var(--bg-body); flex-direction: column;
        align-items: center; justify-content: center; gap: 28px;
        padding: 24px; padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    .voice-mode-overlay.active { display: flex; }
    .voice-mode-close-btn {
        position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
        background: var(--bg-input-wrapper); border: 1px solid var(--border-modal);
        color: var(--text-main); width: 38px; height: 38px; border-radius: 50%;
        font-size: 18px; cursor: pointer; display: flex; align-items: center;
        justify-content: center; transition: transform 0.2s, opacity 0.2s;
    }
    .voice-mode-close-btn:hover { transform: scale(1.08); opacity: 0.85; }
    .voice-blob-wrapper { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
    .voice-blob {
        width: 150px; height: 150px;
        background: radial-gradient(circle at 32% 28%, #c9a3ff, #8b5cf6 55%, #6d28d9 100%);
        box-shadow: 0 0 60px 10px rgba(139, 92, 246, 0.45);
        border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
        animation: voiceBlobIdle 4.5s ease-in-out infinite;
        transition: box-shadow 0.4s ease;
        cursor: pointer;
        position: relative;
    }
    .voice-blob.state-listening {
        animation: voiceBlobListening 1.6s ease-in-out infinite;
        box-shadow: 0 0 70px 16px rgba(139, 92, 246, 0.65);
    }
    .voice-blob.state-thinking {
        animation: voiceBlobThinking 1.1s linear infinite;
        box-shadow: 0 0 55px 12px rgba(139, 92, 246, 0.5);
    }
    .voice-blob.state-speaking {
        animation: voiceBlobSpeaking 0.55s ease-in-out infinite;
        box-shadow: 0 0 80px 18px rgba(139, 92, 246, 0.7);
    }
    @keyframes voiceBlobIdle {
        0%, 100% { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; transform: scale(1); }
        50% { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; transform: scale(1.04); }
    }
    @keyframes voiceBlobListening {
        0%, 100% { border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%; transform: scale(1); }
        25% { border-radius: 60% 40% 45% 55% / 40% 60% 40% 60%; transform: scale(1.08); }
        50% { border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%; transform: scale(0.97); }
        75% { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; transform: scale(1.1); }
    }
    @keyframes voiceBlobThinking {
        0% { transform: rotate(0deg) scale(1); }
        50% { transform: rotate(180deg) scale(0.92); }
        100% { transform: rotate(360deg) scale(1); }
    }
    @keyframes voiceBlobSpeaking {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.14); }
    }
    /* Mata putih lonjong (gaya sprite Kimi) — geser posisinya sendiri lewat
       JS ngikutin kemiringan HP (deviceorientation) atau posisi mouse
       (fallback desktop), biar blob-nya kerasa "ngelirik" pas HP/layar
       digerakin. Sengaja polos putih doang, gak pakai pupil terpisah. */
    .voice-eye {
        position: absolute; top: 40%; width: 15px; height: 27px;
        background: #ffffff; border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        pointer-events: none;
        transition: transform 0.1s linear, width 0.25s ease, height 0.25s ease;
    }
    .voice-eye.left { left: 32%; }
    .voice-eye.right { right: 32%; }
    .voice-blob.state-listening .voice-eye,
    .voice-blob.state-speaking .voice-eye { width: 16px; height: 30px; }
    .voice-mode-status { font-size: 15px; color: var(--text-muted); font-weight: 600; text-align: center; min-height: 20px; transition: opacity 0.14s ease; }
    .voice-blob.state-transitioning { transition: transform 0.14s cubic-bezier(.4,0,.2,1), filter 0.14s ease; transform: scale(0.88); filter: brightness(1.2); }
    .voice-mode-transcript { font-size: 17px; color: var(--text-main); text-align: center; max-width: 520px; min-height: 24px; line-height: 1.5; }
    .voice-mode-hint { font-size: 12px; color: var(--text-muted); opacity: 0.7; text-align: center; }

    .send-btn, .stop-btn { background-color: transparent; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; transition: transform 0.2s, background 0.2s; }
    .send-btn:hover, .stop-btn:hover { background: var(--text-hover); transform: scale(1.05); }
    .send-btn:active, .stop-btn:active { transform: scale(0.95); }
    .send-btn svg { width: 20px; height: 20px; fill: var(--text-main); }
    
    .send-btn:not(:disabled) { background: var(--accent-solid); }
    .send-btn:not(:disabled):hover { background: var(--accent-solid-hover); }
    .send-btn:not(:disabled) svg { fill: var(--accent-solid-text); }

    .footer-note { font-size: 11px; text-align: center; color: var(--text-muted); margin-top: 4px; }

    /* MODAL POPUP ANIMATION */
    .modal-overlay { 
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
        background: rgba(0,0,0,0.7); z-index: 300; align-items: center; justify-content: center; 
        padding: 16px; backdrop-filter: blur(4px); animation: fadeIn 0.25s ease;
    }
    .modal-box { 
        background-color: var(--bg-body); border: 1px solid var(--border-modal); border-radius: 16px; 
        width: 100%; max-width: 460px; height: auto; padding: 24px; display: flex; flex-direction: column; 
        gap: 16px; max-height: 90vh; overflow-y: auto; animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-header { font-size: 18px; font-weight: 500; border-bottom: 1px solid var(--border-modal); padding-bottom: 10px; }

    /* MODAL LIVE PREVIEW KODE */
    .preview-modal-box {
        background-color: var(--bg-body); border: 1px solid var(--border-modal); border-radius: 16px;
        width: 100%; max-width: 900px; height: 88vh; padding: 0; display: flex; flex-direction: column;
        overflow: hidden; animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .preview-modal-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 12px 16px; border-bottom: 1px solid var(--border-modal); font-weight: 600; font-size: 14px; flex-shrink: 0;
    }
    .close-modal-btn.small { width: auto; padding: 6px 14px; border-radius: 16px; font-size: 12px; }
    .preview-iframe { flex: 1; width: 100%; border: none; background: #fff; }
    .preview-code-btn { color: var(--text-main) !important; }
    .setting-group { display: flex; flex-direction: column; gap: 6px; }
    .setting-group label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
    .setting-group select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-modal); background: var(--bg-body); color: var(--input-text-color); font-size: 14px; outline: none; }
    .setting-group textarea { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-modal); background: var(--bg-body); color: var(--input-text-color); font-size: 14px; font-family: inherit; outline: none; resize: vertical; min-height: 60px; }
    .about-you-hint { font-size: 11px; color: var(--text-muted); opacity: .75; }
    .close-modal-btn { background: var(--accent-solid); color: var(--accent-solid-text); border: none; padding: 12px; border-radius: 24px; font-weight: bold; cursor: pointer; transition: transform 0.2s, background 0.2s; }
    .tips-open-btn { width: 100%; background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); color: var(--text-main); padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; transition: transform 0.2s, opacity 0.2s; }
    .tips-open-btn:hover { transform: translateY(-1px); opacity: 0.9; }
    .close-modal-btn:hover { background: var(--accent-solid-hover); transform: translateY(-1px); }

    .about-page { flex: 1; overflow-y: auto; padding: 30px 20px 60px 20px; width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; animation: fadeIn 0.4s ease; }
    .about-container { display: flex; flex-direction: column; gap: 20px; width: 100%; }
    .about-title { font-size: 26px; font-weight: 600; color: var(--text-main); }
    .about-desc { font-size: 15px; line-height: 1.6; color: var(--text-muted); }
    .team-title { font-size: 18px; font-weight: 500; margin-top: 15px; border-bottom: 1px solid var(--border-modal); padding-bottom: 8px; }
    .team-grid { display: flex; flex-direction: column; gap: 14px; width: 100%; }
    .team-card { background-color: var(--bg-input-wrapper); border: 1px solid var(--border-modal); padding: 16px 20px; border-radius: 14px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
    .team-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
    .team-card.owner { border-left: 4px solid var(--text-main); }
    .member-role { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
    .member-name { font-size: 16px; font-weight: 500; color: var(--text-main); }

    .about-link-card { display: block; text-decoration: none; color: inherit; text-align: left; width: 100%; font-family: inherit; cursor: pointer; }
    .about-link-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
    .about-interview-btn { border-style: dashed; }

    /* INTERVIEW PENGGUNA (opsional, muncul sekali pas pertama buka) */
    .iv-field { margin-bottom: 16px; }
    .iv-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
    .iv-label small { font-weight: 500; color: var(--text-muted); }
    .iv-rating { display: flex; gap: 8px; }
    .iv-rate-btn { flex: 1; font-size: 22px; padding: 9px 0; border-radius: 12px; cursor: pointer;
        background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); transition: transform .15s, border-color .15s; }
    .iv-rate-btn.active { border-color: var(--text-main); transform: scale(1.08); }
    .iv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .iv-chip { padding: 7px 12px; font-size: 12.5px; border-radius: 999px; cursor: pointer; color: var(--text-main);
        background: var(--bg-input-wrapper); border: 1px solid var(--border-modal); font-family: inherit; }
    .iv-chip.active { background: var(--text-main); color: var(--bg-body); border-color: var(--text-main); }
    .iv-input { width: 100%; padding: 10px 12px; border-radius: 12px; resize: vertical; font-family: inherit; font-size: 14px;
        background: var(--bg-input-wrapper); color: var(--text-main); border: 1px solid var(--border-modal); outline: none; }
    .iv-input:focus { border-color: var(--text-muted); }
    .iv-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: 4px 0 10px; }
    .iv-status { font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }
    .iv-status.err { color: #e5534b; }

    /* WEB SEARCH LOADING — sprite masuk ke logo 🌐 */
    .web-search-loading {
        display: flex; align-items: center; gap: 13px; padding: 10px 2px 14px;
        animation: webSearchEnter 0.35s ease both;
    }
    .web-search-orbit {
        position: relative; width: 44px; height: 44px; flex: 0 0 44px;
        display: flex; align-items: center; justify-content: center;
    }
    .web-search-globe {
        position: relative; z-index: 3; width: 31px; height: 31px;
        display: flex; align-items: center; justify-content: center;
        font-size: 25px; line-height: 1;
        filter: drop-shadow(0 0 7px rgba(150,150,150,.4));
        animation: globePulse 1.6s ease-in-out infinite;
    }
    .web-search-ring {
        position: absolute; left: 50%; top: 50%; border: 1px solid rgba(150,150,150,.35);
        border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none;
    }
    .web-search-ring.ring-1 { width: 39px; height: 39px; animation: globeRing 1.8s ease-out infinite; }
    .web-search-ring.ring-2 { width: 31px; height: 31px; animation: globeRing 1.8s ease-out .55s infinite; }
    .web-search-dot {
        position: absolute; width: 4px; height: 4px; border-radius: 50%;
        background: var(--text-main); box-shadow: 0 0 7px rgba(150,150,150,.6);
    }
    .web-search-dot.dot-1 { left: 2px; top: 19px; animation: orbitDot 1.8s linear infinite; transform-origin: 20px 3px; }
    .web-search-dot.dot-2 { right: 2px; bottom: 8px; animation: orbitDot 1.8s linear -.9s infinite; transform-origin: -18px -8px; }
    .web-search-copy { min-width: 0; }
    .web-search-title { font-size: 13px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 4px; }
    .web-search-subtitle { margin-top: 3px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(72vw, 620px); }
    .web-search-dots { display: inline-flex; gap: 2px; margin-left: 1px; }
    .web-search-dots i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .25; animation: searchDot 1.2s infinite; }
    .web-search-dots i:nth-child(2) { animation-delay: .18s; }
    .web-search-dots i:nth-child(3) { animation-delay: .36s; }
    @keyframes webSearchEnter { from { opacity: 0; transform: translateY(5px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
    @keyframes globePulse { 0%,100% { transform: scale(.92) rotate(0deg); } 50% { transform: scale(1.08) rotate(7deg); } }
    @keyframes globeRing { 0% { opacity: .75; transform: translate(-50%,-50%) scale(.72); } 75%,100% { opacity: 0; transform: translate(-50%,-50%) scale(1.35); } }
    @keyframes orbitDot { from { transform: rotate(0deg) translateX(17px) rotate(0deg); } to { transform: rotate(360deg) translateX(17px) rotate(-360deg); } }
    @keyframes searchDot { 0%,100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
    @media(max-width:700px){ .web-search-subtitle { max-width: 68vw; } }

    /* KEYFRAME ANIMATIONS */
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
    @keyframes messageSlideUp { 
        from { opacity: 0; transform: translateY(16px) scale(0.98); } 
        to { opacity: 1; transform: translateY(0) scale(1); } 
    }
    @keyframes slideDownFade { 
        from { opacity: 0; transform: translateY(-10px); } 
        to { opacity: 1; transform: translateY(0); } 
    }
    @keyframes scaleUp { 
        from { opacity: 0; transform: scale(0.92); } 
        to { opacity: 1; transform: scale(1); } 
    }
    @keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
    @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

    @media (max-width: 768px) {
        .sidebar { position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; height: var(--app-height, 100dvh); transform: translateX(-100%); }
        .sidebar.open { transform: translateX(0); }
        .close-sidebar-btn { display: block; }
        .top-header { padding-left: 16px; padding-right: 16px; }
        .input-container { padding-left: 12px; padding-right: 12px; }
        .chat-box { padding-left: 12px; padding-right: 12px; }
    }

    /* HP LAYAR SEMPIT (mis. iPhone SE, Android kecil) */
    @media (max-width: 420px) {
        .app-logo { font-size: 16px; }
        .model-picker-btn { padding: 6px 8px 6px 10px; font-size: 12px; }
        .chip-btn { font-size: 11.5px; padding: 5px 10px; }
        .input-wrapper { padding: 6px 10px 6px 12px; }
        .toggle-search-container { gap: 6px; row-gap: 6px; }
        .search-toggle-btn { padding: 6px 10px; font-size: 11.5px; gap: 4px; }
        #kossMaxModeToggleBtn { padding: 6px 10px; }
    }

    /* KOMPUTER/LAPTOP LAYAR LEBAR — kasih ruang napas lebih buat baris toggle */
    @media (min-width: 900px) {
        .toggle-search-container { gap: 10px; }
        .search-toggle-btn { padding: 7px 16px; font-size: 13px; }
        .model-picker-btn { padding: 7px 12px 7px 14px; font-size: 13px; }
    }

/* NERI CUSTOM ICON SYSTEM */
.as-icon{display:inline-flex;align-items:center;justify-content:center;width:1.3em;height:1.3em;vertical-align:-.24em;flex:0 0 auto}
.as-icon svg{width:100%;height:100%;display:block}
.as-icon .s{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.as-icon .f{fill:currentColor}
.as-icon .q{fill:currentColor;opacity:.16}
.as-icon-globe{width:1.4em}.as-icon-code{width:1.4em}.as-icon-vision{width:1.4em}
.as-icon-mic{width:1.35em}.as-icon-image{width:1.35em}.as-icon-stop{width:1.25em}
.as-icon-search{width:1.3em}.as-icon-status{width:1.4em}.as-icon-settings{width:1.35em}
.as-icon-back{width:1.2em}.as-icon-refresh{width:1.25em}.as-icon-send{width:1.35em}
.secret-page{flex:1;overflow-y:auto;padding:0 18px 70px;animation:secretPageIn .55s ease}.secret-shell{max-width:820px;margin:0 auto;padding:22px 0}.secret-topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.secret-back{background:var(--bg-input-wrapper);color:var(--text-main);border:1px solid var(--border-modal);border-radius:14px;padding:9px 13px;cursor:pointer;font-size:13px}.secret-system{font-size:10px;letter-spacing:2px;color:var(--text-muted);font-weight:800}.secret-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#62d394;margin-right:7px;box-shadow:0 0 12px rgba(98,211,148,.65)}.secret-card{max-width:720px;margin:0 auto;padding:54px 34px 30px;border:1px solid var(--border-modal);border-radius:30px;background:radial-gradient(circle at 50% 0%,rgba(155,81,224,.18),transparent 38%),radial-gradient(circle at 100% 80%,rgba(66,133,244,.11),transparent 38%),var(--bg-main);box-shadow:0 24px 90px rgba(0,0,0,.18);text-align:center;position:relative;overflow:hidden}.secret-card:before{content:"";position:absolute;inset:0;background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.07) 48%,transparent 72%);transform:translateX(-110%);animation:secretShine 6s ease-in-out infinite}.secret-card>*{position:relative;z-index:1}.secret-sparkle{font-size:42px;line-height:1;animation:secretFloat 3s ease-in-out infinite}.secret-label{font-size:9px;letter-spacing:3.5px;color:var(--text-muted);font-weight:800;margin-top:13px}.secret-card h1{font-size:clamp(27px,5vw,42px);line-height:1.12;margin:17px 0 18px;letter-spacing:-1.2px}.secret-card h1 span{background:linear-gradient(90deg,#9b51e0,#5f8cff);-webkit-background-clip:text;background-clip:text;color:transparent}.secret-message{max-width:560px;margin:0 auto;color:var(--text-muted);line-height:1.8;font-size:14px}.secret-note{max-width:560px;margin:30px auto 0;display:flex;gap:14px;text-align:left;padding:18px;border:1px solid var(--border-modal);border-radius:20px;background:var(--bg-input-wrapper);box-shadow:0 10px 30px rgba(0,0,0,.08)}.secret-note-icon{width:38px;height:38px;flex:0 0 38px;border-radius:12px;display:grid;place-items:center;background:rgba(155,81,224,.13);font-size:21px}.secret-note small{font-size:9px;letter-spacing:1.7px;color:var(--text-muted);font-weight:800}.secret-note p{margin:6px 0 0;color:var(--text-main);font-size:13px;line-height:1.65}.secret-divider{display:flex;align-items:center;gap:13px;justify-content:center;margin:30px 0 20px;font-size:16px}.secret-divider span{height:1px;width:75px;background:var(--border-modal)}.secret-quote{max-width:570px;margin:0 auto;font-style:italic;font-size:15px;line-height:1.8;color:var(--text-main)}.secret-signature{margin-top:25px;color:var(--text-muted);font-size:11px;letter-spacing:.2px}.secret-signature span{margin:0 7px}.secret-footer{margin-top:35px;padding-top:16px;border-top:1px solid var(--border-modal);font-size:8px;letter-spacing:2.5px;color:var(--text-muted);font-weight:800}.secret-footer span{margin:0 8px}.secret-orbit{position:absolute;border:1px solid rgba(155,81,224,.16);border-radius:50%;pointer-events:none}.orbit-one{width:260px;height:260px;top:-170px;left:-90px}.orbit-two{width:300px;height:300px;right:-180px;bottom:-180px}@keyframes secretFloat{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-8px) rotate(4deg)}}@keyframes secretShine{0%,55%,100%{transform:translateX(-110%)}75%{transform:translateX(110%)}}@keyframes secretPageIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@media(max-width:600px){.secret-card{padding:44px 20px 25px;border-radius:24px}.secret-topbar{padding:0 2px}.secret-note{padding:15px}.secret-divider span{width:45px}}
.status-page{flex:1;overflow-y:auto;padding:18px 16px 60px;animation:fadeIn .35s}.status-shell{max-width:900px;margin:auto}.status-topbar{display:flex;align-items:center;justify-content:space-between;text-align:center;gap:12px;margin-bottom:18px}.status-topbar small{color:var(--text-muted);font-size:9px;letter-spacing:1.5px}.status-topbar h2{font-size:23px}.status-back,.status-refresh{background:var(--bg-input-wrapper);color:var(--text-main);border:1px solid var(--border-modal);border-radius:18px;padding:8px 12px;cursor:pointer}.status-refresh{width:40px;height:40px;padding:0;font-size:20px}.status-hero{display:flex;align-items:center;gap:24px;padding:26px;border:1px solid var(--border-modal);border-radius:24px;background:var(--bg-input-wrapper)}.status-sprite-frame{position:relative;width:125px;height:110px;display:grid;place-items:center;color:#8ab4f8;flex-shrink:0}.status-sprite{width:92px;height:92px;animation:statusIdle 3s ease-in-out infinite}.status-sprite-frame.glitch .status-sprite{animation:statusGlitch .2s steps(2) infinite;filter:drop-shadow(4px 0 #ef5350) drop-shadow(-4px 0 #4285f4)}.status-sprite-frame.offline .status-sprite{opacity:.3;animation:none}.prison-bars{display:none;position:absolute;inset:5px 14px;grid-template-columns:repeat(5,1fr);gap:8px}.prison-bars i{border-left:3px solid #aaa}.status-sprite-frame.no-internet .prison-bars{display:grid}.status-sprite-frame.no-internet .status-sprite{animation:trapped .7s ease-in-out infinite}.status-hero h1{margin:9px 0 5px;font-size:24px}.status-hero p{color:var(--text-muted);line-height:1.5}.status-hero span{display:inline-block;border:1px solid currentColor;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800;color:#65d38b}.status-hero span.error{color:#ef5350}.status-hero span.degraded{color:#f4b400}.status-hero span.offline{color:#888}.status-controls{display:flex;justify-content:space-between;align-items:center;margin:18px 0 10px}.status-controls select{background:var(--bg-input-wrapper);color:var(--text-main);border:1px solid var(--border-modal);border-radius:12px;padding:8px 10px}.status-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.status-card{background:var(--bg-input-wrapper);border:1px solid var(--border-modal);border-radius:18px;padding:15px}.status-head{display:flex;align-items:center;gap:10px}.status-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:rgba(128,128,128,.15)}.status-name{font-weight:700;font-size:14px}.status-sub{font-size:11px;color:var(--text-muted)}.status-state{margin-left:auto;font-size:10px;font-weight:800}.state-online{color:#65d38b}.state-error{color:#ef5350}.state-degraded{color:#f4b400}.state-unknown{color:var(--text-muted)}.state-checking{color:var(--text-muted);animation:statusCheckingPulse 1s ease-in-out infinite}.status-meta{display:flex;justify-content:space-between;margin-top:13px;padding-top:10px;border-top:1px solid var(--border-modal);font-size:11px;color:var(--text-muted)}@keyframes statusIdle{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-4px) rotate(2deg)}}@keyframes statusCheckingPulse{0%,100%{opacity:.5}50%{opacity:1}}@keyframes trapped{0%,100%{transform:translateX(-2px)}50%{transform:translateX(2px)}}@keyframes statusGlitch{0%{transform:translate(0)}25%{transform:translate(-5px,2px)}50%{transform:translate(4px,-2px)}75%{transform:translate(-2px,1px)}100%{transform:translate(0)}}@media(max-width:700px){.status-hero{flex-direction:column;text-align:center}.status-grid{grid-template-columns:1fr}.status-controls{align-items:stretch;flex-direction:column;gap:8px}.status-controls select{width:100%}}
.settings-page{flex:1;overflow-y:auto;padding:18px 16px 60px;animation:fadeIn .35s}
.settings-shell{max-width:640px;margin:auto;display:flex;flex-direction:column;gap:16px}
.settings-topbar{display:flex;align-items:center;justify-content:space-between;text-align:center;gap:12px;margin-bottom:6px}
.settings-topbar small{color:var(--text-muted);font-size:9px;letter-spacing:1.5px}
.settings-topbar h2{font-size:20px;margin:2px 0 0}
@media(max-width:700px){.settings-shell{max-width:100%}}


/* ==== IMAJINASI / K-IMAGE 2.5 CREATIVE STUDIO ==== */
.welcome-imagination-cta { display:flex; align-items:center; gap:12px; width:min(100%,370px); margin:24px auto 0; padding:14px 16px; text-align:left; border:1px solid rgba(153,105,235,.32); border-radius:18px; color:var(--text-main); background:linear-gradient(130deg,rgba(130,82,225,.13),rgba(74,123,255,.07)); box-shadow:0 10px 30px rgba(70,40,120,.06); cursor:pointer; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.welcome-imagination-cta:hover { transform:translateY(-2px); border-color:rgba(153,105,235,.6); box-shadow:0 14px 34px rgba(70,40,120,.12); }
.welcome-imagination-cta:active { transform:scale(.985); }
.welcome-imagination-icon { display:grid; place-items:center; width:40px; height:40px; flex:0 0 40px; border-radius:13px; color:#fff; font-size:21px; background:linear-gradient(145deg,#9364ee,#5e80f9); box-shadow:0 7px 18px rgba(113,88,220,.28); }
.welcome-imagination-copy { display:flex; flex:1; flex-direction:column; gap:3px; min-width:0; }
.welcome-imagination-copy strong { font-size:14px; font-weight:800; }
.welcome-imagination-copy small { font-size:11.5px; line-height:1.4; color:var(--text-muted); }
.welcome-imagination-arrow { margin-left:auto; font-size:20px; color:var(--text-muted); }
.image-generator-page { display:flex; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; background:radial-gradient(ellipse at 50% 0%,rgba(132,85,235,.13),transparent 42%),var(--bg-body); color:var(--text-main); }
.image-gen-shell { box-sizing:border-box; width:min(880px,100%); margin:0 auto; padding:12px 24px 48px; }
.image-gen-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:2px 0 32px; }
.image-gen-back { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--border-modal); border-radius:14px; padding:9px 13px; color:var(--text-main); background:var(--bg-input-wrapper); font-size:12px; font-weight:650; cursor:pointer; }
.image-gen-back:hover { background:var(--text-hover); }
.image-gen-brand { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:800; letter-spacing:.1px; }
.image-gen-brand b { font-weight:900; color:#9a75f5; }
.image-gen-brand-icon { display:grid; place-items:center; width:30px; height:30px; border-radius:10px; background:rgba(143,103,238,.16); color:#a88aff; font-size:18px; }
.image-gen-hero { max-width:610px; margin:0 auto 24px; text-align:center; }
.image-gen-eyebrow { display:inline-flex; align-items:center; gap:8px; margin-bottom:14px; color:var(--text-muted); font-size:9.5px; font-weight:850; letter-spacing:2px; }
.image-gen-live-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#69d4a0; box-shadow:0 0 12px rgba(105,212,160,.55); }
.image-gen-hero h1 { margin:0 0 10px; font-size:clamp(29px,5vw,45px); line-height:1.08; letter-spacing:-1.4px; font-weight:850; }
.image-gen-hero h1 span { color:transparent; background:linear-gradient(95deg,#a576f4,#6595ff); -webkit-background-clip:text; background-clip:text; }
.image-gen-hero p { max-width:530px; margin:0 auto; color:var(--text-muted); font-size:13px; line-height:1.7; }
.image-gen-workspace { padding:18px; border:1px solid var(--border-modal); border-radius:22px; background:var(--bg-input-wrapper); box-shadow:0 16px 42px rgba(0,0,0,.08); }
.image-gen-workspace label { display:block; margin:0 0 10px; font-size:13px; font-weight:800; }
.image-gen-workspace textarea { display:block; box-sizing:border-box; width:100%; min-height:120px; resize:vertical; border:1px solid var(--border-modal); border-radius:15px; padding:15px 16px; background:var(--bg-body); color:var(--text-main); font:inherit; font-size:13px; line-height:1.65; outline:none; transition:border-color .18s,box-shadow .18s; }
.image-gen-workspace textarea:focus { border-color:#9770ed; box-shadow:0 0 0 3px rgba(151,112,237,.12); }
.image-gen-prompt-footer { display:flex; justify-content:space-between; gap:10px; margin:8px 2px 14px; color:var(--text-muted); font-size:10.5px; }
.image-gen-presets { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:15px; }
.image-gen-presets button { border:1px solid var(--border-modal); border-radius:999px; padding:7px 10px; background:var(--bg-body); color:var(--text-main); font-size:11px; cursor:pointer; transition:border-color .18s,background .18s; }
.image-gen-presets button:hover { border-color:#9874e8; background:rgba(140,104,235,.08); }
.image-gen-create-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:49px; border:0; border-radius:14px; padding:12px 16px; color:#fff; background:linear-gradient(105deg,#8d58e7,#557df2); box-shadow:0 10px 24px rgba(109,83,220,.25); font-size:13px; font-weight:800; cursor:pointer; transition:transform .16s,filter .16s,opacity .16s; }
.image-gen-create-btn:hover { filter:brightness(1.06); transform:translateY(-1px); }
.image-gen-create-btn:active { transform:scale(.99); }
.image-gen-create-btn:disabled { cursor:wait; opacity:.75; transform:none; }
.image-gen-arrow { margin-left:auto; font-size:18px; }
.image-gen-privacy-note { margin:10px 0 0; text-align:center; font-size:10.5px; color:var(--text-muted); }
.image-gen-result-wrap { margin-top:25px; }
.image-gen-result-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 1px 12px; }
.image-gen-section-kicker { color:var(--text-muted); font-size:9px; font-weight:850; letter-spacing:1.7px; }
.image-gen-result-heading h2 { margin:3px 0 0; font-size:17px; font-weight:800; }
.image-gen-result-tag { border:1px solid var(--border-modal); border-radius:999px; padding:5px 9px; color:var(--text-muted); font-size:10px; }
.image-gen-result { min-height:190px; display:flex; justify-content:center; align-items:center; padding:12px; border:1px dashed var(--border-modal); border-radius:20px; background:rgba(128,128,128,.025); }
.image-gen-empty-state { display:flex; align-items:center; flex-direction:column; padding:20px 12px; text-align:center; }
.image-gen-empty-art { position:relative; display:grid; place-items:center; width:90px; height:90px; margin-bottom:16px; border:1px solid rgba(143,103,238,.25); border-radius:27px; background:linear-gradient(145deg,rgba(143,103,238,.12),rgba(82,132,255,.08)); color:#a58af4; font-size:29px; }
.image-gen-empty-art:before,.image-gen-empty-art:after { content:""; position:absolute; border:1px solid rgba(143,103,238,.25); border-radius:50%; }
.image-gen-empty-art:before { inset:-10px; }
.image-gen-empty-art:after { inset:9px; border-style:dashed; }
.image-gen-empty-art i { position:absolute; right:13px; top:17px; width:7px; height:7px; border-radius:50%; background:#6794ff; }
.image-gen-empty-art b { position:absolute; left:18px; bottom:19px; width:6px; height:6px; border-radius:50%; background:#b77cff; }
.image-gen-empty-state strong { font-size:13px; font-weight:800; }
.image-gen-empty-state p { margin:6px 0 0; max-width:290px; color:var(--text-muted); font-size:11.5px; line-height:1.55; }
.image-gen-output-card { width:min(100%,640px); overflow:hidden; border:1px solid var(--border-modal); border-radius:17px; background:var(--bg-input-wrapper); box-shadow:0 12px 30px rgba(0,0,0,.08); }
.image-gen-output-card img { display:block; width:100%; max-height:660px; object-fit:contain; background:rgba(128,128,128,.04); cursor:zoom-in; }
.image-gen-output-caption { padding:12px 14px 2px; color:var(--text-muted); font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.image-gen-output-actions { display:flex; justify-content:flex-end; gap:8px; padding:10px 12px 12px; }
.image-gen-output-actions button { border:1px solid var(--border-modal); border-radius:11px; padding:9px 12px; font-size:11.5px; font-weight:750; cursor:pointer; }
.image-gen-preview-btn { color:var(--text-main); background:var(--bg-body); }
.image-gen-download-btn { color:white; border-color:transparent!important; background:linear-gradient(105deg,#8d58e7,#557df2); }
.image-gen-inline-message { width:100%; border-radius:14px; padding:15px; font-size:12.5px; line-height:1.6; text-align:center; }
.image-gen-inline-message.error { color:var(--text-main); background:rgba(239,83,80,.08); border:1px solid rgba(239,83,80,.25); }
.image-gen-spinner { width:14px; height:14px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:imageGenSpin .75s linear infinite; }
@keyframes imageGenSpin { to { transform:rotate(360deg); } }
@media(max-width:600px) { .image-gen-shell { padding:8px 13px 30px; } .image-gen-topbar { margin-bottom:25px; } .image-gen-back { padding:8px 10px; font-size:11px; } .image-gen-hero h1 { font-size:31px; } .image-gen-hero p { font-size:12px; } .image-gen-workspace { padding:13px; border-radius:18px; } .image-gen-workspace textarea { min-height:115px; padding:12px; } .image-gen-prompt-footer { font-size:9.5px; } .image-gen-presets { gap:6px; } .image-gen-presets button { font-size:10px; padding:7px 9px; } .image-gen-result { min-height:170px; padding:7px; } .image-gen-result-heading h2 { font-size:15px; } }
@media(prefers-reduced-motion:reduce) { .welcome-imagination-cta,.image-gen-create-btn,.image-gen-spinner { transition:none; animation:none; } }


/* Imajinasi memakai bahasa visual NERI yang sama dengan halaman chat. */
.welcome-imagination-cta{width:min(100%,420px);margin:20px auto 0;padding:13px 15px;border:1px solid var(--border-modal);border-radius:12px;background:var(--bg-input-wrapper);box-shadow:none;gap:10px}
.welcome-imagination-cta:hover{transform:none;border-color:var(--text-muted);box-shadow:none;background:var(--text-hover)}
.welcome-imagination-cta:active{transform:none}
.welcome-imagination-copy strong{font-size:14px;font-weight:650}
.welcome-imagination-copy small{font-size:12px}
.image-generator-page{background:var(--bg-body)}
.image-gen-shell{width:min(760px,100%);padding:12px 20px 36px}
.image-gen-topbar{margin:2px 0 28px;padding-bottom:14px;border-bottom:1px solid var(--border-modal)}
.image-gen-back{border:0;border-radius:9px;padding:8px 10px;background:transparent;font-size:13px;font-weight:500}
.image-gen-brand{font-size:14px;font-weight:650}
.image-gen-brand b{color:var(--text-main);font-weight:650}
.image-gen-hero{margin:0 0 24px;text-align:left;max-width:none}
.image-gen-eyebrow{margin-bottom:10px;font-size:11px;font-weight:600;letter-spacing:.3px}
.image-gen-hero h1{font-size:27px;line-height:1.25;letter-spacing:-.5px;font-weight:650}
.image-gen-hero h1 span{color:inherit;background:none;-webkit-text-fill-color:currentColor}
.image-gen-hero p{margin:7px 0 0;font-size:13px;line-height:1.55}
.image-gen-workspace{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.image-gen-workspace label{font-size:13px;font-weight:600}
.image-gen-workspace textarea{min-height:130px;border-radius:12px;background:var(--bg-input-wrapper);font-size:14px}
.image-gen-workspace textarea:focus{border-color:var(--text-muted);box-shadow:none}
.image-gen-prompt-footer{min-height:14px;margin-bottom:12px}
.image-gen-presets{gap:7px;margin-bottom:13px}
.image-gen-presets button{border-radius:9px;padding:7px 11px;font-size:12px}
.image-gen-presets button:hover{border-color:var(--text-muted);background:var(--text-hover)}
.image-gen-create-btn{width:auto;min-height:40px;border-radius:9px;padding:10px 17px;background:var(--text-main);color:var(--bg-body);box-shadow:none;font-size:13px;font-weight:600}
.image-gen-create-btn:hover{filter:brightness(.94);transform:none}
.image-gen-privacy-note{margin-top:9px;text-align:left;font-size:11px}
.image-gen-result-wrap{margin-top:28px;padding-top:18px;border-top:1px solid var(--border-modal)}
.image-gen-result-heading{margin-bottom:12px}
.image-gen-result-heading h2{margin:0;font-size:15px;font-weight:650}
.image-gen-result-tag,.image-gen-section-kicker{display:none}
.image-gen-result{min-height:170px;border:1px solid var(--border-modal);border-radius:12px;background:var(--bg-input-wrapper)}
.image-gen-empty-state{padding:25px 12px}
.image-gen-empty-state strong{font-size:13px;font-weight:550}
.image-gen-empty-state p{font-size:12px}
.image-gen-output-card{border-radius:12px;box-shadow:none}
.image-gen-download-btn{background:var(--text-main);color:var(--bg-body)}
.image-gen-inline-message{border-radius:10px}
@media(max-width:600px){.image-gen-shell{padding:8px 16px 28px}.image-gen-topbar{margin-bottom:24px}.image-gen-hero h1{font-size:25px}.image-gen-workspace{padding:0}.image-gen-create-btn{width:100%}.image-gen-result{min-height:150px}}
