/* ===== ДОМАШКА-ПОМОЩНИК (📚) — тёмная тема ===== */

/* Кнопка 📚 в композере «Мой АЯ» */
.hw-composer-btn {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    border: none; background: transparent;
    font-size: 22px; line-height: 1;
    cursor: pointer; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, transform .1s ease;
}
.hw-composer-btn:hover { background: rgba(255,255,255,.08); }
.hw-composer-btn:active { transform: scale(.92); }

/* Оверлей + модалка */
.hw-modal-ov {
    position: fixed; inset: 0; z-index: 10050;
    background: rgba(0,0,0,.62);
    display: flex; align-items: flex-end; justify-content: center;
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    animation: hw-fade .18s ease;
}
@keyframes hw-fade { from { opacity: 0; } to { opacity: 1; } }

.hw-modal {
    width: 100%; max-width: 560px;
    max-height: 88vh;
    display: flex; flex-direction: column;
    background: #1c1f26;
    color: #eef1f6;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.5);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    animation: hw-slide .22s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 620px) {
    .hw-modal-ov { align-items: center; }
    .hw-modal { border-radius: 20px; }
}
@keyframes hw-slide { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.hw-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.hw-title { font-size: 18px; font-weight: 700; }
.hw-close {
    border: none; background: transparent; color: #9aa3b2;
    font-size: 28px; line-height: 1; cursor: pointer;
    width: 36px; height: 36px; border-radius: 10px;
}
.hw-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.hw-sub {
    font-size: 13.5px; color: #a7b0c0; line-height: 1.4;
    margin-bottom: 14px;
}

/* Стартовый экран (фото) */
.hw-start { display: flex; flex-direction: column; gap: 10px; }
.hw-photo-pick {
    width: 100%; padding: 15px 16px;
    border: none; border-radius: 14px;
    background: linear-gradient(135deg, #4f7cff, #6a5cff);
    color: #fff; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: filter .15s ease, transform .1s ease;
}
.hw-photo-pick:hover { filter: brightness(1.08); }
.hw-photo-pick:active { transform: scale(.98); }

.hw-loading {
    padding: 18px 6px; text-align: center;
    color: #a7b0c0; font-size: 14px;
}

/* Лента диалога */
.hw-dialog {
    flex: 1 1 auto; min-height: 120px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    padding: 6px 2px; margin: 4px 0 10px;
}
.hw-subject {
    align-self: center;
    font-size: 12.5px; font-weight: 600; color: #cdd4e0;
    background: rgba(255,255,255,.06);
    padding: 4px 12px; border-radius: 999px;
    margin-bottom: 4px;
}
.hw-bubble {
    max-width: 82%;
    padding: 10px 13px; border-radius: 16px;
    font-size: 14.5px; line-height: 1.45;
    white-space: pre-wrap; word-wrap: break-word;
}
.hw-aya {
    align-self: flex-start;
    background: #2a2f3a; color: #eef1f6;
    border-bottom-left-radius: 5px;
}
.hw-me {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f7cff, #6a5cff);
    color: #fff;
    border-bottom-right-radius: 5px;
}
.hw-typing { color: #9aa3b2; font-style: italic; }

/* Строка ответа */
.hw-reply {
    display: flex; align-items: flex-end; gap: 8px;
    padding-top: 4px;
}
.hw-input {
    flex: 1 1 auto;
    resize: none; max-height: 120px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: #12151b; color: #eef1f6;
    font-size: 15px; line-height: 1.35;
    font-family: inherit; outline: none;
}
.hw-input:focus { border-color: #4f7cff; }
.hw-input::placeholder { color: #6b7385; }
.hw-send {
    flex: 0 0 auto;
    width: 44px; height: 44px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, #4f7cff, #6a5cff);
    color: #fff; font-size: 17px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: filter .15s ease, transform .1s ease;
}
.hw-send:hover { filter: brightness(1.08); }
.hw-send:active { transform: scale(.94); }

/* Кнопки завершения */
.hw-done-bar {
    display: flex; gap: 10px; margin-top: 12px;
}
.hw-done-bar button {
    flex: 1 1 0; padding: 13px 10px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px; cursor: pointer;
    font-size: 14.5px; font-weight: 600;
    background: #232833; color: #eef1f6;
    transition: background .15s ease, transform .1s ease;
}
.hw-done-bar button:hover { background: #2c323f; }
.hw-done-bar button:active { transform: scale(.97); }
.hw-done-self { border-color: rgba(66,196,120,.5) !important; }
.hw-done-self:hover { background: rgba(66,196,120,.16) !important; }
