/* Talk to Hope (Amelia's Megan page, in his colours). The ring glows ONLY while she is speaking. Her portrait is never cropped. No status dots. */
.mg { display: grid; gap: 22px; }
.mg-hero { position: relative; display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 3.4vw, 44px); border-radius: 30px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; isolation: isolate;
  background: radial-gradient(600px 380px at 18% 40%, rgba(246, 184, 94, .16), transparent 70%), linear-gradient(160deg, var(--panel), var(--panel-2)); }
.mg-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: url('/admin/img/table.webp') right center / cover no-repeat; opacity: .07; }
[data-theme="dark"] .mg-hero { background: radial-gradient(600px 380px at 18% 40%, rgba(246, 184, 94, .18), transparent 70%), linear-gradient(160deg, #12243a, #0b1829); }
[data-theme="dark"] .mg-hero::after { opacity: .12; }
.mg-who { display: grid; justify-items: center; text-align: center; gap: 4px; }
.mg-ring { position: relative; width: min(300px, 70vw); aspect-ratio: 1; border-radius: 30px; padding: 7px; background: linear-gradient(145deg, #ffd08f, #f6b85e 45%, #b8730a); box-shadow: 0 24px 60px rgba(7, 16, 29, .25); }
.mg-ring img { width: 100%; height: 100%; border-radius: 24px; object-fit: contain; background: #0b1f45; border: 4px solid var(--panel); position: relative; z-index: 1; }
/* the speaking glow: a soft gold halo and a slow turning light around the ring, only while her voice plays */
.mg-ring::before { content: ""; position: absolute; inset: -26px; border-radius: 48px; background: radial-gradient(circle, rgba(246, 184, 94, .55) 0%, rgba(246, 184, 94, .22) 45%, transparent 70%); opacity: 0; transition: opacity .35s; z-index: 0; }
.mg-ring::after { content: ""; position: absolute; inset: -9px; border-radius: 36px; z-index: 0; opacity: 0; transition: opacity .35s;
  background: conic-gradient(from 0deg, transparent 0 10%, #ffe0b0 22%, transparent 36%, transparent 55%, #f6b85e 70%, transparent 84%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.mg-ring.speaking { box-shadow: 0 0 0 6px rgba(246, 184, 94, .28), 0 0 70px 22px rgba(246, 184, 94, .6), 0 24px 60px rgba(7, 16, 29, .25); animation: mgHalo 1.8s ease-in-out infinite; }
@keyframes mgHalo { 0%, 100% { box-shadow: 0 0 0 5px rgba(246, 184, 94, .25), 0 0 50px 14px rgba(246, 184, 94, .45), 0 24px 60px rgba(7, 16, 29, .25); } 50% { box-shadow: 0 0 0 10px rgba(246, 184, 94, .32), 0 0 90px 30px rgba(246, 184, 94, .7), 0 24px 60px rgba(7, 16, 29, .25); } }
.mg-ring.speaking::before { opacity: 1; animation: mgGlow 1.8s ease-in-out infinite; }
.mg-ring.speaking::after { opacity: 1; animation: mgTurn 2.6s linear infinite; }
@keyframes mgGlow { 0%, 100% { transform: scale(.97); opacity: .75; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes mgTurn { to { transform: rotate(360deg); } }
.mg-name { font: 800 32px/1.1 var(--display); margin-top: 14px; }
.mg-role { color: var(--ink-2); font-weight: 600; }
.mg-caption { margin-top: 8px; max-width: 34ch; font: italic 500 17px/1.45 var(--serif); color: var(--gold); min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mg-intro { display: grid; gap: 14px; align-content: center; }
.mg-title { font: 800 clamp(44px, 6vw, 76px)/.98 var(--display); letter-spacing: -.015em; }
.mg-lede { color: var(--ink-2); font-size: 18px; max-width: 46ch; }
.mg-modes { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.mg-mode { display: grid; justify-items: center; gap: 6px; min-width: 150px; padding: 16px 18px 14px; border-radius: 26px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, border-color .2s, box-shadow .2s; }
.mg-mode:hover { transform: translateY(-2px); border-color: var(--btn); }
.mg-mode b { font: 800 22px/1.1 var(--display); }
.mg-mode > span:last-child { color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.mg-disc { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; }
.mg-disc .ico { width: 36px; height: 36px; stroke-width: 1.6; }
.mg-mode.talk .mg-disc { background: radial-gradient(circle at 35% 30%, #ffd08f, #f6b85e 60%, #d9952f); color: #07101d; box-shadow: 0 14px 30px rgba(246, 184, 94, .4); }
.mg-mode.type .mg-disc { background: radial-gradient(circle at 35% 30%, #1b3350, #07101d 70%); color: #ffd08f; box-shadow: 0 14px 30px rgba(7, 16, 29, .35); border: 1px solid rgba(243, 205, 124, .35); }
.mg-bars { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 4px; }
.mg-bars i { width: 5px; height: 14px; border-radius: 3px; background: #07101d; animation: mgBar 1s ease-in-out infinite; }
.mg-bars i:nth-child(2) { animation-delay: .12s; } .mg-bars i:nth-child(3) { animation-delay: .24s; } .mg-bars i:nth-child(4) { animation-delay: .36s; } .mg-bars i:nth-child(5) { animation-delay: .48s; }
@keyframes mgBar { 0%, 100% { height: 10px; } 50% { height: 34px; } }
.mg-mode.listening { border-color: var(--btn); box-shadow: 0 0 0 4px var(--gold-soft), var(--shadow); }
.mg-mode.listening .mg-disc .ico { display: none; }
.mg-mode.listening .mg-bars { display: flex; }
.mg-status { color: var(--ink-2); min-height: 1.5em; font-size: 15.5px; }

.mg-work { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.mg-chat, .mg-notes { border-radius: 26px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.mg-chat { display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden; }
.mg-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mg-chat-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--btn); }
.mg-chat-head div { display: grid; flex: 1; line-height: 1.25; }
.mg-chat-head b { font: 700 17px/1.2 var(--display); }
.mg-chat-head span { color: var(--ink-3); font-size: 13.5px; }
.mg-read { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 13.5px/1.2 var(--body); color: var(--ink-2); cursor: pointer; }
.mg-read input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--btn); }
.mg-thread { display: flex; flex-direction: column; gap: 12px; height: clamp(300px, 46vh, 430px); overflow-y: auto; padding: 18px; scroll-behavior: smooth; }
.mg-page .mg-thread { height: clamp(340px, 56vh, 560px); }
.mg-b { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.mg-b img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.mg-bt { padding: 12px 16px; border-radius: 20px; overflow-wrap: anywhere; }
.mg-bt p { white-space: pre-wrap; }
.mg-b.her .mg-bt { background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
[data-theme="dark"] .mg-b.her .mg-bt { background: #17304b; }
.mg-b.me { align-self: flex-end; }
.mg-b.me .mg-bt { background: linear-gradient(145deg, #f6b85e, #f6b85e); color: #07101d; border-bottom-right-radius: 6px; font-weight: 500; box-shadow: 0 8px 18px rgba(246, 184, 94, .25); }
.mg-b.arrive { animation: mgIn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes mgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.mg-hear { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--gold); font: 700 13.5px/1 var(--body); cursor: pointer; }
.mg-hear .ico { width: 17px; height: 17px; }
.dots { display: inline-flex; gap: 5px; padding: 6px 2px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: mgDot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mgDot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-6px); opacity: 1; } }
.mg-say { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: end; margin: 0 14px; padding: 8px; border-radius: 26px; border: 1px solid var(--line-2); background: var(--panel-2); transition: border-color .2s, box-shadow .2s; }
.mg-say:focus-within { border-color: var(--btn); box-shadow: 0 0 0 4px var(--gold-soft); }
.mg-say textarea { border: 0; background: transparent; box-shadow: none !important; min-height: 46px; max-height: 160px; resize: none; padding: 11px 6px; font-size: 16.5px; }
.mg-mic, .mg-send { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; }
.mg-mic { background: transparent; color: var(--gold); border: 1px solid var(--line-2); }
.mg-send { background: var(--btn); color: #07101d; box-shadow: 0 8px 18px rgba(246, 184, 94, .3); }
.mg-send:disabled { opacity: .5; }
.mg-chat .msg { padding: 6px 18px 14px; }

.mg-notes { padding: 20px; display: grid; gap: 12px; position: sticky; top: 18px; }
.mg-notes-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.mg-notes-head h2 { font: 800 25px/1.15 var(--display); }
.mg-notes-head .chip .ico { width: 14px; height: 14px; }
.mg-notes-sub { color: var(--ink-3); font-size: 14px; }
.mg-jots { display: grid; gap: 14px; max-height: 440px; overflow-y: auto; padding-right: 2px; }
.mg-jots-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 12px; border-radius: 18px; border: 1px dashed var(--line-2); color: var(--ink-2); }
.mg-jots-empty .ico { width: 34px; height: 34px; color: var(--gold); }
.mg-group h3 { font: 800 12.5px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.mg-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mg-group ul { display: grid; gap: 6px; }
.mg-jot { position: relative; display: flex; align-items: flex-start; gap: 6px; border-radius: 12px; transition: opacity .2s; }
.mg-jot::before { content: ""; flex: none; width: 7px; height: 7px; margin: 11px 2px 0 6px; border-radius: 2px; transform: rotate(45deg); background: var(--btn); }
.mg-jot-t { flex: 1; text-align: left; padding: 5px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 15.5px/1.45 var(--body); cursor: text; }
.mg-jot-t:hover { background: var(--bg-2); }
.mg-jot-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; opacity: .55; }
.mg-jot-x .ico { width: 16px; height: 16px; }
.mg-jot:hover .mg-jot-x, .mg-jot-x:focus-visible { opacity: 1; }
.mg-jot.new { animation: jotIn .6s cubic-bezier(.2, .8, .2, 1) both, jotGlow 2.4s ease-out .2s both; }
.mg-jot.going { opacity: .35; }
@keyframes jotIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes jotGlow { 0% { background: rgba(246, 184, 94, .38); } 100% { background: transparent; } }
.mg-jot-edit { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.mg-jot-edit input { flex: 1 1 100%; min-height: 44px; padding: 8px 12px; }
.mg-jot-edit .pill { min-height: 38px; }
.mg-mem { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--btn) 40%, transparent); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .2s; }
.mg-mem:hover { transform: translateY(-1px); }
.mg-mem span { flex: 1; } .mg-mem b { color: var(--gold); }
.mg-mem .ico { color: var(--gold); }

@media (max-width: 1100px) { .mg-work { grid-template-columns: 1fr; } .mg-notes { position: static; } }
@media (max-width: 760px) {
  /* On a phone the Talk and Type buttons sit right under her portrait, on the first screen. */
  .mg-hero { grid-template-columns: 1fr; justify-items: center; padding: 18px 16px 20px; border-radius: 26px; text-align: center; gap: 0; }
  .mg-who, .mg-intro { display: contents; }
  .mg-intro .eyebrow { order: 0; margin-bottom: 4px; }
  .mg-title { order: 1; font-size: clamp(34px, 10vw, 44px); margin-bottom: 14px; }
  .mg-ring { order: 2; width: min(190px, 52vw); }
  .mg-name { order: 3; font-size: 26px; margin-top: 10px; }
  .mg-role { order: 4; }
  .mg-modes { order: 5; display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 12px; margin-top: 14px; }
  .mg-status { order: 6; margin-top: 8px; }
  .mg-caption { order: 7; margin-top: 4px; }
  .mg-lede { order: 8; font-size: 15.5px; margin-top: 10px; }
  .mg-mode { min-width: 0; padding: 12px 10px 12px; }
  .mg-disc { width: 66px; height: 66px; }
  .mg-mode b { font-size: 20px; }
  .mg-thread { height: clamp(300px, 52vh, 420px); padding: 14px; }
  .mg-b { max-width: 94%; }
  .mg-chat-head { flex-wrap: wrap; }
  .mg-read { flex-basis: 100%; }
  .mg-say { margin: 0 10px; }
  .mg-notes { padding: 18px 16px; }
  .mg-jots { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-ring.speaking::before, .mg-ring.speaking::after { opacity: 1; }
  .mg-mode.listening .mg-bars i { height: 22px; }
}

/* a square portrait: the halo only, no turning ring */
.mg-ring::after { display: none; }
