/* Rozmównica: układ, którego nie wyrażają klasy wspólne z halonik.css.
   Ładowany po halonik.css; tylko tokeny (:root), bez kolorów na sztywno.
   Wszystkie klasy mają prefiks rm-. */

/* ---------- Strona startowa ---------- */
.rm-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 2rem; align-items: center; margin-bottom: 1.75rem; }
.rm-stickers { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.rm-stickers .pill { font-size: 0.85rem; padding: 0.3rem 0.85rem; box-shadow: var(--shadow-sm); animation: pop 0.35s ease backwards; }
.rm-stickers .pill:nth-child(odd) { transform: rotate(-3deg); }
.rm-stickers .pill:nth-child(even) { transform: rotate(2.5deg); }
.rm-stickers .pill:nth-child(2) { animation-delay: 0.06s; }
.rm-stickers .pill:nth-child(3) { animation-delay: 0.12s; }
.rm-stickers .pill:nth-child(4) { animation-delay: 0.18s; }
.rm-stickers .pill:nth-child(5) { animation-delay: 0.24s; }

/* Makieta pokoju na stronie startowej: sama CSS, bez obrazków. */
.rm-mock { position: relative; aspect-ratio: 16 / 10; overflow: hidden; margin: 0.25rem 0.4rem 0.25rem 0; border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-md); transform: rotate(1.2deg);
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tone) 42%, var(--ink)), var(--ink) 72%); }
.rm-mock-av { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 50%; color: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 16%, transparent); border: 1.5px solid color-mix(in srgb, var(--bg-card) 45%, transparent); }
.rm-mock-av .ic { width: 1.7rem; height: 1.7rem; }
.rm-mock-tag { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; gap: 0.35rem; }
.rm-mock-pip { position: absolute; right: 0.6rem; bottom: 3.2rem; display: grid; place-items: center; width: 26%; aspect-ratio: 4 / 3; color: var(--ink); background: var(--tone-light); border: 1.5px solid var(--bg-card); border-radius: var(--radius-sm); }
.rm-mock-bar { position: absolute; left: 0; right: 0; bottom: 0.55rem; display: flex; justify-content: center; gap: 0.4rem; }
.rm-mock-bar i { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; color: var(--ink); background: var(--bg-card); border: 1.5px solid var(--ink); border-radius: var(--radius-sm); box-shadow: 2px 2px 0 var(--ink); }
.rm-mock-bar i.end { background: var(--accent-red-light); }

.rm-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.rm-choices .rm-choice { padding: 1.6rem 1.4rem; text-align: center; animation: rise 0.4s ease backwards; }
.rm-choices .rm-choice:nth-child(2) { animation-delay: 0.08s; }
.rm-choices .rm-choice .subject-icon { animation: bob 3s ease-in-out infinite; }
.rm-choice .rm-join-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; width: 100%; }
.rm-choice .rm-join-form :where(input[type="text"]) { flex: 1; min-width: 0; font-family: var(--font-mono); text-transform: uppercase; text-align: center; }
.rm-choice .rm-form-error { margin: 0.5rem 0 0; color: var(--accent-red); font-size: 0.8rem; font-weight: 700; }
.rm-about { margin-bottom: 2rem; }
.rm-about .about-card-title { display: flex; align-items: center; }
.rm-about :where(code) { white-space: nowrap; font-size: 0.85em; background: var(--gray-100); padding: 1px 5px; border-radius: 4px; }

/* ---------- Pokój: wspólne ---------- */
.rm-room { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 2rem; }
.rm-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.rm-statusbar .rm-timer { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

/* Kropka stanu połączenia (świeci tylko tokenami). */
.rm-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--gray-300); flex-shrink: 0; }
.rm-dot.green { background: var(--accent-green); }
.rm-dot.amber { background: var(--accent-amber); animation: rm-blink 1.2s ease-in-out infinite; }
@keyframes rm-blink { 50% { opacity: 0.35; } }

.rm-h { margin: 0; font-size: 1.15rem; letter-spacing: -0.01em; }
.rm-h1 { margin: 0; font-size: 1.55rem; line-height: 1.15; letter-spacing: -0.02em; }
.rm-sub { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; }
.rm-err { margin: 0; color: var(--accent-red); font-size: 0.8rem; font-weight: 700; }
.rm-mirror { transform: scaleX(-1); }

/* Ciemny kafel z ikoną: puste miejsce po obrazie (kamera wyłączona, łączenie). */
.rm-off-ic { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; color: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 14%, transparent); border: 1.5px solid color-mix(in srgb, var(--bg-card) 40%, transparent); }
.rm-off-ic .ic { width: 1.9rem; height: 1.9rem; }

/* ---------- Starter (poczekalnia) ---------- */
.rm-lobby { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rm-setup, .rm-join { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.15rem; }
.rm-sec-head { display: flex; flex-direction: column; gap: 0.2rem; }
.rm-join-body { display: flex; flex-direction: column; gap: 0.9rem; }

.rm-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.rm-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--ink); }
.rm-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 1rem; color: var(--bg-card); text-align: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tone) 38%, var(--ink)), var(--ink) 72%); }
.rm-off b { font-family: var(--font-display); font-size: 1.05rem; }
.rm-off small { opacity: 0.8; }
.rm-meter { position: absolute; left: 0.7rem; right: 0.7rem; top: 0.7rem; z-index: 2; height: 0.4rem; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--bg-card) 28%, transparent); }
.rm-meter i { display: block; height: 100%; background: var(--accent-green); transition: width 0.08s linear; }
.rm-preview-controls { position: absolute; left: 50%; bottom: 0.75rem; z-index: 2; display: flex; gap: 0.6rem; transform: translateX(-50%); }

.rm-round { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; color: var(--ink); cursor: pointer; background: var(--bg-card); border: 1.5px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform 0.12s ease; }
.rm-round:hover:not(:disabled) { transform: translateY(-2px); }
.rm-round.on { background: var(--tone-light); }
.rm-round.off { color: var(--text-muted); }
.rm-round:disabled { opacity: 0.55; cursor: progress; }

.rm-more { font-size: 0.9rem; }
.rm-more summary { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; cursor: pointer; }
.rm-more .rm-devices { margin-top: 0.7rem; }
.rm-devices { display: grid; gap: 0.6rem; }
.rm-dev { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 700; }
.rm-dev-l { display: flex; align-items: center; gap: 0.35rem; color: var(--text-body); }
.rm-dev select { width: 100%; }

.rm-steps { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.rm-steps li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.92rem; font-weight: 600; color: var(--text-body); }
.rm-steps li b { display: grid; place-items: center; flex-shrink: 0; width: 1.6rem; height: 1.6rem; font-family: var(--font-display); font-size: 0.8rem; background: var(--bg-card); border: 1.5px solid var(--ink); border-radius: 50%; }
.rm-steps li em { font-style: normal; font-weight: 500; color: var(--text-muted); }
.rm-steps li.done b { background: var(--accent-green-light); }

.rm-pin-tiles { display: flex; gap: 0.45rem; }
.rm-pin-tiles .rm-pin-tile { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3.5rem; font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; background: var(--tone-light); border: 1.5px solid var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

.rm-knock { display: flex; flex-direction: column; gap: 0.65rem; padding: 0.9rem; background: var(--accent-amber-light); border: 1.5px solid var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); animation: rm-knock 1.6s ease-in-out infinite; }
.rm-knock-t { display: flex; align-items: center; gap: 0.5rem; }
@keyframes rm-knock { 0%, 40%, 100% { transform: translateX(0); } 10% { transform: translateX(-3px); } 20% { transform: translateX(3px); } 30% { transform: translateX(-2px); } }
.rm-approval { display: flex; gap: 0.5rem; }
.rm-approval .btn { flex: 1; }
/* „Akceptuj” pulsuje: gość czeka, a gospodarz ma to zauważyć także kątem oka (poczekalnia i baner w rozmowie). */
.rm-approval .btn.green, .rm-banner-btn.ok { position: relative; animation: rm-pulse 1.3s ease-in-out infinite; }
.rm-approval .btn.green::after, .rm-banner-btn.ok::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--accent-green); border-radius: inherit; pointer-events: none; animation: rm-ring 1.3s ease-out infinite; }
@keyframes rm-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes rm-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18, 1.5); } }

.rm-wait { display: flex; gap: 0.4rem; }
.rm-wait i { width: 0.75rem; height: 0.75rem; background: var(--tone); border: 1.5px solid var(--ink); border-radius: 50%; animation: rm-bounce 1.1s ease-in-out infinite; }
.rm-wait i:nth-child(2) { animation-delay: 0.15s; }
.rm-wait i:nth-child(3) { animation-delay: 0.3s; }
@keyframes rm-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-0.5rem); } }

/* ---------- Rozmowa: układ jak w WhatsAppie ----------
   Cała rozmowa to jedna pełnoekranowa, ciemna warstwa nad stroną (nagłówek i stopka serwisu są zasłonięte):
   obraz rozmówcy na całość, własny podgląd w rogu, okrągłe przyciski na dole, górny pasek z nazwą i czasem.
   Sterowanie chowa się po chwili, gdy jest obraz; dotknięcie ekranu je przywraca. */
body.rm-in-call { overflow: hidden; }
.rm-call { position: fixed; inset: 0; z-index: 200; display: flex; color: var(--bg-card); background: var(--ink); }

.rm-stage { --rm-bar-h: calc(5.7rem + env(safe-area-inset-bottom)); --rm-top-h: calc(4.4rem + env(safe-area-inset-top)); --rm-gap: 0.9rem;
  position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; background: var(--ink); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.rm-stage.rm-idle { cursor: none; }
.rm-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--ink); }
.rm-vhidden { opacity: 0; }

.rm-stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; padding: var(--rm-top-h) 1.5rem var(--rm-bar-h); text-align: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tone) 38%, var(--ink)), var(--ink) 72%); }
.rm-stage-empty b { font-family: var(--font-display); font-size: 1.15rem; }
.rm-stage-empty small { max-width: 26rem; opacity: 0.82; }
.rm-avatar { display: grid; place-items: center; width: 7rem; height: 7rem; margin-bottom: 0.4rem; border-radius: 50%; background: color-mix(in srgb, var(--bg-card) 14%, transparent); border: 1.5px solid color-mix(in srgb, var(--bg-card) 40%, transparent); }
.rm-avatar .ic { width: 3.2rem; height: 3.2rem; }

/* Górny pasek: nazwa i czas rozmowy, napisy o udostępnianiu, czat. */
.rm-top { position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; align-items: center; gap: 0.75rem; padding: calc(0.8rem + env(safe-area-inset-top)) calc(var(--rm-gap) + env(safe-area-inset-right)) 2.2rem calc(var(--rm-gap) + env(safe-area-inset-left));
  background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 72%, transparent), transparent); transition: opacity 0.2s ease, transform 0.2s ease; }
.rm-stage.rm-idle .rm-top { opacity: 0; pointer-events: none; transform: translateY(-0.6rem); }
.rm-top-id { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.rm-top-name { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.rm-top-sub { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; opacity: 0.85; }
.rm-top .rm-dot { border-color: transparent; }
.rm-top-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.rm-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; font-size: 0.78rem; font-weight: 700; color: var(--ink); background: var(--accent-amber-light); border: 0; border-radius: 99px; }
.rm-chip .ic { width: 1rem; height: 1rem; }
.rm-chip-btn { cursor: pointer; }
.rm-top-btn, .rm-icon-btn { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 2.8rem; height: 2.8rem; padding: 0; color: inherit; cursor: pointer; background: color-mix(in srgb, var(--bg-card) 20%, transparent); border: 0; border-radius: 50%; backdrop-filter: blur(8px); }
.rm-top-btn .ic { width: 1.35rem; height: 1.35rem; }
.rm-top-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--bg-card) 38%, transparent); }
.rm-badge { position: absolute; top: -0.2rem; right: -0.2rem; display: grid; place-items: center; min-width: 1.2rem; height: 1.2rem; padding: 0 0.3rem; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; color: var(--ink); background: var(--accent-green); border-radius: 99px; }

/* Komunikaty na scenie: błąd sieci, pukający gość, nowa wiadomość. */
.rm-banner, .rm-incoming { position: absolute; left: calc(var(--rm-gap) + env(safe-area-inset-left)); right: calc(var(--rm-gap) + env(safe-area-inset-right)); top: var(--rm-top-h); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.65rem 0.85rem; font-size: 0.85rem; font-weight: 600; border-radius: 0.9rem; }
.rm-banner { justify-content: space-between; color: var(--ink); background: var(--accent-amber-light); }
.rm-banner-actions { display: flex; gap: 0.4rem; }
.rm-banner-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.8rem; font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--ink); cursor: pointer; background: var(--bg-card); border: 0; border-radius: 99px; }
.rm-banner-btn.ok { background: var(--accent-green); }
.rm-banner-btn .ic { width: 1rem; height: 1rem; }
/* Komunikat o braku TURN da się zamknąć: przycisk po prawej, tekst zajmuje resztę. */
.rm-net { display: flex; align-items: flex-start; gap: 0.75rem; }
.rm-net > span { flex: 1; }
.rm-net-x { flex-shrink: 0; width: 28px; height: 28px; box-shadow: none; }
.rm-banner-x { margin-left: auto; padding: 0.35rem; }
.rm-incoming { width: auto; max-width: 28rem; margin-inline: auto; flex-wrap: nowrap; text-align: left; color: var(--bg-card); cursor: pointer; background: color-mix(in srgb, var(--ink) 72%, transparent); border: 0; backdrop-filter: blur(10px); }
.rm-incoming .ic { flex-shrink: 0; }
.rm-incoming span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

.rm-nudge, .rm-stage-blocked { position: absolute; left: 50%; bottom: calc(var(--rm-bar-h) + 0.4rem); z-index: 3; display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem 0.45rem 0.9rem; font-size: 0.85rem; font-weight: 600; white-space: nowrap; transform: translateX(-50%); border-radius: 99px; }
.rm-nudge { color: var(--bg-card); background: color-mix(in srgb, var(--ink) 66%, transparent); backdrop-filter: blur(10px); }
.rm-nudge-btn { padding: 0.3rem 0.9rem; font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--ink); cursor: pointer; background: var(--bg-card); border: 0; border-radius: 99px; }
.rm-nudge-btn:disabled { opacity: 0.5; cursor: progress; }
.rm-stage-blocked { z-index: 4; padding: 0.55rem 1rem; font-family: var(--font-display); font-weight: 700; color: var(--ink); cursor: pointer; background: var(--brand-yellow); border: 0; }
.rm-stage-blocked .ic { width: 1.1rem; height: 1.1rem; }

/* Własny podgląd: mały, zaokrąglony, przeciągany; po puszczeniu przywiera do najbliższego rogu.
   Gdy sterowanie jest schowane, dolne rogi opadają na sam dół. */
.rm-pip { position: absolute; z-index: 2; width: 6.4rem; aspect-ratio: 3 / 4; overflow: hidden; cursor: grab; touch-action: none; background: var(--ink);
  border: 2px solid color-mix(in srgb, var(--bg-card) 75%, transparent); border-radius: 1rem; box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 45%, transparent);
  transition: top 0.2s ease, bottom 0.2s ease; }
.rm-pip video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.rm-pip.rm-tl, .rm-pip.rm-tr { top: var(--rm-top-h); }
.rm-pip.rm-bl, .rm-pip.rm-br { bottom: calc(var(--rm-bar-h) + 0.4rem); }
.rm-pip.rm-tl, .rm-pip.rm-bl { left: calc(var(--rm-gap) + env(safe-area-inset-left)); }
.rm-pip.rm-tr, .rm-pip.rm-br { right: calc(var(--rm-gap) + env(safe-area-inset-right)); }
.rm-stage.rm-idle .rm-pip.rm-tl, .rm-stage.rm-idle .rm-pip.rm-tr { top: calc(var(--rm-gap) + env(safe-area-inset-top)); }
.rm-stage.rm-idle .rm-pip.rm-bl, .rm-stage.rm-idle .rm-pip.rm-br { bottom: calc(var(--rm-gap) + env(safe-area-inset-bottom)); }

/* Dolny pasek: okrągłe przyciski. Wyłączone urządzenie to biały przycisk z przekreśloną ikoną, jak w WhatsAppie. */
.rm-bar { position: absolute; left: 50%; bottom: calc(var(--rm-gap) + env(safe-area-inset-bottom)); z-index: 3; display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 1rem; transform: translateX(-50%); border-radius: 2.4rem;
  background: color-mix(in srgb, var(--ink) 62%, transparent); backdrop-filter: blur(14px); transition: opacity 0.2s ease, transform 0.2s ease; }
.rm-stage.rm-idle .rm-bar { opacity: 0; pointer-events: none; transform: translate(-50%, 1rem); }
.rm-ctl { display: grid; place-items: center; flex-shrink: 0; width: 3.4rem; height: 3.4rem; padding: 0; color: var(--bg-card); cursor: pointer; background: color-mix(in srgb, var(--bg-card) 20%, transparent); border: 0; border-radius: 50%; transition: transform 0.12s ease, background 0.12s ease; }
.rm-ctl .ic { width: 1.5rem; height: 1.5rem; }
.rm-ctl:hover:not(:disabled) { background: color-mix(in srgb, var(--bg-card) 32%, transparent); }
.rm-ctl:active:not(:disabled) { transform: scale(0.93); }
.rm-ctl.active { background: color-mix(in srgb, var(--bg-card) 38%, transparent); }
.rm-ctl.off, .rm-ctl.off:hover:not(:disabled) { color: var(--ink); background: var(--bg-card); }
.rm-ctl.end, .rm-ctl.end:hover:not(:disabled) { color: var(--bg-card); background: var(--accent-red); }
.rm-ctl:disabled { opacity: 0.5; cursor: not-allowed; }
.rm-ctl:focus-visible, .rm-top-btn:focus-visible, .rm-icon-btn:focus-visible { outline: 2px solid var(--brand-yellow); outline-offset: 2px; }

/* Arkusz „Więcej”: dolny arkusz na telefonie, pływające okienko nad paskiem na komputerze. */
.rm-sheet-backdrop { position: absolute; inset: 0; z-index: 5; background: color-mix(in srgb, var(--ink) 45%, transparent); }
.rm-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 80%; overflow-y: auto; padding: 0.5rem 1rem calc(1rem + env(safe-area-inset-bottom)); color: var(--ink); background: var(--bg-card); border-radius: 1.4rem 1.4rem 0 0; animation: rm-up 0.22s ease-out backwards; overscroll-behavior: contain; }
.rm-grip { display: block; width: 2.4rem; height: 0.28rem; margin: 0.1rem auto 0.5rem; background: var(--gray-300); border-radius: 99px; }
.rm-sheet-item { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.8rem 0.4rem; font-size: 0.95rem; font-weight: 600; color: inherit; text-align: left; cursor: pointer; background: none; border: 0; border-bottom: 1px solid var(--gray-100); }
.rm-sheet-item:disabled { opacity: 0.5; cursor: not-allowed; }
.rm-sheet-item .ic, .rm-sheet-more summary .ic { width: 1.3rem; height: 1.3rem; flex-shrink: 0; }
.rm-sheet-more { border-bottom: 1px solid var(--gray-100); }
.rm-sheet-more summary { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0.4rem; font-size: 0.95rem; font-weight: 600; cursor: pointer; list-style: none; }
.rm-sheet-more summary::-webkit-details-marker { display: none; }
.rm-sheet-more .rm-devices { padding: 0 0.4rem 0.8rem; }
.rm-sheet-more > :where(p) { margin: 0 0.4rem 0.8rem; }
.rm-sheet-note { margin: 0.5rem 0.4rem 0; font-size: 0.78rem; color: var(--text-muted); }
.rm-keys kbd { padding: 0 0.3rem; font-size: 0.9em; background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: 4px; }
.rm-err { margin: 0.4rem 0 0; }
.rm-diag { font-size: 0.75rem; color: var(--text-muted); }
.rm-diag summary { font-weight: 700; }
.rm-sheet .rm-diag { font-size: inherit; color: inherit; }
.rm-sheet .rm-diag summary { font-weight: 600; }
.rm-sheet .rm-diag :where(p) { font-size: 0.75rem; color: var(--text-muted); }
.rm-diag :where(p) { font-family: var(--font-mono); overflow-wrap: anywhere; }
@keyframes rm-up { from { transform: translateY(100%); } }
@keyframes rm-float { from { opacity: 0; transform: translate(-50%, 0.6rem); } }

/* Czat: panel z boku na komputerze, dolny arkusz na telefonie. */
.rm-chatpanel { flex: 0 0 22rem; display: flex; flex-direction: column; min-width: 0; min-height: 0; color: var(--ink); background: var(--bg-card); border-left: 2px solid var(--ink); }
.rm-chat-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--tone-light); border-bottom: 1.5px solid var(--ink); }
.rm-chat-title { font-family: var(--font-display); font-size: 1.05rem; }
.rm-icon-btn { width: 2.4rem; height: 2.4rem; background: none; backdrop-filter: none; }
.rm-icon-btn:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.rm-icon-btn .ic { width: 1.2rem; height: 1.2rem; }
.rm-chat { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.35rem; min-height: 0; margin: 0; padding: 0.75rem; overflow-y: auto; overscroll-behavior: contain; list-style: none; background: var(--bg-subtle); }
.rm-chat .rm-msg { align-self: flex-start; max-width: 82%; margin: 0; padding: 0.4rem 0.65rem 0.3rem; font-size: 0.92rem; background: var(--bg-card); border: 1.5px solid var(--ink); border-radius: 0.9rem 0.9rem 0.9rem 0.25rem; overflow-wrap: anywhere; }
.rm-chat .rm-msg time { display: block; margin-top: 0.1rem; font-size: var(--fs-micro); color: var(--text-muted); text-align: right; }
.rm-chat .rm-msg-me { align-self: flex-end; background: var(--tone-light); border-radius: 0.9rem 0.9rem 0.25rem 0.9rem; }
.rm-chat .rm-msg-sys { align-self: center; max-width: 92%; padding: 0.15rem 0.5rem; font-size: 0.75rem; color: var(--text-muted); text-align: center; background: none; border: 0; }
.rm-chat-form { display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--bg-card); border-top: 1.5px solid var(--ink); }
/* 16 px: mniejsza czcionka pola każe iPhone'owi powiększyć stronę po dotknięciu. */
.rm-chat-form :where(input[type="text"]) { flex: 1; min-width: 0; padding: 0.6rem 1rem; font-size: 16px; border-radius: 99px; }
.rm-send { display: grid; place-items: center; flex-shrink: 0; width: 2.7rem; height: 2.7rem; padding: 0; color: var(--ink); cursor: pointer; background: var(--tone); border: 1.5px solid var(--ink); border-radius: 50%; }
.rm-send:disabled { opacity: 0.45; cursor: not-allowed; }
.rm-send .ic { width: 1.3rem; height: 1.3rem; }

/* ---------- Koniec rozmowy ---------- */
.rm-end { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; max-width: 30rem; margin: 1rem auto; padding: 2rem 1.5rem; text-align: center; }
.rm-end-ic { color: var(--ink); background: var(--accent-red-light); border-color: var(--ink); }

.rm-modal-text { margin: 0; color: var(--text-body); }
.rm-modal-foot { justify-content: stretch; }
.rm-modal-foot .btn { flex: 1; }

@media (max-width: 900px) {
  .rm-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .rm-mock { max-width: 18rem; }
  .rm-lobby { grid-template-columns: minmax(0, 1fr); }
  /* Niski kafel podglądu (16/9 na wąskim ekranie): wycentrowana treść
     wchodziła pod absolutne przyciski mikrofonu/kamery. Mniejsza ikona
     i dolny odstęp na wysokość rzędu przycisków. */
  .rm-off-ic { width: 2.6rem; height: 2.6rem; }
  .rm-off-ic .ic { width: 1.3rem; height: 1.3rem; }
  .rm-off { gap: 0.3rem; padding: 0.8rem 0.8rem 4rem; }
}

/* Telefon (i wąskie okno): czat jako dolny arkusz, obraz rozmówcy wypełnia ekran. */
@media (max-width: 700px) {
  .rm-chatpanel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; flex: none; height: min(72dvh, 34rem); border-left: 0; border-radius: 1.4rem 1.4rem 0 0; overflow: hidden; animation: rm-up 0.22s ease-out backwards; }
  .rm-chat-head { border-radius: 1.4rem 1.4rem 0 0; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .rm-remote-video:not(.rm-contain) { object-fit: cover; }
}
@media (max-width: 380px) {
  .rm-bar { gap: 0.6rem; padding-inline: 0.75rem; }
  .rm-ctl { width: 3.05rem; height: 3.05rem; }
}
@media (max-width: 560px) {
  .rm-pin-tiles .rm-pin-tile { width: 2.6rem; height: 3.1rem; font-size: 1.5rem; }
}

/* Komputer: szerszy podgląd własnego obrazu i arkusz „Więcej” nad paskiem. */
@media (min-width: 701px) {
  .rm-pip { width: 13rem; aspect-ratio: 16 / 10; }
  .rm-sheet { left: 50%; right: auto; bottom: calc(var(--rm-bar-h) + 0.2rem); width: 24rem; padding-bottom: 1rem; border-radius: 1.2rem; transform: translateX(-50%); animation-name: rm-float; }
}
/* Niski ekran poziomo (telefon na boku): podgląd mniejszy, żeby nie zasłaniał rozmówcy. */
@media (max-height: 500px) {
  .rm-pip { width: 5rem; }
  .rm-stage { --rm-top-h: calc(3.6rem + env(safe-area-inset-top)); }
}

/* Ruch jest ozdobą: globalna reguła prefers-reduced-motion z halonik.css
   wyłącza animacje, tu jawnie wymieniamy nasze na wypadek zmiany kolejności plików. */
@media (prefers-reduced-motion: reduce) {
  .rm-stickers .pill, .rm-choices .rm-choice, .rm-choices .rm-choice .subject-icon,
  .rm-dot.amber, .rm-knock, .rm-wait i,
  .rm-approval .btn.green, .rm-banner-btn.ok { animation: none; }
  .rm-approval .btn.green::after, .rm-banner-btn.ok::after { display: none; }
  .rm-bar, .rm-round, .rm-ctl, .rm-top, .rm-pip, .rm-ctl:active { transition: none; }
  .rm-sheet, .rm-chatpanel { animation: none; }
}
