* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0f1115;
    color: #e6e8eb;
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

/* --- Вход --- */
.login-page { align-items: center; justify-content: center; }
.login-box {
    background: #1a1d24;
    padding: 28px 24px;
    border-radius: 14px;
    width: min(360px, 90vw);
    box-shadow: 0 10px 40px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-box h1 { margin: 0; font-size: 20px; }
.login-box .sub { margin: 0 0 6px; color: #8b909a; font-size: 14px; }
.login-box input, .login-box button {
    padding: 12px 14px; border-radius: 10px; border: 1px solid #2a2e38;
    font-size: 16px;
}
.login-box input { background: #0f1115; color: #e6e8eb; }
.login-box button { background: #3b82f6; color: #fff; border: none; cursor: pointer; font-weight: 600; }
.login-box button:hover { background: #2f6fe0; }
.error { color: #ff6b6b; font-size: 14px; text-align: center; }

/* --- Шапка --- */
header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #151820; border-bottom: 1px solid #232732;
    flex: 0 0 auto;
}
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
#status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot.on { background: #34d399; box-shadow: 0 0 8px #34d399; }
.dot.off { background: #ef4444; }
.head-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.node { color: #8b909a; }
.logout { color: #93a3b8; text-decoration: none; }
.logout:hover { color: #fff; }

/* --- Лента --- */
main {
    flex: 1 1 auto; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; word-wrap: break-word; }
.msg .meta { font-size: 11px; color: #8b909a; margin-bottom: 3px; }
.msg .body { font-size: 15px; white-space: pre-wrap; line-height: 1.35; }
.msg.seller { align-self: flex-start; background: #1e2330; border: 1px solid #2a3142; }
.msg.me { align-self: flex-end; background: #1e3a5f; border: 1px solid #2b4a73; }
.msg .img { max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 4px; display: block; }

/* --- Низ --- */
footer { flex: 0 0 auto; padding: 10px 12px; background: #151820; border-top: 1px solid #232732; }
.commands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cmd {
    background: #232a38; color: #cdd5e0; border: 1px solid #303a4d;
    padding: 6px 10px; border-radius: 20px; font-size: 13px; cursor: pointer;
}
.cmd:hover { background: #2c3445; }
#send-form { display: flex; gap: 8px; }
#send-input {
    flex: 1; padding: 11px 14px; border-radius: 22px; border: 1px solid #2a2e38;
    background: #0f1115; color: #e6e8eb; font-size: 16px;
}
#send-btn {
    width: 46px; border: none; border-radius: 50%; background: #3b82f6; color: #fff;
    font-size: 20px; cursor: pointer;
}
#send-btn:hover { background: #2f6fe0; }
.send-error { color: #ff6b6b; font-size: 13px; min-height: 16px; margin-top: 6px; }

/* --- Панель аккаунтов --- */
.accounts-bar { margin-bottom: 8px; }
.acc-toggle {
    background: #232a38; color: #cdd5e0; border: 1px solid #303a4d;
    padding: 7px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
}
.acc-toggle:hover { background: #2c3445; }
.hidden { display: none; }
.accounts-panel {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 45vh; overflow-y: auto; margin-bottom: 10px;
}
.acc-card {
    background: #161b25; border: 1px solid #2a3142; border-radius: 12px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
}
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.acc-note { font-size: 14px; font-weight: 600; color: #e6e8eb; }
.acc-cmd { flex: 0 0 auto; }
.acc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-label { width: 56px; color: #8b909a; font-size: 12px; flex: 0 0 auto; }
.acc-val {
    flex: 1; min-width: 80px; font-family: ui-monospace, Consolas, monospace; font-size: 14px;
    color: #e6e8eb; word-break: break-all;
}
.acc-val.pw { color: #cdd5e0; }
.copy, .reveal {
    background: #232a38; color: #9fb4cf; border: 1px solid #303a4d;
    padding: 5px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; flex: 0 0 auto;
}
.copy:hover, .reveal:hover { background: #2c3445; color: #fff; }
