* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #e0e0e0;
    min-height: 100vh;
}

/* LOGIN */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
}
.login-box {
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 16px;
    padding: 48px 40px;
    width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-box h1 {
    font-size: 28px;
    color: #c084fc;
    margin-bottom: 8px;
}
.login-box p {
    color: #666;
    margin-bottom: 32px;
    font-size: 14px;
}
.login-box input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}
.login-box input:focus { border-color: #c084fc; }
.login-box button {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.login-box button:hover { opacity: 0.9; }
.login-error {
    color: #f87171;
    margin-top: 12px;
    font-size: 14px;
    display: none;
}

/* DASHBOARD */
#dashboard { display: none; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(22, 22, 26, 0.78);
    border-bottom: 1px solid #2a2a3e;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.topbar h1 {
    font-size: 20px;
    color: #c084fc;
    letter-spacing: 0.3px;
    text-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}
.topbar .logout {
    background: rgba(15, 15, 20, 0.9);
    border: 1px solid #333;
    color: #888;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.topbar .logout:hover {
    color: #e0e0e0;
    border-color: #a855f7;
    background: #1e1030;
    transform: translateY(-1px);
}

.nav-buttons {
    display: flex;
    gap: 16px;
    padding: 32px;
    justify-content: center;
}
.nav-btn {
    padding: 20px 48px;
    border-radius: 14px;
    border: 1px solid #2a2a3e;
    background: rgba(22, 22, 26, 0.86);
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.nav-btn:hover {
    border-color: #c084fc;
    background: #1e1e2a;
    transform: translateY(-1px);
}
.nav-btn:active { transform: translateY(0) scale(0.99); }
.nav-btn.active {
    border-color: #a855f7;
    background: #1e1030;
    color: #c084fc;
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.2);
}
.nav-btn .icon { font-size: 24px; }

/* PANELS */
.panel { display: none; padding: 0 32px 32px; background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 0; }
.panel.active { display: block; }

/* LOVENSE PANEL */
.lovense-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
    height: 80vh;
}
.lovense-side-img {
    width: 220px;
    min-width: 160px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a3e;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lovense-side-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lovense-side-img .side-placeholder {
    color: #333;
    font-size: 12px;
    text-align: center;
    padding: 12px;
}
#lovense-panel iframe {
    flex: 1;
    height: 100%;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    background: #111;
}

/* REDIS PANEL */
.redis-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}
.redis-toolbar input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}
.redis-toolbar input:focus { border-color: #c084fc; }
.redis-toolbar button {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
}
.redis-toolbar button:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.32);
}
.redis-toolbar button:active { transform: translateY(0) scale(0.99); }

.redis-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 280px);
}
.key-list {
    width: 360px;
    min-width: 280px;
    background: linear-gradient(rgba(22, 22, 26, 0.78), rgba(22, 22, 26, 0.78)), url("/redis-keys-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    overflow-y: auto;
}
.key-list-header {
    padding: 16px;
    border-bottom: 1px solid #2a2a3e;
    font-weight: 600;
    color: #888;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    background: #16161a;
    border-radius: 12px 12px 0 0;
}
.key-item {
    padding: 12px 16px;
    border-bottom: 1px solid #1a1a24;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.key-item:hover { background: #1e1e2a; }
.key-item.active { background: #1e1030; border-left: 3px solid #a855f7; }
.key-item .key-name {
    flex: 1;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
}
.key-item .key-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.type-string { background: #1a3a2a; color: #4ade80; }
.type-hash { background: #3a2a1a; color: #fbbf24; }
.type-list { background: #1a2a3a; color: #60a5fa; }
.type-set { background: #3a1a3a; color: #c084fc; }
.type-zset { background: #3a1a2a; color: #f472b6; }

.key-value {
    flex: 1;
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.value-header {
    padding: 16px;
    border-bottom: 1px solid #2a2a3e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #16161a;
}
.value-header .key-path {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #c084fc;
}
.value-header .meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #666;
}
.value-header .meta span { padding: 4px 10px; background: #1a1a24; border-radius: 6px; }
.value-content {
    flex: 1;
    padding: 20px;
    overflow: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}
.value-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    font-size: 16px;
}
.btn-delete {
    background: none;
    border: 1px solid #7f1d1d;
    color: #f87171;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}
.btn-delete:hover { background: #7f1d1d33; }

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.count-badge {
    background: #1e1030;
    color: #c084fc;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 8px;
}

/* hash table display */
.hash-table {
    width: 100%;
    border-collapse: collapse;
}
.hash-table th {
    text-align: left;
    padding: 10px 14px;
    background: #1a1a24;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}
.hash-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #1a1a24;
    vertical-align: top;
}
.hash-table td:first-child {
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
    width: 200px;
}
.array-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #0f0f14;
    border-radius: 8px;
    border: 1px solid #1a1a24;
}
.array-item:hover { border-color: #2a2a3e; }
.array-item .item-index {
    color: #666;
    flex-shrink: 0;
    min-width: 30px;
    padding-top: 2px;
}
.array-item .item-content {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-all;
}
.array-item .btn-del-item {
    flex-shrink: 0;
    background: none;
    border: 1px solid #7f1d1d;
    color: #f87171;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.array-item:hover .btn-del-item { opacity: 1; }
.array-item .btn-del-item:hover { background: #7f1d1d33; }
.btn-edit-item {
    flex-shrink: 0;
    background: none;
    border: 1px solid #334155;
    color: #93c5fd;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.array-item:hover .btn-edit-item { opacity: 1; }
.btn-edit-item:hover { background: #1e3a8a33; }
.inline-editor {
    margin-top: 8px;
    width: 100%;
}
.inline-editor textarea {
    width: 100%;
    min-height: 92px;
    background: #0b0b10;
    color: #e0e0e0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.4;
}
.inline-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-save-edit {
    background: #1e3a8a33;
    border: 1px solid #334155;
    color: #93c5fd;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}
.btn-save-edit:hover { background: #1e3a8a55; }
.btn-cancel-edit {
    background: none;
    border: 1px solid #333;
    color: #aaa;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}
.btn-cancel-edit:hover { border-color: #444; color: #ddd; }

/* RESSOURCES PANEL */
.res-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.res-toolbar label {
    padding: 12px 24px;
    border-radius: 10px;
    border: 2px dashed #a855f7;
    color: #c084fc;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.res-toolbar label:hover { background: #1e1030; }
.res-toolbar input[type=file] { display: none; }
.res-upload-status { font-size: 13px; color: #888; }
.res-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.res-card {
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
    position: relative;
}
.res-card:hover { border-color: #a855f7; }
.res-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    cursor: pointer;
    background: #0a0a0f;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}
.res-card:hover img { opacity: 1; }
.res-card-footer {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.res-card-name {
    font-size: 11px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.res-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.res-card-actions button {
    background: none;
    border: 1px solid #333;
    color: #888;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}
.res-card-actions .btn-use { border-color: #334155; color: #93c5fd; }
.res-card-actions .btn-use:hover { background: #1e3a8a33; }
.res-card-actions .btn-rm { border-color: #7f1d1d; color: #f87171; }
.res-card-actions .btn-rm:hover { background: #7f1d1d33; }

/* RESSOURCES SUB-TABS */
.res-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.res-sub-tab {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #16161a;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.res-sub-tab:hover { border-color: #c084fc; color: #c084fc; }
.res-sub-tab.active { border-color: #a855f7; background: #1e1030; color: #c084fc; }
.res-tab-content { display: none; }
.res-tab-content.active { display: block; }

/* HABITS CATALOG */
.habits-container { display: flex; flex-direction: column; gap: 12px; }
.habit-section {
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.habit-section.open { border-color: #a855f7; }
.habit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}
.habit-header:hover { background: #1e1030; }
.habit-header-left { display: flex; align-items: center; gap: 12px; }
.habit-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.habit-toggle {
    font-size: 12px;
    color: #666;
    width: 16px;
    transition: transform 0.2s;
}
.habit-label {
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e0;
}
.habit-code {
    font-size: 12px;
    color: #666;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: #0f0f14;
    padding: 2px 8px;
    border-radius: 6px;
}
.habit-stat {
    font-size: 11px;
    color: #888;
    background: #0f0f14;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.habit-stat.stat-normal { color: #34d399; }
.habit-stat.stat-x512 { color: #60a5fa; }
.habit-stat.stat-static { color: #94a3b8; }
.habit-stat.stat-custom { color: #f59e0b; }

.habit-expressions { padding: 0 20px 20px; }
.expr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.expr-card {
    background: #0f0f14;
    border: 1px solid #2a2a3e;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.expr-card:hover { border-color: #7c3aed; }
.expr-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.expr-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}
.expr-card:hover .expr-preview img { opacity: 1; }
.expr-no-image {
    color: #444;
    font-size: 13px;
    text-align: center;
}
.expr-info { padding: 12px; }
.expr-name {
    font-size: 14px;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 2px;
}
.expr-code {
    font-size: 11px;
    color: #666;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 6px;
    word-break: break-all;
}
.expr-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    margin-bottom: 8px;
}
.expr-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.expr-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.expr-badge.badge-ok { background: #064e3b; color: #34d399; }
.expr-badge.badge-missing { background: #450a0a; color: #f87171; }
.expr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.expr-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #2a2a3e;
    color: #93c5fd;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.expr-btn:hover { background: #1e3a8a33; border-color: #60a5fa; }
.expr-btn-view { color: #a78bfa; border-color: #3b2f6b; }
.expr-btn-view:hover { background: #1e103033; border-color: #a78bfa; }

/* Expression source styles */
.expr-source-bar {
    padding: 4px 10px;
    display: flex;
    align-items: center;
}
.expr-source-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.source-static { background: #1e293b; color: #94a3b8; }
.source-custom { background: #422006; color: #f59e0b; }
.source-both { background: #1a1040; color: #c084fc; }
.expr-card-custom { border-color: #78350f; }
.expr-card-custom:hover { border-color: #f59e0b; }
.expr-card-both { border-color: #3b2f6b; }
.expr-card-both:hover { border-color: #c084fc; }

/* Tags */
.expr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.expr-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #1e293b;
    color: #60a5fa;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Dates */
.expr-dates {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}
.expr-date {
    font-size: 10px;
    color: #666;
}

/* Expression image upload */
.expr-upload-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.expr-upload-btn {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px dashed #a855f7;
    color: #c084fc;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-align: center;
}
.expr-upload-btn:hover { background: #1e1030; border-style: solid; }
.expr-upload-x512 { border-color: #3b82f6; color: #60a5fa; }
.expr-upload-x512:hover { background: #0f172a; border-style: solid; }
.expr-upload-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}
.expr-upload-status.uploading { color: #f59e0b; }
.expr-upload-status.success { color: #34d399; }
.expr-upload-status.error { color: #f87171; }

/* Use-as modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 16px;
    padding: 32px;
    min-width: 340px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-box h3 { color: #c084fc; margin-bottom: 20px; font-size: 18px; }
.modal-choices { display: flex; flex-direction: column; gap: 10px; }
.modal-choices button {
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}
.modal-choices button:hover { border-color: #a855f7; background: #1e1030; }
.modal-close {
    margin-top: 16px;
    background: none;
    border: 1px solid #333;
    color: #888;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
}
.modal-close:hover { color: #e0e0e0; border-color: #555; }
.modal-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 2px;
    margin-top: 6px;
    border-top: 1px solid #2a2a3e;
}
.modal-section-label:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}
.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 4px;
}

/* WALLET PANEL */
.wallet-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 10px;
    font-size: 13px;
    color: #888;
}
.wallet-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    flex-shrink: 0;
    transition: background 0.3s;
}
.wallet-status-dot.online { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.wallet-status-dot.offline { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.4); }

.wallet-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .wallet-layout { grid-template-columns: 1fr; }
}

.wallet-card {
    background: rgba(22, 22, 26, 0.78);
    border: 1px solid #2a2a3e;
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.2s;
}
.wallet-card:hover { border-color: #3a3a5e; }

.wallet-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #2a2a3e;
}
.wallet-card-icon { font-size: 22px; }
.wallet-card-title { font-size: 16px; font-weight: 600; color: #e0e0e0; }

.wallet-address {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}
.wallet-address-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.wallet-address-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #a78bfa;
    word-break: break-all;
    cursor: pointer;
    padding: 8px 12px;
    background: #0f0f14;
    border-radius: 8px;
    border: 1px solid #2a2a3e;
    transition: border-color 0.2s;
}
.wallet-address-value:hover { border-color: #a855f7; }

.wallet-balance-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}
.wallet-balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: #fbbf24;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.wallet-balance-denom {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
}
.wallet-balance-sub {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.wallet-refresh-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: rgba(15, 15, 20, 0.9);
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.wallet-refresh-btn:hover {
    border-color: #a855f7;
    background: #1e1030;
    transform: translateY(-1px);
}
.wallet-refresh-btn:active { transform: translateY(0) scale(0.99); }

/* Send form */
.wallet-field {
    margin-bottom: 16px;
}
.wallet-field label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wallet-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.wallet-field input:focus { border-color: #c084fc; }
.wallet-field input::placeholder { color: #444; }

.wallet-send-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a2e;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 4px;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.28);
}
.wallet-send-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.wallet-send-btn:active { transform: scale(0.98); }
.wallet-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-tx-result {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.wallet-tx-result.success {
    background: #052e16;
    border: 1px solid #166534;
    color: #4ade80;
}
.wallet-tx-result.error {
    background: #450a0a;
    border: 1px solid #7f1d1d;
    color: #f87171;
}

/* Chain info */
.wallet-info-card { }
.wallet-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 700px) {
    .wallet-info-grid { grid-template-columns: 1fr; }
}
.wallet-info-item {
    padding: 16px;
    background: #0f0f14;
    border-radius: 10px;
    border: 1px solid #1a1a24;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wallet-info-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wallet-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Staking */
.wallet-staking-card {
    margin-bottom: 20px;
}

.staking-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: #0f0f14;
    border-radius: 10px;
    border: 1px solid #1a1a24;
    flex-wrap: wrap;
}

.staking-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.staking-stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staking-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.staking-stat-value.staking-rewards {
    color: #4ade80;
}

.staking-claim-btn {
    margin-left: auto;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #052e16;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);
}
.staking-claim-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.staking-claim-btn:active { transform: scale(0.98); }
.staking-claim-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.staking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.staking-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #2a2a3e;
}

.staking-table tbody td {
    padding: 12px;
    color: #e0e0e0;
    border-bottom: 1px solid #1a1a24;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.staking-table tbody tr:hover {
    background: #1a1a24;
}

.staking-validator-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 600;
    color: #c084fc !important;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.staking-rewards {
    color: #4ade80 !important;
}

.staking-unstake-quick {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #7f1d1d;
    background: transparent;
    color: #f87171;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.staking-unstake-quick:hover {
    background: #450a0a;
    border-color: #f87171;
}

.staking-empty {
    padding: 24px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.staking-loading {
    padding: 24px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.staking-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 16px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #2a2a3e;
}

.staking-unbonding-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #0f0f14;
    border-radius: 8px;
    border: 1px solid #1a1a24;
    margin-bottom: 8px;
    font-size: 13px;
    color: #e0e0e0;
    gap: 12px;
}

.staking-delegate-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 4px;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.3);
}
.staking-delegate-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.staking-delegate-btn:active { transform: scale(0.98); }
.staking-delegate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.staking-undelegate-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 4px;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.25);
}
.staking-undelegate-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.staking-undelegate-btn:active { transform: scale(0.98); }
.staking-undelegate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.staking-note {
    margin-top: 12px;
    padding: 10px;
    background: #1a1500;
    border: 1px solid #422006;
    border-radius: 8px;
    font-size: 12px;
    color: #fbbf24;
    text-align: center;
}

#delegate-validator,
#undelegate-validator {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'SF Mono', 'Fira Code', monospace;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
#delegate-validator:focus,
#undelegate-validator:focus { border-color: #c084fc; }
#delegate-validator option,
#undelegate-validator option {
    background: #16161a;
    color: #e0e0e0;
}

@media (max-width: 700px) {
    .staking-summary { flex-direction: column; align-items: flex-start; }
    .staking-claim-btn { margin-left: 0; width: 100%; }
    .staking-table { font-size: 11px; }
    .staking-table thead th, .staking-table tbody td { padding: 8px 6px; }
}

/* ==================== GARDE-ROBE ==================== */

.gr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: #888;
    font-size: 14px;
}

.gr-current-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    margin-bottom: 24px;
}
.gr-current-label {
    font-size: 13px;
    color: #888;
}
.gr-current-name {
    font-size: 16px;
    font-weight: 700;
    color: #c084fc;
}
.gr-current-badge {
    font-size: 13px;
    color: #4ade80;
    margin-left: auto;
}

/* Carousel */
.gr-carousel {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin-bottom: 12px;
}

.gr-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #2a2a3e;
    background: #16161a;
    color: #c084fc;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.gr-arrow:hover {
    border-color: #c084fc;
    background: #1e1030;
}

.gr-slide {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #16161a;
    border: 2px solid #2a2a3e;
    border-radius: 16px;
    padding: 20px 32px;
    min-width: 400px;
    max-width: 600px;
    transition: border-color 0.3s;
}
.gr-slide:hover {
    border-color: #a855f7;
}

.gr-slide-img {
    width: 180px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #0f0f14;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gr-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0a0a0f;
}

.gr-no-img {
    color: #555;
    font-size: 12px;
    text-align: center;
}

.gr-slide-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gr-slide-label {
    font-size: 22px;
    font-weight: 700;
    color: #e0e0e0;
}
.gr-slide-code {
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #888;
    background: #0f0f14;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}
.gr-slide-count {
    font-size: 13px;
    color: #c084fc;
    font-weight: 600;
}

/* Dots */
.gr-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}
.gr-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2a2a3e;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.gr-dot.active {
    background: #a855f7;
    transform: scale(1.3);
}
.gr-dot.worn {
    border-color: #4ade80;
}

/* Expressions grid */
.gr-expr-title {
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 16px;
}

.gr-expr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.gr-expr-card {
    background: #16161a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}
.gr-expr-card:hover {
    border-color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.gr-expr-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0f0f14;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gr-expr-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0a0a0f;
}
.gr-expr-no-img {
    font-size: 28px;
    color: #333;
}

.gr-expr-name {
    padding: 8px 10px 2px;
    font-size: 13px;
    font-weight: 700;
    color: #c084fc;
}
.gr-expr-desc {
    padding: 2px 10px 10px;
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}

/* Change outfit — inline picker */
.gr-slide {
    cursor: pointer;
}

.gr-inline-pick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #2a2a3e;
    animation: grFadeIn 0.2s ease;
}
@keyframes grFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.gr-pick-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gr-pick-btns {
    display: flex;
    gap: 10px;
}
.gr-who-btn {
    padding: 8px 24px;
    border-radius: 8px;
    border: 2px solid #2a2a3e;
    background: #0f0f14;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.gr-who-btn:hover {
    border-color: #a855f7;
    background: #1e1030;
    color: #c084fc;
}
.gr-who-btn:active {
    transform: scale(0.95);
}

/* Toast */
.gr-toast {
    text-align: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    animation: grFadeIn 0.25s ease;
}
.gr-toast.success {
    background: #052e16;
    border: 1px solid #166534;
    color: #4ade80;
}
.gr-toast.error {
    background: #1a0000;
    border: 1px solid #7f1d1d;
    color: #f87171;
}

@media (max-width: 700px) {
    .gr-slide { min-width: auto; flex-direction: column; padding: 16px; gap: 12px; }
    .gr-slide-img { width: 100%; height: 160px; }
    .gr-expr-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .gr-pick-btns { flex-direction: column; }
    .gr-who-btn { text-align: center; }
}

/* ============================
   CHAT PANEL — Telegram-style
   ============================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    background: #0e0e14;
    border-radius: 14px;
    border: 1px solid #1e1e30;
    overflow: hidden;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #16161e;
    border-bottom: 1px solid #24243a;
    flex-shrink: 0;
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.chat-header-info {
    display: flex;
    flex-direction: column;
}
.chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
}
.chat-header-status {
    font-size: 12px;
    color: #666;
}
.chat-header-status.online {
    color: #4ade80;
}
.chat-header-actions {
    display: flex;
    gap: 6px;
}
.chat-action-btn {
    background: transparent;
    border: 1px solid #2a2a40;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #aaa;
    transition: all 0.2s;
}
.chat-action-btn:hover {
    border-color: #a855f7;
    background: #1a1030;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.03) 0%, transparent 70%),
        #0c0c12;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #2a2a40;
    border-radius: 3px;
}

.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    padding: 40px;
    font-size: 14px;
}

/* Date separator */
.chat-date-sep {
    text-align: center;
    margin: 12px 0;
    position: relative;
}
.chat-date-sep span {
    background: #1a1a28;
    color: #888;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 10px;
    display: inline-block;
}

/* Message bubble */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: chatMsgIn 0.2s ease;
}
@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.eve {
    align-self: flex-start;
}
.chat-msg.user {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}
.chat-msg.eve .chat-bubble {
    background: #1e1e30;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Name label */
.chat-bubble-name {
    font-size: 11px;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 2px;
}
.chat-msg.user .chat-bubble-name {
    color: #c4b5fd;
}

/* Time */
.chat-bubble-time {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    text-align: right;
}
.chat-msg.user .chat-bubble-time {
    color: rgba(255,255,255,0.5);
}

/* Sticker */
.chat-sticker {
    max-width: 180px;
    max-height: 180px;
    border-radius: 8px;
}
.chat-msg .chat-sticker-wrap {
    padding: 4px;
    background: transparent;
}
.chat-msg.eve .chat-sticker-wrap {
    background: transparent;
}
.chat-msg.user .chat-sticker-wrap {
    background: transparent;
}

/* Image */
.chat-img {
    max-width: 280px;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s;
}
.chat-img:hover {
    transform: scale(1.02);
}

/* Caption under image */
.chat-caption {
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.4;
}

/* Voice / video placeholder */
.chat-media-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 13px;
    color: #aaa;
}

/* Floating date badge */
.chat-date-badge {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20,20,35,0.9);
    color: #888;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 10px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Mobile */
@media (max-width: 700px) {
    .chat-container { height: calc(100vh - 120px); }
    .chat-msg { max-width: 85%; }
    .chat-img { max-width: 220px; }
    .chat-sticker { max-width: 140px; max-height: 140px; }
}
