/* ===== SOVMESTNYJ TAJMER: kartochka otscheta v soobschenii + modalka sozdaniya ===== */
/* Palitra kak v lists.css: --accent, --text, --text-secondary, --border, --bubble-other, --bg. */

.aya-timer-host { display: block; margin: 2px 0; }
.aya-timer {
    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: 14px 14px 12px;
    color: var(--text, #1A1D21);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    text-align: center;
}
.aya-timer-loading { color: var(--text-secondary, #65676B); font-size: 14px; padding: 16px 8px; }

.aya-timer-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; text-align: left; }
.aya-timer-ic { font-size: 16px; flex: 0 0 auto; }
.aya-timer-label { font-weight: 700; font-size: 15px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aya-timer-state {
    flex: 0 0 auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-secondary, #65676B);
    border: 1px solid var(--border, rgba(0,0,0,.12)); border-radius: 999px; padding: 2px 8px;
}

/* Krupnyj monoshirinyj otschet */
.aya-timer-time {
    font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: 1px;
    color: var(--accent, #ff8c42);
    margin: 4px 0 2px;
}
.aya-timer-by { font-size: 11px; color: var(--text-secondary, #65676B); margin-bottom: 6px; }

/* Sostoyaniya */
.aya-timer-paused .aya-timer-time { color: var(--text-secondary, #65676B); opacity: .8; }
.aya-timer-paused .aya-timer-state { color: var(--text-secondary, #65676B); }
.aya-timer-finished .aya-timer-time { color: #2ecc71; }
.aya-timer-finished .aya-timer-state { color: #fff; background: #2ecc71; border-color: #2ecc71; }
.aya-timer-finished { animation: ayaTimerDone .6s ease; }
@keyframes ayaTimerDone {
    0%   { box-shadow: 0 0 0 0 rgba(46,204,113,.55); }
    70%  { box-shadow: 0 0 0 14px rgba(46,204,113,0); }
    100% { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
}

/* Knopki upravleniya (tolko u sozdatelya) */
.aya-timer-ctrls { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.aya-timer-btn {
    appearance: none; border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 12px;
    padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1;
    background: var(--bg, #fff); color: var(--text, #1A1D21); font-family: inherit;
}
.aya-timer-btn:active { transform: scale(.97); }
.aya-timer-btn.primary { background: var(--accent, #ff8c42); color: #fff; border-color: transparent; }

/* --- modalka sozdaniya (v duhe aya-list-modal) --- */
.aya-timer-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-timer-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-timer-modal-title { font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 16px; }

.aya-timer-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.aya-timer-preset {
    appearance: none; border: 1px solid var(--border, rgba(0,56,65,.1)); border-radius: 14px;
    padding: 14px 4px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
    background: var(--bubble-other, #fff); color: var(--text, #1A1D21);
}
.aya-timer-preset:active { transform: scale(.97); border-color: var(--accent, #ff8c42); }

.aya-timer-custom { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.aya-timer-custom-lbl { font-size: 13px; color: var(--text-secondary, #65676B); flex: 0 0 auto; }
.aya-timer-min, .aya-timer-sec {
    flex: 1 1 0; min-width: 0; box-sizing: border-box; text-align: center;
    border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 10px;
    padding: 10px 8px; font-size: 16px; font-family: inherit;
    background: var(--bg, #fff); color: var(--text, #1A1D21);
}
.aya-timer-min:focus, .aya-timer-sec:focus { outline: none; border-color: var(--accent, #ff8c42); }
.aya-timer-colon { font-weight: 700; color: var(--text-secondary, #65676B); flex: 0 0 auto; }

.aya-timer-name {
    box-sizing: border-box; width: 100%; margin-bottom: 14px;
    border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 10px;
    padding: 10px 12px; font-size: 15px; font-family: inherit;
    background: var(--bg, #fff); color: var(--text, #1A1D21);
}
.aya-timer-name:focus { outline: none; border-color: var(--accent, #ff8c42); }

.aya-timer-modal-actions { display: flex; gap: 10px; }
.aya-timer-modal-actions .aya-timer-btn { flex: 1 1 0; padding: 13px; font-size: 15px; text-align: center; justify-content: center; }

/* --- tyomnaya tema --- */
body.dark-theme .aya-timer-modal { background: #161D27; }
body.dark-theme .aya-timer-preset { background: #222b35; }
body.dark-theme .aya-timer-btn { background: #1c2530; }
body.dark-theme .aya-timer-min,
body.dark-theme .aya-timer-sec,
body.dark-theme .aya-timer-name { background: #1c2530; }
