#participant-now { border:2px solid var(--accent, #bd844a); scroll-margin-top:70px; }
#participant-now h2 { margin-top:0; }
.joinform { flex-wrap:wrap; }
.joinform label,.avatar-field { width:100%; min-width:0; }
.joinform select,#profile-editor select { max-width:100%; font:inherit; padding:10px; }
.avatar-field { box-sizing:border-box; border:1px solid var(--line); margin:8px 0; }
.avatar-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(44px,1fr)); gap:5px; }
.avatar-grid button { padding:5px; border:2px solid transparent; border-radius:5px; background:var(--bg); cursor:pointer; }
.avatar-grid button[aria-pressed="true"] { border-color:var(--accent,#bd844a); background:var(--line); }
.p-person { display:inline-flex; align-items:center; gap:6px; margin:5px 12px 5px 0; max-width:100%; overflow-wrap:anywhere; }
.joined-profile { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.joined-profile .p-person { margin:0; min-width:0; }
.joined-profile .p-person svg { flex-shrink:0; }
.joined-table { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border:1px solid var(--line); border-radius:6px; font-weight:700; }
.joined-table-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.table-banner,.preview { padding:10px; border:1px solid var(--line); border-radius:6px; }
.reaction-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.reaction-row button { font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); padding:8px; border-radius:5px; }
#participant-now blockquote { margin:12px 0; font-size:1.3em; }
#profile-editor { margin-top:12px; }
main,input,fieldset { min-width:0; } input { box-sizing:border-box; max-width:100%; }
#participant-now, #reading-box, #joined { overflow-wrap:anywhere; }

/* Stage details are opened by the reader and grow only as much as needed. */
#now-details { margin:0; border:0; padding:0; }
#now-details summary { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#now-details:not([open]) > #now-content { display:none; }
#participant-controls { overflow-wrap:anywhere; }
#reading-reason,#reaction-reason { height:1.5em; margin:8px 0; font-size:.85rem; line-height:1.5; color:var(--muted); white-space:nowrap; }
#participant-controls button:disabled { color:var(--muted); background:var(--line); opacity:1; }
button:disabled { opacity:.55; cursor:not-allowed; }


#reading-action { min-width:180px; }

/* Reserve both bottom corners, including devices with a home indicator. */
body { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
#host-jump { position:fixed; right:12px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:20; box-sizing:border-box; min-width:72px; min-height:44px; padding:0 12px; border:1px solid var(--accent); border-radius:999px; background:var(--accent); color:var(--accent-text); font:600 13px system-ui,sans-serif; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.16); }
#host-jump > span { pointer-events:none; }
#jump-stage { display:block; max-width:126px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#jump-dot { position:absolute; top:2px; right:8px; width:9px; height:9px; border:2px solid var(--card); border-radius:50%; background:var(--accent-text); }
#jump-dot[hidden] { display:none; }
#host-jump:focus-visible { outline:3px solid var(--text); outline-offset:3px; }
.jump-highlight { outline:3px solid var(--accent); outline-offset:4px; }
[id^="reading-"],#s-core,#s-join,#joined,#s-hello,#s-phrases,#s-ask,#s-reading { scroll-margin-top:80px; }

body.guide-active { display:grid; grid-template-rows:auto minmax(0,1fr); height:100dvh; padding:0; overflow:hidden; }
.guide-active #participant-view { position:relative; display:flex; min-height:0; overflow:hidden; transform:translateZ(0); }
.guide-active #app { flex:1; min-height:0; overflow:auto; padding-bottom:80px; }
.guide-active #host-jump, .guide-active #drawer-fab { top:auto !important; bottom:calc(16px + env(safe-area-inset-bottom)) !important; }
.guide-active #host-jump { left:auto !important; right:12px !important; }
.guide-active #drawer-fab { left:16px !important; right:auto !important; }
#quick-guide { max-height:48dvh; overflow:auto; padding:12px max(16px, calc((100vw - 620px) / 2)); border-bottom:3px solid #be7800; background:#fff2c9; color:#291800; }
#quick-guide h2 { margin:2px 0 4px; font-size:1.15rem; color:inherit; }
#quick-guide p { margin:0 0 6px; }
#quick-guide-progress { color:#634100; font-size:.78rem; font-weight:800; letter-spacing:.06em; }
.quick-guide-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.quick-guide-actions button { min-height:44px; padding:6px 12px; border:1px solid #805300; border-radius:8px; background:transparent; color:inherit; font:600 .9rem system-ui,sans-serif; cursor:pointer; }
#quick-guide-next { width:auto; margin:0 0 0 auto; background:#473000; color:#fff; }
.guide-target { outline:3px solid #e5a31e; outline-offset:3px; }

.speaker-options { display:grid; gap:8px; }
.speaker-options button { display:flex; gap:8px; align-items:center; min-height:44px; padding:6px 10px; border:1px solid var(--accent); border-radius:8px; background:var(--soft); color:var(--text); text-align:left; cursor:pointer; }
.speaker-options svg { flex:none; }

/* The tour and floating controls need distinct colors on the light page. */
:root { color-scheme:light dark; }
:root[data-theme="light"] { color-scheme:light; }
:root[data-theme="dark"] { color-scheme:dark; }
#quick-guide {
  background:light-dark(#183658, #fff2c9);
  color:light-dark(#fff, #291800);
  border-color:light-dark(#5895da, #be7800);
}
#quick-guide-progress { color:light-dark(#c2dfff, #634100); }
.quick-guide-actions button {
  background:light-dark(#244e79, transparent);
  border-color:light-dark(#a8cdf7, #805300);
}
#quick-guide-next {
  background:light-dark(#d4e9ff, #473000);
  color:light-dark(#112d4e, #fff);
}
#drawer-fab {
  background:light-dark(#174e90, var(--accent));
  color:light-dark(#fff, var(--accent-text));
}
#host-jump {
  background:light-dark(#174e90, var(--accent));
  border-color:light-dark(#174e90, var(--accent));
  color:light-dark(#fff, var(--accent-text));
}
.stage-now { margin:0 0 10px; font-weight:700; }

#s-people li { overflow-wrap:anywhere; }
#s-people li > span:last-child { display:inline-block; color:var(--muted); }

.links-card { scroll-margin-top:80px; }
.links-list { display:grid; gap:8px; margin-top:10px; }
.links-item { display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; text-decoration:none; color:inherit; background:var(--bg); min-height:44px; }
a.links-item:hover, a.links-item:focus-visible { border-color:var(--accent); }
.links-item strong { font-size:.95rem; }
.links-item span { color:var(--muted); font-size:.88rem; }
.links-item.is-highlight, .website-highlight .links-item { border-color:var(--accent); background:var(--soft, #f4efe6); }
.links-wechat img { display:block; width:min(160px, 50vw); height:auto; margin:6px 0; background:#fff; border-radius:8px; padding:6px; }
.website-highlight { margin:10px 0 0; padding:10px 12px; border:2px solid var(--accent, #bd844a); border-radius:10px; background:var(--soft, #f4efe6); }
.website-highlight p { margin:0 0 8px; }
.website-highlight .note { margin:8px 0 0; }

.table-mates { margin:10px 0 0; }
.table-mates ul { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.table-mates li { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; }
.table-mates .p-person { margin:0; flex:1; min-width:0; }
.report-absent { flex:none; min-height:32px; padding:4px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--text); font:600 .8rem system-ui,sans-serif; cursor:pointer; }
.report-absent:hover, .report-absent:focus-visible { border-color:var(--accent); }
.report-status { flex:none; color:var(--muted); font-size:.8rem; }
