/*
 * Proof 9, Siby Magic: the conversation, and beside it the week Siby is working on. The band wears the Glow look, so
 * every token here is the dark one. Colors are base.css tokens.
 */
.js [data-toy='magic'] { min-height: 640px; }
.mg { display: grid; gap: 40px; }

/* The conversation */
.mg-talk { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 520px; min-height: 560px; justify-self: center; padding: 20px; border-radius: 26px; background: var(--raised); border: 1px solid var(--glass-edge); box-shadow: 0 0 120px -30px color-mix(in srgb, var(--cyan) 50%, transparent), 0 40px 70px -40px var(--sunken); }
.mg-wait { margin: auto; color: var(--text-2); }
.mg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mg-head b { display: block; font: 700 22px/26px var(--sans); letter-spacing: -0.02em; color: var(--on-navy); }
.mg-log { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 250px; max-height: 430px; overflow-y: auto; padding-block: 6px; scrollbar-width: thin; }
.mg-intro { display: grid; gap: 6px; margin: auto; text-align: center; font: 400 15px/20px var(--sans); color: var(--text-2); }
.mg-intro b { font: 700 24px/1.15 var(--sans); letter-spacing: -0.02em; color: var(--text); }
.mg-item { animation: mg-in 340ms var(--ease-spring) both; }
@keyframes mg-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.mg-item.you { align-self: flex-end; max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--cyan); color: var(--on-cyan); font: 600 15px/20px var(--sans); }
[dir='rtl'] .mg-item.you { border-radius: 18px 18px 18px 4px; }
.mg-item.siby { align-self: stretch; }
.mg-item.progress { display: flex; align-items: center; gap: 10px; font: 400 14px/20px var(--sans); color: var(--text-2); }
.mg-dots { display: inline-flex; gap: 4px; }
.mg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: mg-dot 900ms ease-in-out infinite; }
.mg-dots i:nth-child(2) { animation-delay: 150ms; } .mg-dots i:nth-child(3) { animation-delay: 300ms; }
@keyframes mg-dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.mg-card { display: grid; gap: 11px; padding: 15px 16px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); }
.mg-card-title { font: 600 13px/18px var(--sans); color: var(--text-2); }
.mg-nums { display: flex; gap: 26px; }
.mg-nums span { display: grid; gap: 2px; font: 400 12px/16px var(--sans); color: var(--text-2); }
.mg-nums b { font: 700 30px/1 var(--sans); letter-spacing: -0.03em; color: var(--text); }
.mg-who { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-who > span { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding-inline: 11px; border-radius: 14px; background: var(--accent-tint); color: var(--accent-text); font: 600 13px/1 var(--sans); }
.mg-list { display: grid; gap: 5px; font: 400 14px/20px var(--sans); color: var(--text); }
.mg-line { font: 400 15px/22px var(--sans); color: var(--text); }
.mg-line b { font-weight: 700; color: var(--accent-text); }
.mg-goal { display: grid; gap: 11px; }
.mg-goal li { display: grid; gap: 1px; }
.mg-goal b { font: 600 15px/20px var(--sans); color: var(--text); }
.mg-goal span { font: 400 13px/18px var(--sans); color: var(--text-2); }
.mg-small { font: 400 12px/17px var(--sans); color: var(--text-3); }
.mg-undo { justify-self: start; }

.mg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-chip { min-height: 40px; padding: 8px 15px; border-radius: 20px; border: 1px solid var(--line-control); background: var(--glass); color: var(--text); font: 600 14px/1.3 var(--sans); text-align: start; transition: border-color 140ms, transform 160ms var(--ease-spring), opacity 200ms; }
.mg-chip:hover { border-color: var(--cyan); transform: translateY(-1px); }
.mg-chip.used { opacity: 0.38; pointer-events: none; }
.mg-composer { display: flex; align-items: center; gap: 10px; min-height: 50px; padding-inline: 18px 7px; border-radius: 25px; background: var(--sunken); border: 1px solid var(--line-strong); }
.mg-typed { flex: 1; min-height: 20px; font: 400 15px/20px var(--sans); color: var(--text); }
.mg-typed:empty::before { content: attr(data-ph); color: var(--text-3); }
.mg-send { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cyan); color: var(--on-cyan); }

/* What the AI is sent: every person as a code */
.mg-codes { display: flex; align-items: flex-start; gap: 13px; padding-top: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.mg-codes input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mg-codes i { position: relative; flex: none; width: 46px; height: 28px; margin-top: 2px; border-radius: 14px; background: var(--line-strong); transition: background 160ms linear; }
.mg-codes i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--on-navy); transition: transform 220ms var(--ease-spring); }
.mg-codes input:checked + i { background: var(--cyan); }
.mg-codes input:checked + i::after { transform: translateX(18px); }
[dir='rtl'] .mg-codes input:checked + i::after { transform: translateX(-18px); }
.mg-codes input:focus-visible + i { outline: 3px solid var(--cyan); outline-offset: 3px; }
.mg-codes > span { display: grid; gap: 2px; font: 400 13px/18px var(--sans); color: var(--text-2); }
.mg-codes b { font: 600 14px/20px var(--sans); color: var(--text); }
.mg-k { display: none; font-family: var(--mono); font-weight: 500; color: var(--accent-text); }
.mg-item.you .mg-k { color: inherit; }
.mg.codes .mg-n { display: none; }
.mg.codes .mg-k { display: inline; }
/* Words that differ before a name and before its code (Spanish "e Iván", "y P08"): .mg-n holds the first, .mg-y the second. */
.mg-y { display: none; }
.mg.codes .mg-y { display: inline; }

/* The week Siby is working on */
.mg-side { display: grid; gap: 24px; align-content: start; min-width: 0; }
.mg-week { min-width: 0; padding-block: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--glass-edge); }
.mg-week-title { padding-inline: 20px; margin-bottom: 12px; font: 500 11px/16px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.mg-scroll { overflow-x: auto; padding-inline: 20px; scrollbar-width: thin; }
.mg-grid { display: grid; gap: 4px; width: max-content; min-width: 100%; }
/* Under .mg: the first screen draws a small schedule with cells of the same names (style.css, .mini-grid). */
.mg .mg-r { display: grid; grid-template-columns: 108px repeat(var(--n, 7), 64px); gap: 4px; }
.mg-rh { position: sticky; inset-inline-start: 0; z-index: 1; display: grid; align-content: center; padding-inline-end: 6px; background: var(--surface); font: 400 10px/13px var(--mono); color: var(--text-2); }
.mg-rh b { font: 600 12px/15px var(--sans); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Spanish titles run longer ("Camareros de barra"): there they take a second line instead of being cut. */
:lang(es) .mg-rh b { white-space: normal; }
.mg-ch { display: grid; justify-items: center; padding-bottom: 4px; font: 400 10px/12px var(--sans); color: var(--text-2); }
.mg-ch b { font: 600 15px/18px var(--sans); color: var(--text); }
.mg .mg-sec { margin-top: 8px; font: 600 11px/16px var(--sans); color: var(--text-3); }
.mg .mg-c { display: grid; align-content: center; min-height: 40px; padding: 4px 7px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); font: 500 11px/14px var(--sans); color: var(--text); white-space: nowrap; overflow: hidden; }
.mg .mg-c .mg-name { display: block; }
.mg .mg-c.open { background: none; border-style: dashed; border-color: var(--open-edge); color: var(--text-3); }
/* "Sin cubrir" is as wide as the cell's room to the hair: in Spanish the empty cell keeps less padding. */
:lang(es) .mg .mg-c.open { padding-inline: 4px; }
.mg .mg-c.flash { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 18px color-mix(in srgb, var(--cyan) 45%, transparent); animation: mg-flash 900ms var(--ease-out); }
@keyframes mg-flash { 0% { transform: scale(1.12); background: var(--accent-tint); } }
.mg-honest { max-width: 36em; font: 400 14px/1.6 var(--sans); color: var(--fg-2); }

@media (min-width: 1000px) {
  .mg { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); align-items: start; gap: clamp(40px, 5vw, 72px); }
  .mg-talk { justify-self: stretch; }
}
