/* Audience pages on phones and computers: live view, forms, the What next? guide. */
:root {
  --ink: #1E2929; --slate: #4F5B5A; --teal: #169C9A; --teal-d: #0B5E5C; --pale: #E4F3F2; --purple: #4D2379;
  --red: #C2452A; --peach: #FBE5DE; --bg: #F3F7F7; --card: #FFFFFF; --line: #D8E4E3;
  --head: 'Poppins', system-ui, sans-serif; --body: 'Nunito Sans', system-ui, sans-serif;
}
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
html.big { font-size: 23px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--bg); line-height: 1.45; min-height: 100vh; }
button, .btn { font: 700 1rem var(--body); border: 2px solid var(--teal); color: var(--teal-d); background: #fff; border-radius: 14px; padding: .7em 1.1em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45em; text-decoration: none; min-height: 48px; }
button.primary, .btn.primary { background: var(--teal); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(22, 156, 154, .5); outline-offset: 2px; }
button[disabled] { opacity: .5; }
input, textarea { font: 1rem var(--body); width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: .7em .8em; background: #fff; color: var(--ink); }
textarea { min-height: 6em; resize: vertical; }
h1, h2 { font-family: var(--head); line-height: 1.2; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 58px; padding-top: 6px; padding-bottom: 6px; }
.top .title { font: 700 .95rem var(--head); color: var(--purple); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top button { min-height: 42px; padding: .4em .7em; font-size: .85rem; border-width: 2px; border-radius: 12px; }
.top .tbtn { border-color: var(--line); color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 6px; font: 800 .7rem var(--body); letter-spacing: .08em; color: var(--red); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1.6s ease-in-out infinite; }
.status.off { color: var(--slate); }
.status.off i { background: var(--slate); animation: none; }
@keyframes blink { 50% { opacity: .3; } }
.banner { background: #FFF4E5; color: #7A4B00; font-weight: 700; font-size: .9rem; padding: .55em 16px; text-align: center; display: none; }
.banner.on { display: block; }

/* menu sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 30, 30, .45); z-index: 60; display: none; }
.sheet-bg.on { display: block; animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); max-height: 90vh; overflow: auto; }
.sheet.on { transform: none; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet .menu { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; }
.sheet .menu .btn, .sheet .menu button { justify-content: flex-start; width: 100%; }
@keyframes fade { from { opacity: 0; } }

/* live slide */
.live-main { padding: 16px 0 120px; }
.slide-holder { position: relative; }
.slide-holder .slide.reader { animation: cardIn .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.pager { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.pager .wrap { display: flex; align-items: center; gap: 10px; }
.pager .count { flex: 1; text-align: center; font-weight: 700; color: var(--slate); font-size: .9rem; }
.tolive { display: none; width: 100%; margin-bottom: 8px; background: var(--red); border-color: var(--red); color: #fff; }
.tolive.on { display: flex; }
.notice { background: var(--card); border-radius: 22px; padding: 26px 20px; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
.notice h1 { color: var(--purple); margin: .2em 0 .4em; font-size: 1.7rem; }
.notice p { margin: 0 0 1em; }
.notice .btns { display: grid; gap: 10px; margin-top: 16px; }
.hero-art { height: 130px; border-radius: 18px; background: url(/media/tapa-title.jpg) center / cover; margin: -6px -4px 18px; }

/* forms */
.qcard { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: 0 4px 18px rgba(0, 0, 0, .06); margin-bottom: 14px; }
.qcard h2 { font-size: 1.1rem; margin: 0 0 .7em; }
.qcard .help { color: var(--slate); font-size: .9rem; margin: -.4em 0 .8em; }
.qcard.err { box-shadow: 0 0 0 3px rgba(194, 69, 42, .6); }
.qcard .errmsg { color: var(--red); font-weight: 700; font-size: .9rem; margin-top: 8px; display: none; }
.qcard.err .errmsg { display: block; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; padding: .75em .9em; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 600; background: #fff; min-height: 52px; }
.opt input { width: 1.3em; height: 1.3em; accent-color: var(--teal); flex: none; margin: 0; }
.opt:has(input:checked) { border-color: var(--teal); background: var(--pale); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .opt { flex-direction: column; justify-content: center; text-align: center; padding: .5em .2em; gap: 4px; font-size: .78rem; }
.scale .opt b { font-size: 1.5rem; line-height: 1; }
.scale .opt input { position: absolute; opacity: 0; }
.scale-ends { display: flex; justify-content: space-between; color: var(--slate); font-size: .8rem; margin-top: 6px; }
.note-card { background: var(--pale); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; }
.form-head { padding: 22px 0 6px; }
.form-head h1 { font-size: 1.6rem; color: var(--purple); margin: 0 0 .3em; }
.form-head p { margin: 0; color: var(--slate); }
.submit-row { padding: 6px 0 40px; display: grid; gap: 10px; }
.done-card { text-align: center; padding: 30px 18px; }
.done-card .tick { width: 84px; height: 84px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 46px; margin: 0 auto 14px; animation: pop .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.1); } }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 520px; }
.toast { background: #1E2929; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: tin .3s ease; text-align: center; }
.toast.out { opacity: 0; transform: translateY(10px); transition: .5s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

@media (min-width: 900px) {
  html { font-size: 19px; }
  html.big { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
