/* =====================================================================================================================
   P9-S1 · final targeted refinements (loaded after p9r1.css)
   ===================================================================================================================== */

/* ---- 1 · footer: one quiet line on public and information pages ---- */
.rm-foot.rm-foot1{max-width:1100px;margin:24px auto 0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--rm-line);font-size:12.5px;color:var(--rm-muted)}
.rm-foot1-in{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px 8px;text-align:center;line-height:1.5}
.rm-foot1 .rm-dot{color:var(--rm-faint)}
.rm-foot1 .p9-social{display:inline-flex;gap:0;list-style:none;margin:0;padding:0;vertical-align:middle}
.rm-foot1 .p9-social a{display:grid;place-items:center;width:32px;height:32px;border-radius:8px;color:var(--rm-muted)}
.rm-foot1 .p9-social a:hover,.rm-foot1 .p9-social a:focus-visible{color:var(--rm-ink);background:var(--rm-surface-3)}
.rm-foot1 .rm-foot-ed{font-size:12px;color:var(--rm-faint);margin-left:6px;background:none;border:0;cursor:pointer}
@media (max-width:640px){ .rm-foot1-in{font-size:12px} .rm-foot1-in > span:nth-of-type(2){display:none} .rm-foot1-in > span:nth-of-type(3){flex-basis:100%;order:3} }
/* landing keeps its single row of legal links (the footer no longer repeats them); the second disclaimer stays hidden */
body.landing #app .land-links{display:flex} body.landing #app .l5foot{display:none}
.p9s1-legal{margin-top:14px} .p9s1-ll{display:flex;flex-wrap:wrap;gap:4px 16px;margin:6px 0 8px} .p9s1-ll a,.p9s1-ll .alink{font-size:14px;padding:6px 0}

/* ---- 2.1 · the conversation fills exactly the visible area above the keyboard ---- */
@media (max-width:1023px){
  html.p9s1-chat,html.p9s1-chat body{height:100%;overflow:hidden;overscroll-behavior:none}
  html.p9s1-chat header.top,html.p9s1-chat nav.bottom,html.p9s1-chat #p7foot,html.p9s1-chat p.foot{display:none!important}
  .p8-threadonly .p8thread{top:var(--p8vt,0px);bottom:auto;left:0;right:0;height:var(--p8vh,100dvh);max-height:100dvh}
  .p8-threadonly .p8thread .p8log{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .p8-threadonly .p8th,.p8-threadonly .p8comp{flex:none}
  .p8-threadonly .p8th{padding-top:max(6px,env(safe-area-inset-top))}
}

/* ---- 2.4 · compact header; search and details are in the options menu ---- */
.p8th{min-height:56px;padding:6px 6px;gap:2px}
.p8th > .iconbtn[onclick^="p8FindToggle"],.p8th > .iconbtn[onclick^="p8Info"]{display:none}
.p8who2{gap:9px;padding:3px 6px} .p8who2 .p8av{width:38px;height:38px;font-size:15px} .p8who2 b{font-size:15.5px;line-height:1.25} .p8who2 .p8pres{font-size:12.5px;line-height:1.2}
.p9s1-optrow{display:grid;gap:6px;margin-top:6px} .p9s1-optrow .btn{display:flex;align-items:center;gap:8px;justify-content:flex-start}

/* ---- 2.2 · compact bubbles, time and ticks inline ---- */
.p8log{padding:8px 10px 6px}
.p8m{max-width:min(80%,560px);margin-top:8px}
.p8m.cont{margin-top:2px}
.p8sep{margin:10px 0 6px} .p8sep span{font-size:11.5px;line-height:1.35;padding:2px 10px;font-weight:700}
.p8thread .p8m .p8b{display:block;padding:6px 9px 6px 10px;font-size:15px;line-height:1.36;border-radius:14px}
.p8thread[data-ctheme] .p8m .p8b{border-radius:14px}
.p8thread .p8m.in.cont .p8b{border-top-left-radius:5px} .p8thread .p8m.in.more .p8b{border-bottom-left-radius:5px}
.p8thread .p8m.out.cont .p8b{border-top-right-radius:5px} .p8thread .p8m.out.more .p8b{border-bottom-right-radius:5px}
.p8thread[data-ctheme] .p8m.in:not(.more) .p8b{border-bottom-left-radius:5px} .p8thread[data-ctheme] .p8m.out:not(.more) .p8b{border-bottom-right-radius:5px}
.p8thread .p8b > p{display:inline;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.p8thread .p8b::after{content:"";display:block;clear:both}
.p8thread .p8meta{float:right;display:inline-flex;align-items:center;gap:3px;font-size:11px;line-height:1;margin:8px 0 -3px 10px;white-space:nowrap}
.p8thread .p8meta .p8tk{width:15px;height:12px}
.p8thread .p8q{margin-bottom:4px}
.p8thread .p8who{font-size:12px;margin:0 0 1px 10px}
.p8thread .p8rc{font-size:11px;margin-top:1px}
.p8thread .p8rx{margin-top:-2px}
.p9s1-held{transform:scale(.98);transition:transform .15s}

/* ---- 2.3 · message options: no permanent button on touch; long-press instead (still reachable by screen readers) ---- */
@media (hover:none){
  .p8thread .p8more{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);border:0;opacity:1}
  .p8thread .p8more:focus-visible{position:absolute!important;width:30px!important;height:30px!important;margin:0!important;clip:auto;clip-path:none;top:2px;background:var(--rm-surface);color:var(--rm-ink);border:1px solid var(--rm-line);border-radius:50%;z-index:2}
  .p8thread .p8m.in .p8more:focus-visible{right:-34px} .p8thread .p8m.out .p8more:focus-visible{left:-34px}
  .p8thread .p8b{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
}
@media (hover:hover){ .p8thread .p8more{width:26px;height:26px;top:2px} .p8thread .p8m.in .p8more{right:-30px} .p8thread .p8m.out .p8more{left:-30px} }

/* ---- 2.6 · compact composer ---- */
.p8thread .p8comp{padding:6px 8px calc(6px + env(safe-area-inset-bottom))}
.p8thread .p8cr{gap:4px;align-items:flex-end}
.p8thread .p8cr textarea{resize:none!important;min-height:40px!important;padding:9px 14px!important;font-size:16px!important;line-height:1.35!important;max-height:132px}
.p8thread .p8cr .iconbtn{width:40px;height:40px;min-width:40px}
.p8thread .p8send{width:42px!important;height:42px!important;min-width:42px}

/* ---- 2.7 · scroll-to-latest: one small control above the composer ---- */
.p8thread .p8down{width:36px;height:36px;right:12px;bottom:calc(var(--p9s1-comp,58px) + 10px);color:var(--rm-ink);box-shadow:0 2px 8px rgba(15,30,51,.18)}
.p8thread .p8down > .ic6{position:static;min-width:0;width:20px;height:20px;background:none;padding:0;display:grid;place-items:center;color:inherit}
.p8thread .p8down #p8dn:empty{display:none}
.p8thread .p8down #p8dn:not(:empty){position:absolute;top:-7px;right:-5px;min-width:18px;height:18px;border-radius:999px;background:var(--rm-orange);color:#142B49;font-size:11px;font-weight:800;display:grid;place-items:center;padding:0 4px}
html[data-appearance=dark] .p8thread .p8down{background:#1B2C44;color:#EEF2F8;border-color:#2E4B73}

/* ---- 2.5 · conversation info ---- */
.p9s1-prof{display:grid;gap:6px;margin:8px 0 10px;text-align:center} .p9s1-prof .ic6{width:16px;height:16px;vertical-align:-3px;margin-right:4px}
.p9s1-bio{white-space:pre-line} .p9s1-badges{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.p9s1-acts{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:6px 0 10px}
.p9s1-danger{display:grid;gap:6px;margin-top:8px}

/* ---- 3 · update notice ---- */
.update{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:12px 14px;max-width:min(440px,92vw);width:max-content;bottom:calc(84px + env(safe-area-inset-bottom));font-weight:400}
.update .upd-t{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 220px} .update .upd-t b{font-size:14.5px} .update .upd-t span{font-size:13px;color:var(--rm-muted)}
.update .upd-a{display:flex;gap:6px;margin-left:auto}
@media (min-width:1024px){ .update{bottom:24px} }
html[data-appearance=dark] .update .upd-t span{color:#B8C4D6}
/* reaction chips on the dark Midnight theme (found by the 36-combination audit once reactions were present) */
.p8thread[data-ctheme="midnight"] .p8rxb{color:#EEF2F8}
