/* Funciones de pareja: «Pienso en ti», programados, fechas, «Mis palabras» y álbum.
   Usa los tokens del sistema visual de app.css (coral, ciruela, superficies, radios). */

/* ---------- «Pienso en ti» ---------- */
.think-big .ico .hb, .at-think .ico .hb { fill: color-mix(in srgb, var(--coral) 22%, transparent); }
.think-big { display: flex; align-items: center; gap: .8rem; width: 100%; border: 0; text-align: left; font: inherit; color: var(--ink); margin-bottom: .65rem;
  padding: .8rem .95rem; border-radius: var(--r-md); background: linear-gradient(135deg, var(--coral-soft), var(--plum-soft)); }
.think-big:active { transform: scale(.98); }
.think-big-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--coral-text); box-shadow: var(--shadow-1); flex: none; }
.think-big-ico .ico { width: 26px; height: 26px; }
.think-big-text { display: grid; }
.think-big-text b { font-size: var(--fs-md); }
.think-big-text small { color: var(--muted); font-size: var(--fs-sm); }
.at-think { background: var(--coral-soft); color: var(--coral-text); }
.at-sched { background: color-mix(in srgb, #3b82c4 14%, transparent); color: #2c6aa6; }
[data-theme="oscuro"] .at-sched { color: #8cc1f0; }
.msg.think-row { display: flex; justify-content: center; margin: .45rem 0; }
.think-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem .4rem .55rem; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600;
  background: var(--coral-soft); color: var(--coral-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--coral) 22%, transparent); animation: pop-in var(--t-3) var(--ease-out); }
.think-pill time { font-weight: 500; font-size: var(--fs-xs); color: var(--muted); }
.think-heart { display: inline-block; font-size: 17px; animation: think-beat 1.3s var(--ease) 2; }
.think-fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; display: grid; place-items: center; }
.think-fx-heart { font-size: 64px; animation: think-rise 1.2s var(--ease-out) forwards; }
.think-fx.big { background: radial-gradient(circle at center, color-mix(in srgb, var(--coral) 18%, transparent), transparent 60%); animation: fade-in .3s var(--ease); }
.think-fx.big .think-fx-heart { font-size: 120px; animation: think-beat-big 2.5s var(--ease) forwards; filter: drop-shadow(0 10px 30px rgba(232, 86, 63, .35)); }
@keyframes think-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.22); } }
@keyframes think-beat-big { 0% { transform: scale(.4); opacity: 0; } 12% { transform: scale(1.15); opacity: 1; } 24% { transform: scale(.95); } 36% { transform: scale(1.12); } 50% { transform: scale(1); } 85% { opacity: 1; } 100% { transform: scale(1.05); opacity: 0; } }
@keyframes think-rise { 0% { transform: translateY(35vh) scale(.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-10vh) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .think-heart, .think-pill { animation: none; } }

/* ---------- mensajes programados ---------- */
.sched-bar { border-left-color: #3b82c4; }
.sched-bar .sched-ico { width: 20px; height: 20px; color: #3b82c4; flex: none; }
.sched-bar .compose-bar-text strong { color: #2c6aa6; }
[data-theme="oscuro"] .sched-bar .compose-bar-text strong { color: #8cc1f0; }
.sched-bar .compose-bar-text span { color: var(--muted); font-size: 12px; }
.sched-form .sc-field, .sched-form input[type=datetime-local] { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: .6rem .75rem; background: var(--surface); color: var(--ink); font: inherit; }
.sched-form textarea { resize: vertical; min-height: 80px; }
.sched-chips { margin-top: .45rem; }
.sched-their { margin: .45rem 0 0; }
.sched-newbtn { margin-bottom: .7rem; }
.sched-list { margin-top: 1.2rem; display: grid; gap: .5rem; }
.sched-list-title { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 .2rem; font-weight: 650; }
.sched-item { display: flex; align-items: center; gap: .5rem; padding: .6rem .5rem .6rem .8rem; border-radius: var(--r-md); background: var(--surface-2); }
.sched-item.editing { box-shadow: inset 0 0 0 2px #3b82c4; }
.sched-item-body { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.sched-item-body strong { font-size: 12.5px; color: #2c6aa6; }
[data-theme="oscuro"] .sched-item-body strong { color: #8cc1f0; }
.sched-item-body span { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sched-del { color: var(--danger); }
.sched-del .ico { width: 18px; height: 18px; }
.sched-mark { display: inline-flex; margin-right: .15rem; opacity: .85; }
.sched-mark .ico { width: 12px; height: 12px; }

/* ---------- contador y fechas especiales ---------- */
.counter-card { align-items: center; background: linear-gradient(135deg, var(--coral-soft), var(--plum-soft)); border-color: transparent; }
.counter-num { display: grid; place-items: center; min-width: 76px; padding: .35rem .5rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); line-height: 1.05; }
.counter-num b { font-size: 26px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter-num span { font-size: 11px; color: var(--muted); font-weight: 650; }
.counter-ymd { font-size: var(--fs-md); font-weight: 700; }
.counter-need { margin: -.2rem 0 .7rem; }
.date-list { display: grid; gap: .3rem; margin-top: .25rem; }
.date-item { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: var(--surface-2); border-radius: 12px; padding: .5rem .65rem; text-align: left; color: var(--ink); font: inherit; }
.date-emoji { font-size: 20px; width: 28px; text-align: center; flex: none; }
.date-info { flex: 1; min-width: 0; display: grid; }
.date-info b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-info small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-left { font-size: 12px; font-weight: 700; color: var(--plum-text); white-space: nowrap; }
.date-left.today { color: var(--coral-text); }
.date-add { justify-self: start; margin-top: .35rem; }
.date-form { display: grid; gap: .55rem; margin-top: .5rem; padding: .7rem; border-radius: 14px; background: var(--surface-2); }
.date-form .field { margin: 0; }
.date-form input[type=text], .date-form input[type=date] { border: 1px solid var(--line-2); border-radius: 10px; padding: .5rem .6rem; background: var(--surface); color: var(--ink); font: inherit; }
.date-emojis button { width: 38px; height: 38px; font-size: 19px; }
.date-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.date-yearly { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); color: var(--ink-2); }
.date-actions { display: flex; gap: .4rem; align-items: center; }
.date-actions .spacer { flex: 1; }
.danger-text { color: var(--danger) !important; }

/* ---------- aprender el idioma ---------- */
.alt-body.learnable { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--plum) 55%, transparent); text-underline-offset: 3px; }
.learn-sentence { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem 0; font-size: 21px; line-height: 1.7; margin: .35rem 0 .7rem; }
.learn-word { border: 0; background: var(--surface-2); color: var(--ink); font: inherit; padding: 0 .3rem; border-radius: 8px; margin: 0 .05rem; transition: background var(--t-1) var(--ease); }
.learn-word.on { background: var(--plum); color: #fff; }
.learn-gap { white-space: pre; }
.learn-tools { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.learn-tools .ico { width: 18px; height: 18px; }
.learn-novoice { margin: 0 0 .6rem; color: var(--warn); }
.learn-pick { display: grid; gap: .55rem; padding: .85rem; border-radius: var(--r-md); background: var(--plum-soft); }
.learn-pick-row { display: flex; align-items: center; gap: .4rem; }
.learn-pick-text { font-size: 24px; font-weight: 800; color: var(--plum-text); }
.learn-say { background: var(--surface); }
.learn-meaning { display: grid; }
.learn-meaning small { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.learn-mean-text { font-size: var(--fs-lg); font-weight: 600; }
.learn-pick .btn { justify-self: start; }
.learn-pick .btn .ico { width: 18px; height: 18px; }
.learn-context { display: grid; gap: .15rem; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.learn-context small { color: var(--muted); font-weight: 650; }

/* ---------- «Mis palabras» ---------- */
#wordsPane, #photosPane { min-height: 120px; }
.words-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.words-head .spacer { flex: 1; }
.words-filter, .album-filter { margin-bottom: .8rem; }
.word-list { display: grid; gap: .45rem; }
.word-item { display: flex; align-items: center; gap: .45rem; padding: .55rem .4rem .55rem .45rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.word-item.learned { opacity: .72; }
.word-body { flex: 1; min-width: 0; display: grid; gap: .05rem; }
.word-body b { font-size: var(--fs-md); }
.word-lang { margin-left: .4rem; font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.word-body span { font-size: var(--fs-sm); color: var(--ink-2); }
.word-example { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-say { color: var(--plum-text); background: var(--plum-soft); width: 36px; height: 36px; }
.word-say .ico, .word-learned .ico, .word-del .ico { width: 18px; height: 18px; }
.word-learned { color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-2); width: 34px; height: 34px; }
.word-learned.on { color: #fff; background: var(--ok); box-shadow: none; }
.word-del { color: var(--muted); width: 34px; height: 34px; }
.practice-card { display: grid; justify-items: center; gap: .8rem; text-align: center; padding: 1.4rem .8rem; border-radius: var(--r-lg); background: linear-gradient(160deg, var(--plum-soft), var(--surface)); }
.practice-count { color: var(--muted); font-weight: 650; }
.practice-word { font-size: 34px; font-weight: 800; color: var(--plum-text); }
.word-say.big { width: 52px; height: 52px; }
.word-say.big .ico { width: 26px; height: 26px; }
.practice-mean { font-size: var(--fs-lg); font-weight: 650; margin: 0; }
.practice-actions { display: flex; gap: .5rem; }
.linkish { border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); text-decoration: underline; }
.empty-note { text-align: center; padding: 1.4rem .6rem; }
.empty-emoji { font-size: 40px; }

/* ---------- álbum ---------- */
.album-month { margin-bottom: 1rem; }
.album-month h3 { display: flex; align-items: baseline; gap: .45rem; font-size: var(--fs-md); margin: 0 0 .45rem; }
.album-month h3 small { color: var(--muted); font-weight: 600; font-size: 12px; }
.album-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.album-tile { position: relative; border: 0; padding: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.album-tile img, .album-tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.album-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.album-play .ico { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.album-play .solid { fill: currentColor; stroke: none; }
.album-dur { position: absolute; right: 5px; bottom: 4px; color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
dialog.video-viewer { background: #000; width: min(720px, 100vw); max-height: 100dvh; padding: 0; border-radius: var(--r-md); }
dialog.video-viewer video { display: block; width: 100%; max-height: 86dvh; background: #000; }
.vv-close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(0, 0, 0, .5); color: #fff; }

/* El encabezado del chat tiene un botón más: en pantallas angostas se aprietan un poco. */

.at-label { line-height: 1.15; text-align: center; }
.sched-text { line-height: 1.4; }
.date-form-box:empty { display: none; }
.learn-detail { margin-top: .2rem; }
/* Árabe (de derecha a izquierda) */
[dir="rtl"] :is(.think-big, .date-item) { text-align: right; }
[dir="rtl"] .sched-mark { margin-right: 0; margin-left: .15rem; }
[dir="rtl"] .word-lang { margin-left: 0; margin-right: .4rem; }
