/**
 * TruBible Meetings, the pieces added in TINL-1360 (js/meet-plus.js): agenda and notes, the shared timer,
 * the More menu as large tiles on phones, and a phone control bar that always shows Mic and Leave.
 * Loaded after meet.css; the room is dark (data-theme="dark" on <html>) and uses the same tokens.
 */

/* ---------- Agenda and notes (side panel) ---------- */
.mn { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; min-height: 0; }
.mn-h { margin: 8px 2px 0; font: 600 var(--fs-xs, 0.75rem)/1 Inter, system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.mn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mn-item { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 2px 4px 2px 8px; border-radius: 12px; background: var(--bg-subtle); animation: mn-in 260ms var(--ease-out, ease) both; }
.mn-item > input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.mn-item .mn-text { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); font: 500 0.95rem/1.3 Inter, system-ui, sans-serif; outline: 0; border-radius: 8px; padding: 0 4px; }
.mn-item .mn-text:focus-visible { box-shadow: var(--ring); }
.mn-item.done .mn-text, .mn-item.done > span { color: var(--text-muted); text-decoration: line-through; }
.mn-item > svg { width: 18px; height: 18px; flex: none; color: var(--text-secondary); }
.mn-item.done > svg { color: var(--success); }
.mn-item > span { flex: 1; min-width: 0; padding: 8px 4px; overflow-wrap: anywhere; font-size: 0.95rem; }
.mn-add { display: flex; gap: 8px; align-items: center; }
.mn-add .mt-input { flex: 1; min-width: 0; }
.mn-add .mt-round { background: var(--brand); color: var(--on-brand); }   /* --primary is white in the dark room: the plus would vanish */
.mn-area { min-height: 150px; resize: vertical; line-height: 1.55; }
.mn-read { padding: 12px 14px; border-radius: 12px; background: var(--bg-subtle); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 0.95rem; }
.mn-empty { margin: 4px 2px; color: var(--text-muted); font-size: 0.92rem; }
.mn-state { margin: 0 2px; color: var(--text-muted); font-size: 0.8rem; }
.mn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mn-actions .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.mn-actions .btn svg { width: 16px; height: 16px; }
@keyframes mn-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Timer: a chip in the top bar, the same for everyone ---------- */
.mt-timer { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: #282828; color: #f2f2f2; font: 600 var(--fs-sm, 0.875rem)/1 Inter, system-ui, sans-serif; max-width: 46vw; animation: mn-in 300ms var(--ease-out, ease) both; }
.mt-timer svg { width: 16px; height: 16px; flex: none; }
.mt-timer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d4d4d4; font-weight: 500; }
.mt-timer span:empty { display: none; }
.mt-timer b { font-variant-numeric: tabular-nums; font-weight: 700; }
.mt-timer.soon { background: #7c2d12; }
.mt-timer.done { background: #b91c1c; animation: mn-pulse 900ms ease-in-out 4; }
@keyframes mn-pulse { 50% { transform: scale(1.06); } }
/* the timer set-up, shown inside the More menu's place */
.mn-timer { display: grid; gap: 10px; padding: 10px; min-width: 250px; }
.mn-timer b { font: 600 0.95rem/1.3 Inter, system-ui, sans-serif; }
.mn-timer-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mt-menu .mn-timer-row button { justify-content: center; min-height: 44px; padding: 0 4px; background: var(--bg-subtle); font-weight: 600; white-space: nowrap; }
.mt-menu .mn-timer-row button:hover { background: var(--bg-hover); }
.mt-menu button { position: relative; }
.mt-menu button > span { flex: 1; min-width: 0; text-align: start; }
.mt-menu .mt-dot { position: static; flex: none; }

/* ---------- Phones: five buttons that always fit; everything else in More, as tiles ---------- */
@media (max-width: 640px) {
  .mt-controls { overflow: visible; gap: 6px; padding-inline: 8px; }
  .mt-controls .mt-ctl { flex: 1 1 0; min-width: 0; }
  #mt-btn-hand, #mt-btn-bible, #mt-btn-chat, #mt-btn-people { display: none; }
  /* a dot on More when something waits behind it (a chat message, a shared passage, someone knocking) */
  .mt-controls:has(#mt-btn-chat .mt-dot:not(.hidden), #mt-btn-bible .mt-dot:not(.hidden), #mt-btn-people .mt-dot:not(.hidden)) #mt-more-dot { display: block !important; }
  .mt-menu.mt-menu-grid { left: 8px; right: 8px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px; border-radius: 20px; max-height: 70dvh; overflow-y: auto; animation: mn-sheet 260ms var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both; }
  .mt-menu.mt-menu-grid.hidden { display: none; }
  .mt-menu.mt-menu-grid button { flex-direction: column; justify-content: center; gap: 8px; min-height: 84px; padding: 10px 6px; background: var(--bg-subtle); border-radius: 14px; text-align: center; font-size: 0.78rem; line-height: 1.25; }
  .mt-menu.mt-menu-grid button > span { flex: none; text-align: center; }
  .mt-menu.mt-menu-grid svg { width: 22px; height: 22px; color: var(--text); }
  .mt-menu.mt-menu-grid .mt-dot { position: absolute; top: 10px; right: 14px; }
  .mn-timer { min-width: 0; }
  .mt-timer span { display: none; }
}
@keyframes mn-sheet { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mn-item, .mt-timer, .mt-timer.done, .mt-menu.mt-menu-grid { animation: none; } }

/* ---------- Meetings home: the one door in the top bar ---------- */
.mh-top-actions .tbh-door { height: 40px; }
@media (max-width: 760px) {
  .mh-top-actions .tbh-door span, .mh-top-actions .tbh-door kbd { display: none; }
  .mh-top-actions .tbh-door { width: 44px; height: 44px; padding: 0; justify-content: center; }
}

/* "Draft the agenda" (owner, Nov 26 2026): a few words about the meeting, and the helper's draft shown apart until added */
.mn-draft { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mn-draft .mt-input { flex: 1 1 180px; min-width: 0; }
/* the meeting's description for "Draft the agenda": room for ten lines (owner, Nov 27 2026: "at least 10 lines"),
   the button under it */
.mn-draft .mn-topic { flex: 1 1 100%; min-height: 220px; resize: vertical; line-height: 1.5; padding: 10px 12px; }
.mn-draft .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; white-space: nowrap; }
.mn-draft .btn svg, .mn-draft-out .mn-state svg { width: 16px; height: 16px; vertical-align: -3px; }
.mn-draft-out:empty { display: none; }
.mn-draft-out { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; animation: mn-draft-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mn-draft-list .mn-item { animation: mn-draft-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mn-draft-list .mn-item:nth-child(2) { animation-delay: 50ms; } .mn-draft-list .mn-item:nth-child(3) { animation-delay: 100ms; } .mn-draft-list .mn-item:nth-child(4) { animation-delay: 150ms; }
.mn-draft-list .mn-item:nth-child(n+5) { animation-delay: 200ms; }
@keyframes mn-draft-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .mn-draft-out, .mn-draft-list .mn-item { animation: none; } }

/* A phone's More in two parts, "In this meeting" then "This device" (meet-room.js toggleMore, meet-plus.js moreItems) */
@media (max-width: 640px) {
  .mt-menu.mt-menu-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mt-more-part { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mt-more-h { grid-column: 1 / -1; margin: 2px 4px 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
  .mt-menu.mt-menu-grid button.is-key { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--border); }
  .mt-menu.mt-menu-grid button.is-key svg { color: var(--primary, #6cb6ff); }
}

/* The host's "Start live translation" (meet-room.js renderTranslate): one line, two points, one big button */
.mt-tr-start { display: grid; gap: 12px; padding: 4px 2px 8px; animation: mn-rise 360ms var(--ease-out, cubic-bezier(.2,.8,.2,1)) both; }
.mt-tr-hello { position: relative; height: 1.6em; margin: 0; font-size: 1.35rem; font-weight: 600; color: var(--primary, #6cb6ff); }
.mt-tr-hello span { position: absolute; left: 0; top: 0; opacity: 0; animation: mt-hello 14s calc(var(--i) * 2s) infinite; }
@keyframes mt-hello { 0%, 12%, 100% { opacity: 0; transform: translateY(6px); } 2%, 10% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mt-tr-hello span { animation: none; } .mt-tr-hello span:first-child { opacity: 1; } }
.mt-tr-h { margin: 0; font-size: 1.15rem; line-height: 1.3; color: var(--text); }
.mt-tr-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mt-tr-points li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text); }
.mt-tr-points svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.mt-tr-go { width: 100%; justify-content: center; min-height: 48px; font-size: 1rem; }
.mt-tr-fine { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); }
@keyframes mn-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* An empty agenda: Ethan's draft as the first card (meet-plus.js renderNotes) */
.mn-draft.is-lead { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-subtle); }
.mn-draft.is-lead .mt-input, .mn-draft.is-lead .btn { width: 100%; justify-content: center; }
.mn-draft.is-lead .btn { min-height: 44px; }
.mn-draft-lead { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.9rem; color: var(--text); }
.mn-draft-lead svg { width: 18px; height: 18px; flex: none; color: var(--brand, #6cb6ff); }
/* A participant waiting for the host's live translation (meet-room.js renderTranslate): a calm, living waiting state */
.mt-tr-wait { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--text); }
.mt-tr-pulse { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--primary, #6cb6ff); animation: mt-pulse 1.8s ease-in-out infinite; }
@keyframes mt-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .mt-tr-pulse { animation: none; opacity: 1; } }
