* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* --- Основной сайт --- */
.site-header {
    background: linear-gradient(135deg, #4b2c8a, #6a4bb3);
    color: #fff;
    padding: 28px 0;
    text-align: center;
}
.site-header h1 { margin: 0; font-size: 22px; font-weight: 600; }
.site-header .date { margin: 6px 0 0; opacity: .85; font-size: 14px; }

.signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 24px 0;
}
.sign-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e4e4e8;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
}
.sign-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.sign-card.active { border-color: #6a4bb3; box-shadow: 0 0 0 2px rgba(106,75,179,.15); }
.sign-name { font-weight: 600; font-size: 16px; }
.sign-hint { font-size: 12px; color: #86868b; margin-top: 4px; }

.horoscope-box {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid #e4e4e8;
}
.horoscope-box h2 { margin-top: 0; font-size: 18px; }
.horoscope-box p { margin: 0; font-size: 16px; color: #333; }

.site-footer { padding: 32px 0 48px; text-align: center; }
.link-button {
    background: none; border: none; padding: 8px;
    color: #6a4bb3; font-size: 13px; cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: #4b2c8a; }

/* --- Модальное окно --- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.modal-backdrop.visible { display: flex; }
.modal {
    background: #fff; border-radius: 14px;
    padding: 22px; width: 100%; max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal .muted { color: #86868b; font-size: 13px; margin: 0 0 12px; }
.modal textarea {
    width: 100%; border: 1px solid #d2d2d7; border-radius: 10px;
    padding: 10px 12px; font-size: 15px; font-family: inherit;
    resize: vertical; min-height: 90px; outline: none;
}
.modal textarea:focus { border-color: #6a4bb3; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}
.support-status {
    margin-top: 12px; padding: 10px 12px;
    background: #eef7ee; color: #23601e;
    border-radius: 8px; font-size: 14px; text-align: center;
}

.btn {
    background: #6a4bb3; color: #fff; border: none;
    padding: 10px 16px; border-radius: 10px;
    font-size: 15px; cursor: pointer;
    transition: background .15s;
}
.btn:hover { background: #4b2c8a; }
.btn.ghost { background: #f0f0f3; color: #1d1d1f; }
.btn.ghost:hover { background: #e4e4e8; }
.btn.danger { background: #d63b3b; }
.btn.danger:hover { background: #a82d2d; }
.btn.exit { background: #1d1d1f; }
.btn.exit:hover { background: #000; }

/* --- Чат --- */
.chat-body {
    background: #0f1115; color: #eaeaea;
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden;
}
.chat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: #161a21;
    border-bottom: 1px solid #222831;
    flex-shrink: 0;
}
.chat-header-left { display: flex; flex-direction: column; }
.chat-title { font-weight: 600; font-size: 15px; }
.chat-alias { font-size: 12px; color: #98a0ab; }
.chat-header-right { display: flex; gap: 8px; }
.chat-header .btn { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.chat-main {
    flex: 1; overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}
.messages { display: flex; flex-direction: column; gap: 10px; }

.msg {
    max-width: 80%;
    background: #1c2129;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 15px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.msg.mine { align-self: flex-end; background: #3a2b6e; }
.msg .meta {
    font-size: 11px; color: #98a0ab;
    margin-bottom: 3px;
    display: flex; gap: 8px; align-items: center;
}
.msg .del {
    background: none; border: none; padding: 0 2px;
    color: #98a0ab; font-size: 14px; cursor: pointer;
    line-height: 1;
}
.msg .del:hover { color: #ff8a8a; }
.msg .body { white-space: pre-wrap; }

.chat-footer {
    padding: 10px; background: #161a21;
    border-top: 1px solid #222831;
    flex-shrink: 0;
}
.send-form { display: flex; gap: 8px; }
.send-form input {
    flex: 1; padding: 11px 14px; border-radius: 10px;
    border: 1px solid #2c333f; background: #0f1115; color: #eaeaea;
    font-size: 15px; outline: none;
}
.send-form input:focus { border-color: #6a4bb3; }

@media (max-width: 480px) {
    .msg { max-width: 88%; }
    .chat-header .btn { padding: 7px 10px; font-size: 12px; }
}