/* ===== SOVMESTNYE SPISKI: kartochka spiska v soobschenii + modalka sozdaniya ===== */
/* Ispolzuem realnye peremennye base.css: --accent, --text, --text-secondary, --border, --bubble-other. */

.aya-list-host { display: block; margin: 2px 0; }
.aya-list {
    box-sizing: border-box;
    max-width: min(340px, 84vw);
    background: var(--bubble-other, #fff);
    border: 1px solid var(--border, rgba(0,56,65,.1));
    border-radius: 16px;
    padding: 12px 12px 12px;
    color: var(--text, #1A1D21);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.aya-list-loading { color: var(--text-secondary, #65676B); font-size: 14px; text-align: center; padding: 16px 8px; }

.aya-list-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.aya-list-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-secondary, #65676B); }

.aya-list-items { display: flex; flex-direction: column; gap: 2px; }
.aya-list-empty { color: var(--text-secondary, #65676B); font-size: 13px; text-align: center; padding: 10px 4px; }

.aya-list-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 2px; border-radius: 8px; }
.aya-list-item:active { background: var(--border, rgba(0,0,0,.05)); }

.aya-list-check {
    appearance: none; border: none; background: transparent; cursor: pointer;
    font-size: 19px; line-height: 1; padding: 0; flex: 0 0 auto; color: var(--accent, #ff8c42);
}
.aya-list-check:active { transform: scale(.9); }

.aya-list-text { flex: 1 1 auto; font-size: 14px; line-height: 1.35; word-break: break-word; }
.aya-list-who { display: block; font-size: 11px; color: var(--text-secondary, #65676B); margin-top: 1px; }

.aya-list-item.done .aya-list-text { text-decoration: line-through; color: var(--text-secondary, #65676B); opacity: .75; }

.aya-list-del {
    appearance: none; border: none; background: transparent; cursor: pointer;
    font-size: 14px; line-height: 1; padding: 2px 4px; flex: 0 0 auto;
    color: var(--text-secondary, #65676B); opacity: .55;
}
.aya-list-del:active { opacity: 1; }

.aya-list-add { display: flex; gap: 6px; margin-top: 10px; }
.aya-list-add-input {
    flex: 1 1 auto; min-width: 0; box-sizing: border-box;
    border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 10px;
    padding: 8px 10px; font-size: 14px; font-family: inherit;
    background: var(--bg, #fff); color: var(--text, #1A1D21);
}
.aya-list-add-input:focus { outline: none; border-color: var(--accent, #ff8c42); }
.aya-list-add-btn {
    appearance: none; border: none; border-radius: 10px; padding: 8px 12px;
    font-size: 13px; font-weight: 600; cursor: pointer; flex: 0 0 auto;
    background: var(--accent, #ff8c42); color: #fff; line-height: 1;
}
.aya-list-add-btn:active { transform: scale(.97); }

/* --- knopka «Списки» v kompozere (kak game-btn-mobile) --- */
.list-btn-mobile {
    flex: 0 0 auto; width: 38px; height: 38px; border: none; background: transparent;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--text, #1A1D21);
}
.list-btn-mobile:active { background: var(--border, rgba(0,0,0,.06)); }

/* --- modalka vybora tipa spiska (v duhe aya-game-modal) --- */
.aya-list-modal-ov { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.aya-list-modal { width: 100%; max-width: 480px; background: var(--bg, #fff); color: var(--text, #1A1D21); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(0,0,0,.2); }
.aya-list-modal-title { font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 14px; }
.aya-list-modal-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.aya-list-pick { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 1px solid var(--border, rgba(0,56,65,.1)); border-radius: 14px; background: var(--bubble-other, #fff); color: var(--text, #1A1D21); font-size: 15px; font-weight: 600; cursor: pointer; }
.aya-list-pick:active { transform: scale(.98); }
.aya-list-pick .lpick-ic { font-size: 24px; }
.aya-list-modal-close { width: 100%; }

/* --- tyomnaya tema --- */
body.dark-theme .aya-list-modal { background: #161D27; }
body.dark-theme .aya-list-pick { background: #222b35; }
body.dark-theme .aya-list-add-input { background: #1c2530; }

/* === Menyu «skrepki» (attach menu): bottom-sheet v iOS/TG-stile — kruzhki-ikonki, razdeliteli, grabber === */
.attach-menu-ov {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(6,18,30,.42);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    animation: attachFade .14s ease;
}
@keyframes attachFade { from { opacity: 0; } to { opacity: 1; } }
.attach-menu-sheet {
    width: calc(100% - 16px); max-width: 480px;
    margin: 0 8px 8px;
    background: var(--panel, #fff); border-radius: 20px;
    padding: 4px 8px 8px; box-shadow: 0 12px 44px rgba(0,16,34,.28);
    animation: attachUp .22s cubic-bezier(.22,1,.36,1);
}
@keyframes attachUp { from { transform: translateY(22px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.attach-menu-grabber {
    width: 36px; height: 4px; border-radius: 999px;
    background: var(--text-tertiary, #6E7177); opacity: .35;
    margin: 8px auto 6px;
}
.attach-menu-item {
    display: flex; align-items: center; gap: 14px;
    width: 100%; border: none; background: transparent;
    padding: 11px 10px; border-radius: 14px;
    font-size: 16px; font-weight: 500; letter-spacing: -.01em;
    color: var(--text, #0b1620); cursor: pointer; text-align: left;
    position: relative; transition: background .12s ease;
}
/* tonkij razdelitel mezhdu punktami — ot teksta, kak v iOS */
.attach-menu-item:not(:last-child)::after {
    content: ''; position: absolute; left: 64px; right: 10px; bottom: 0;
    height: 1px; background: var(--divider, #e4e6eb);
}
.attach-menu-item:active { background: var(--soft, #eef2f6); }
.attach-menu-ic {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; line-height: 1;
    background: linear-gradient(135deg, rgba(0,95,109,.13), rgba(10,124,136,.08));
    box-shadow: inset 0 0 0 1px rgba(0,95,109,.08);
}
.attach-menu-lbl { flex: 1; }
/* «Otmena» — otdelnaya kartochka pod shtorkoj (iOS action sheet) */
.attach-menu-cancel {
    width: calc(100% - 16px); max-width: 480px;
    margin: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
    border: none; border-radius: 20px; padding: 15px;
    background: var(--panel, #fff); color: var(--brand, #005f6d);
    font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
    box-shadow: 0 8px 32px rgba(0,16,34,.22);
    animation: attachUp .22s cubic-bezier(.22,1,.36,1);
    transition: background .12s ease;
}
.attach-menu-cancel:active { background: var(--soft, #eef2f6); }
body.dark-theme .attach-menu-sheet,
body.dark-theme .attach-menu-cancel { background: #1c232b; }
body.dark-theme .attach-menu-item { color: #e7edf3; }
body.dark-theme .attach-menu-item:active,
body.dark-theme .attach-menu-cancel:active { background: #262f39; }
body.dark-theme .attach-menu-ic { background: linear-gradient(135deg, rgba(34,167,189,.18), rgba(34,167,189,.10)); box-shadow: inset 0 0 0 1px rgba(34,167,189,.14); }

/* === Reakcii na frazu (partial-text reactions) === */
.msg-phrase-reactions { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 0; }
.msg-phrase-reaction { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.msg-phrase-quote {
    font-size: 12px; color: var(--text-secondary, #667); opacity: .85;
    border-left: 2px solid var(--brand, #0a7c88); padding-left: 5px; font-style: italic;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-phrase-chip {
    display: inline-flex; align-items: center; gap: 3px;
    border: 1px solid transparent; background: rgba(10,124,136,.10);
    border-radius: 12px; padding: 1px 7px; font-size: 13px; cursor: pointer; line-height: 1.5;
}
.msg-phrase-chip.mine { border-color: var(--brand, #0a7c88); background: rgba(10,124,136,.20); }
.msg-phrase-chip .msg-reaction-count { font-size: 11px; opacity: .8; }
body.dark-theme .msg-phrase-chip { background: rgba(26,170,180,.16); }

/* Plavayuschaya panel emodzi pri vydelenii teksta */
.msg-phrase-bar {
    position: fixed; z-index: 5000; display: flex; gap: 2px;
    background: #1f2933; border-radius: 22px; padding: 5px 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.32); animation: attachFade .12s ease;
}
.msg-phrase-bar-em {
    border: none; background: transparent; font-size: 22px; line-height: 1;
    padding: 3px 4px; cursor: pointer; border-radius: 50%;
}
.msg-phrase-bar-em:active { transform: scale(.85); background: rgba(255,255,255,.12); }
