/* ReflectMe v2 — style.css
 * Czysty, zrefaktoryzowany styl dla aplikacji ucznia.
 * Identitet: gradient tła, glass nav, Inter, akcent #0b4fd6.
 */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; color: #0F1A29;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f8ff 16%, #e6f2ff 42%, #d4e8ff 72%, #c3dcf6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

button { font-family: inherit; cursor: pointer; }

/* ========== layout root ========== */
#rm-app {
  width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-bottom: 0;
}
.rm-screen { flex: 1; display: flex; flex-direction: column; }
.rm-view { flex: 1; padding: 12px 16px 24px; display: flex; flex-direction: column; }

/* ========== typography ========== */
.rm-h1 { font-size: 23px; font-weight: 650; color: #0F1A29; margin: 0 0 6px; line-height: 1.22; letter-spacing: -0.02em; }
.rm-sub { font-size: 13px; color: #5B6B82; margin: 0 auto 14px; line-height: 1.45; max-width: 340px; }
.rm-section-title {
  font-size: 11px; font-weight: 600; color: #5B6B82;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 10px; padding: 0 2px;
}

/* ========== top header / topbar ========== */
.rm-header { padding-top: max(18px, env(safe-area-inset-top, 18px)); margin-bottom: 16px; text-align: center; }
.rm-topbar {
  display: flex; align-items: center; min-height: 36px;
  padding-top: env(safe-area-inset-top, 0px);
  margin-bottom: 12px;
}
.rm-topbar-cat {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: #0F1A29;
}
.rm-topbar-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rm-topbar-spacer { width: 70px; flex-shrink: 0; }

.rm-back {
  background: none; border: none; padding: 8px 4px;
  display: flex; align-items: center; gap: 4px;
  color: #5B6B82; font-size: 13px; font-weight: 500; flex-shrink: 0;
}
.rm-back i { font-size: 18px; }

/* ========== mode toggle ========== */
.rm-toggle-mode {
  display: flex;
  background: rgba(255,255,255,0.7);
  border: 0.5px solid #DCE4F0;
  border-radius: 999px;
  padding: 4px;
  margin: 0 0 14px;
}
.rm-toggle-opt {
  flex: 1; padding: 8px; border-radius: 999px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: #5B6B82; transition: all .15s;
}
.rm-toggle-opt.active { background: #0b4fd6; color: white; }

/* ========== cases banner ========== */
.rm-cases-banner {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(8px);
  border: 0.5px solid #93ABCE; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 14px; cursor: pointer; transition: all .15s;
}
.rm-cases-banner:hover { border-color: #0b4fd6; background: white; }
.rm-cases-icon {
  width: 36px; height: 36px; border-radius: 50%; background: #DBEAFE;
  display: flex; align-items: center; justify-content: center;
  color: #1E40AF; font-size: 18px; flex-shrink: 0;
}
.rm-cases-txt { flex: 1; text-align: left; }
.rm-cases-title { display: block; font-size: 13px; font-weight: 600; color: #0F1A29; }
.rm-cases-sub { display: block; font-size: 11px; color: #5B6B82; margin-top: 2px; }
.rm-cases-chev { color: #93ABCE; font-size: 18px; }

/* ========== category grid ========== */
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.rm-cat {
  background: rgba(255,255,255,0.85); backdrop-filter: blur(8px);
  border: 0.5px solid #DCE4F0; border-radius: 16px;
  padding: 14px 10px; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: transform .12s, border-color .15s, background .15s;
}
.rm-cat:hover { background: white; border-color: #93ABCE; }
.rm-cat:active { transform: scale(0.97); }
.rm-cat-icon { display: flex; align-items: center; justify-content: center; line-height: 0; }
.rm-cat-name { font-size: 12.5px; font-weight: 500; color: #0F1A29; text-align: center; line-height: 1.25; }


/* dolna karta — pomaga zacząć bez dublowania onboardingu */
.rm-bottom-fill {
  margin-top: clamp(10px, 2vh, 30px);
  padding-top: 0;
  margin-bottom: 10px;
}
.rm-help-card {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  border: 0.5px solid rgba(184, 203, 229, 0.85);
  background: rgba(255,255,255,0.62);
  border-radius: 16px;
  padding: 10px 14px;
  color: #0F1A29;
  box-shadow: 0 8px 20px rgba(15, 26, 41, 0.025);
}
.rm-help-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EAF2FF; color: #0b4fd6;
  flex-shrink: 0; font-size: 19px;
}
.rm-help-copy { flex: 1; min-width: 0; }
.rm-help-title { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.rm-help-sub { display: block; margin-top: 3px; font-size: 11.5px; color: #5B6B82; line-height: 1.35; }
.rm-help-chev { color: #7F96B8; font-size: 18px; }

/* ========== describe view ========== */
.rm-view-describe { padding-bottom: 32px; }
.rm-describe-body { display: flex; flex-direction: column; }

.rm-starter-block {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 1px 10px;
  margin: -2px 0 6px;
  scrollbar-width: none;
}
.rm-starter-block::-webkit-scrollbar { display: none; }
.rm-starter-chip {
  flex: 0 0 auto;
  border: 0.5px solid #C9D9F2;
  background: rgba(255,255,255,0.78);
  color: #1E40AF;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s;
}
.rm-starter-chip:hover { background: white; border-color: #93ABCE; }
.rm-starter-chip:active { transform: scale(0.98); }

.rm-ta-wrap { position: relative; margin-bottom: 14px; }
.rm-ta {
  width: 100%; min-height: 140px; resize: vertical;
  border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 14px 14px 28px; font-family: inherit; font-size: 14px;
  color: #0F1A29; background: white; line-height: 1.6; outline: none;
  transition: border-color .15s;
}
.rm-ta::placeholder { color: #93ABCE; }
.rm-ta:focus { border-color: #93ABCE; }
.rm-count { position: absolute; right: 12px; bottom: 9px; font-size: 11px; color: #B0BAC6; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.rm-count.visible { opacity: 1; }
.rm-count.near { color: #F97316; }
.rm-count.warn { color: #DC2626; }

/* ========== anon card ========== */
.rm-anon-card {
  background: white; border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 14px; margin-bottom: 14px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.rm-anon-card.contact { border-color: #93ABCE; background: #EFF6FF; }
.rm-anon-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rm-anon-info { display: flex; align-items: center; gap: 10px; }
.rm-anon-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rm-anon-lbl { font-size: 14px; font-weight: 500; color: #0F1A29; }
.rm-anon-sub { font-size: 11.5px; color: #5B6B82; margin-top: 1px; }
.rm-anon-track { width: 36px; height: 22px; border-radius: 999px; position: relative; flex-shrink: 0; transition: background .2s; }
.rm-anon-knob {
  position: absolute; top: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: white; transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.rm-contact-section { margin-top: 12px; padding-top: 12px; border-top: 0.5px solid #93ABCE; }
.rm-contact-lbl { display: block; font-size: 12.5px; font-weight: 500; color: #0F1A29; margin-bottom: 8px; }
.rm-contact-in {
  width: 100%; border: 0.5px solid #93ABCE; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  color: #0F1A29; background: white; outline: none; transition: border-color .15s;
}
.rm-contact-in:focus { border-color: #0b4fd6; }
.rm-contact-warn { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; }
.rm-contact-warn i { color: #1E40AF; font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.rm-contact-warn span { font-size: 12px; color: #1E40AF; line-height: 1.4; }

/* ========== buttons ========== */
.rm-btn {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; letter-spacing: 0.01em;
}
.rm-btn:disabled { background: #E2E8F0; color: #94A3B8; cursor: default; }
.rm-btn-primary:not(:disabled) { background: #0b4fd6; color: white; }
.rm-btn-primary:not(:disabled):hover { background: #0a42b8; }
.rm-btn-secondary { background: white; border: 0.5px solid #DCE4F0; color: #0b4fd6; }
.rm-btn-secondary:hover { border-color: #0b4fd6; background: #F0F7FF; }

/* ========== success ========== */
.rm-success-hero { text-align: center; padding: 24px 0 18px; }
.rm-success-icon {
  margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 50%;
  background: #D1FAE5; display: flex; align-items: center; justify-content: center;
  color: #10B981; font-size: 30px;
}
.rm-success-status-card {
  background: white; border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 14px; margin-bottom: 16px;
}
.rm-status-card-title { font-size: 12px; font-weight: 600; color: #5B6B82; margin-bottom: 10px; }
.rm-status-item { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.rm-status-item:last-child { margin-bottom: 0; }
.rm-status-dot { width: 11px; height: 11px; border-radius: 50%; background: #DCE4F0; flex-shrink: 0; }
.rm-status-item.active .rm-status-dot { background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.rm-status-item span { color: #5B6B82; }
.rm-status-item.active span { color: #0F1A29; font-weight: 500; }
.rm-success-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.rm-push-nudge-card {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 14px 0 16px; padding: 15px;
  border-radius: 18px; border: 1px solid rgba(11,79,214,.16);
  background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
  box-shadow: 0 14px 34px rgba(11,79,214,.10);
}
.rm-push-nudge-icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #DBEAFE; color: #0b4fd6; font-size: 22px;
}
.rm-push-nudge-title { font-size: 15px; font-weight: 800; color: #0F1A29; }
.rm-push-nudge-body p { margin: 5px 0 12px; color: #334155; font-size: 13px; line-height: 1.48; }
.rm-push-nudge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-push-nudge-status { margin-top: 10px; font-size: 12px; line-height: 1.4; color: #5B6B82; }

/* ========== status timeline ========== */
.rm-status-summary {
  display: flex; align-items: center; gap: 10px;
  background: white; border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 16px;
}
.rm-status-summary-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rm-status-summary-cat { font-size: 14px; font-weight: 500; color: #0F1A29; }
.rm-status-summary-meta { font-size: 12px; color: #5B6B82; margin-top: 2px; }

.rm-steps { display: flex; flex-direction: column; }
.rm-step { background: white; border: 0.5px solid #DCE4F0; border-bottom: none; cursor: pointer; transition: all .15s; }
.rm-step:first-child { border-radius: 14px 14px 0 0; }
.rm-step:last-child { border-radius: 0 0 14px 14px; border-bottom: 0.5px solid #DCE4F0; }
.rm-step.expanded { background: #EFF6FF; border-color: #93ABCE; }
.rm-step-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.rm-step-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.rm-step.done .rm-step-dot { background: #10B981; }
.rm-step.active .rm-step-dot { background: #0b4fd6; box-shadow: 0 0 0 3px rgba(11, 79, 214, 0.18); }
.rm-step.pending .rm-step-dot { background: #DCE4F0; }
.rm-step-content { flex: 1; }
.rm-step-title { font-size: 13.5px; font-weight: 500; color: #0F1A29; margin: 0; }
.rm-step-time { font-size: 11.5px; color: #5B6B82; margin: 2px 0 0; }
.rm-step-toggle { color: #93ABCE; font-size: 14px; flex-shrink: 0; margin-top: 4px; transition: transform .2s; }
.rm-step.expanded .rm-step-toggle { transform: rotate(180deg); }

.rm-step-details {
  display: none; padding: 12px 14px;
  background: #EFF6FF; border-top: 0.5px solid #93ABCE;
  font-size: 13px; color: #0F1A29; line-height: 1.55;
}
.rm-step.expanded .rm-step-details { display: block; }

.rm-msg-input {
  width: 100%; border: 0.5px solid #93ABCE; border-radius: 8px;
  padding: 9px 11px; font-size: 12.5px; font-family: inherit;
  outline: none; margin-top: 10px; box-sizing: border-box;
}
.rm-msg-input:focus { border-color: #0b4fd6; }

.rm-bottom-actions { margin-top: 18px; }

/* ========== cases list ========== */
.rm-cases-list { display: flex; flex-direction: column; gap: 10px; }
.rm-case-item {
  width: 100%; background: white; border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all .15s;
}
.rm-case-item:hover { border-color: #93ABCE; background: #FAFCFF; }
.rm-case-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rm-case-body { flex: 1; text-align: left; min-width: 0; }
.rm-case-cat { font-size: 14px; font-weight: 500; color: #0F1A29; margin: 0 0 5px; }
.rm-case-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rm-case-meta > span:first-child { font-size: 11.5px; color: #5B6B82; }
.rm-case-status { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; }
.rm-case-status.sent   { background: #D1FAE5; color: #0F6E56; }
.rm-case-status.read   { background: #FEF3C7; color: #92400E; }
.rm-case-status.active { background: #DBEAFE; color: #1E40AF; }
.rm-case-status.closed { background: #F1EFE8; color: #5F5E5A; }
.rm-case-chev { color: #93ABCE; font-size: 18px; flex-shrink: 0; }

.rm-empty { text-align: center; padding: 32px 12px; color: #5B6B82; font-size: 13px; }

/* ========== support ========== */
.rm-support-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: env(safe-area-inset-top, 0px); margin-bottom: 8px;
}
.rm-support-title { font-size: 22px; font-weight: 600; color: #0F1A29; margin: 0; letter-spacing: -0.01em; }
.rm-settings-btn {
  background: none; border: none; padding: 8px; color: #5B6B82; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: background .15s;
}
.rm-settings-btn:hover { background: rgba(255,255,255,0.6); }

.rm-emerg-card {
  background: white; border: 0.5px solid #DCE4F0; border-radius: 14px;
  padding: 14px;
  display: flex; align-items: flex-start; gap: 12px;
  text-decoration: none; margin-bottom: 10px; cursor: pointer; transition: all .15s;
}
.rm-emerg-card:hover { border-color: #93ABCE; background: #FAFCFF; }
.rm-emerg-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rm-emerg-icon i {
  font-size: 20px;
}

.rm-emerg-icon-danger {
  background: #FEF3C7;
  color: #92400E;
}

.rm-emerg-icon-phone {
  background: #DBEAFE;
  color: #1E40AF;
}

.rm-emerg-icon-chat {
  background: #EDE9FE;
  color: #534AB7;
}.rm-emerg-text { flex: 1; min-width: 0; }
.rm-emerg-title { font-size: 14px; font-weight: 600; color: #0F1A29; margin: 0 0 3px; }
.rm-emerg-desc  { font-size: 12px; color: #5B6B82; margin: 0 0 6px; }
.rm-emerg-number { font-size: 16px; font-weight: 700; color: #1E40AF; margin: 0; }
.rm-emerg-cta {
  margin-top: 6px; padding: 7px 14px;
  border: 0.5px solid #0b4fd6; background: none; color: #0b4fd6;
  font-size: 12px; font-weight: 600; border-radius: 8px;
}

.rm-faq-item {
  border: 0.5px solid #DCE4F0; border-radius: 12px;
  margin-bottom: 10px; overflow: hidden; background: white;
  transition: all .15s;
}
.rm-faq-head {
  padding: 13px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.rm-faq-q { font-size: 13.5px; font-weight: 500; color: #0F1A29; flex: 1; margin: 0; }
.rm-faq-chev { color: #93ABCE; font-size: 16px; transition: transform .2s; flex-shrink: 0; }
.rm-faq-item.open { border-color: #93ABCE; }
.rm-faq-item.open .rm-faq-head { background: #EFF6FF; }
.rm-faq-item.open .rm-faq-chev { transform: rotate(180deg); }
.rm-faq-answer {
  display: none; padding: 13px 14px;
  background: #EFF6FF; border-top: 0.5px solid #93ABCE;
  font-size: 13px; color: #0F1A29; line-height: 1.6;
}
.rm-faq-item.open .rm-faq-answer { display: block; }

/* ========== bottom tabs ========== */
.rm-tabs {
  position: sticky; bottom: 0; left: 0; right: 0;
  width: 100%; max-width: none; margin: 0;
  display: flex; justify-content: space-around;
  background: rgba(237, 243, 251, 0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid #C5D5E8;
  padding: 8px 0 max(12px, env(safe-area-inset-bottom, 12px));
  z-index: 100;
}
.rm-tab {
  flex: 1; background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0; color: #4A5566; font-size: 11px; font-weight: 500;
  position: relative;
}
.rm-tab i { font-size: 20px; }
.rm-tab.active { color: #0b4fd6; }
.rm-tab-dot { width: 4px; height: 4px; border-radius: 50%; background: #0b4fd6; margin-top: 1px; }

/* ========== modal ========== */
.rm-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 26, 41, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: rm-fade-in .2s ease;
}
@keyframes rm-fade-in { from { opacity: 0; } to { opacity: 1; } }
.rm-modal {
  width: 100%; max-width: 480px;
  background: white; border-radius: 20px 20px 0 0;
  padding: 18px 18px max(20px, env(safe-area-inset-bottom, 20px));
  animation: rm-slide-up .25s ease;
}
@keyframes rm-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.rm-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rm-modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: #0F1A29; }
.rm-modal-x { background: none; border: none; font-size: 22px; color: #5B6B82; padding: 4px; }
.rm-modal-body { display: flex; flex-direction: column; gap: 12px; }

.rm-setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: #F4F8FE; border-radius: 10px;
}
.rm-setting-k { font-size: 13px; color: #5B6B82; }
.rm-setting-v { font-size: 14px; font-weight: 600; color: #0F1A29; letter-spacing: 0.05em; }
.rm-setting-note { font-size: 11.5px; color: #5B6B82; line-height: 1.45; margin: 0; }

/* ========== a11y / loader ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#app-loader {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f8ff 50%, #d4e8ff 100%);
  z-index: 9999;
}
.loader-circle {
  width: 36px; height: 36px; border: 3px solid rgba(11, 79, 214, 0.2);
  border-top-color: #0b4fd6; border-radius: 50%;
  animation: rm-spin .8s linear infinite;
}
@keyframes rm-spin { to { transform: rotate(360deg); } }
#reflectme-splash {
  display: none;
}

html.rm-gate,
html.rm-gate body {
  min-height: 100%;
  background:
    radial-gradient(circle at 84% 18%, rgba(139, 92, 246, 0.08), transparent 30%),
    radial-gradient(circle at 12% 90%, rgba(59, 130, 246, 0.13), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
}

html.rm-gate #reflectme-splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse 420px 260px at 50% 18%,
      rgba(248, 251, 255, 0.99) 0%,
      rgba(248, 251, 255, 0.96) 42%,
      rgba(248, 251, 255, 0.00) 70%
    ),
    radial-gradient(circle at 84% 18%, rgba(139, 92, 246, 0.08), transparent 30%),
    radial-gradient(circle at 12% 90%, rgba(59, 130, 246, 0.13), transparent 32%),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.80), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
  z-index: 10000;
}

html.rm-gate #reflectme-splash::before {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  opacity: 0.80;
  background:
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 9%,
      rgba(255, 255, 255, 0.60) 10%,
      rgba(255, 255, 255, 0.18) 21%,
      transparent 22%,
      transparent 100%
    ),
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 38%,
      rgba(139, 92, 246, 0.10) 39%,
      rgba(255, 255, 255, 0.28) 50%,
      transparent 51%,
      transparent 100%
    ),
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 64%,
      rgba(59, 130, 246, 0.10) 65%,
      rgba(255, 255, 255, 0.30) 76%,
      transparent 77%,
      transparent 100%
    );
  transform: rotate(-5deg);
  filter: blur(0.15px);
  -webkit-mask-image:
    radial-gradient(
      ellipse 340px 220px at 50% 18%,
      transparent 0%,
      transparent 54%,
      rgba(0, 0, 0, 0.18) 66%,
      #000 78%,
      #000 100%
    );
  mask-image:
    radial-gradient(
      ellipse 340px 220px at 50% 18%,
      transparent 0%,
      transparent 54%,
      rgba(0, 0, 0, 0.18) 66%,
      #000 78%,
      #000 100%
    );
}

html.rm-gate #reflectme-splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.48;
  background-repeat: no-repeat;
  background-size: 150% 118%;
  background-position: center 58%;
  background-image: url("data:image/svg+xml,%3Csvg width='1100' height='1400' viewBox='0 0 1100 1400' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-120 1180C110 990 226 760 436 578C654 390 760 208 1180 -60' stroke='white' stroke-opacity='.64' stroke-width='2.1'/%3E%3Cpath d='M-130 1240C96 1048 220 830 448 638C676 446 794 272 1190 20' stroke='white' stroke-opacity='.50' stroke-width='1.8'/%3E%3Cpath d='M-140 1300C80 1110 210 900 456 704C696 512 824 338 1200 102' stroke='white' stroke-opacity='.38' stroke-width='1.5'/%3E%3Cpath d='M-150 1360C64 1176 204 978 466 774C718 578 852 410 1210 188' stroke='white' stroke-opacity='.30' stroke-width='1.3'/%3E%3Ccircle cx='140' cy='310' r='3' fill='white' fill-opacity='.58'/%3E%3Ccircle cx='880' cy='280' r='3.5' fill='white' fill-opacity='.52'/%3E%3Ccircle cx='980' cy='760' r='2.5' fill='white' fill-opacity='.46'/%3E%3Ccircle cx='180' cy='920' r='2.5' fill='white' fill-opacity='.42'/%3E%3C/svg%3E");
  -webkit-mask-image:
    radial-gradient(
      ellipse 340px 220px at 50% 18%,
      transparent 0%,
      transparent 54%,
      rgba(0, 0, 0, 0.18) 66%,
      #000 78%,
      #000 100%
    );
  mask-image:
    radial-gradient(
      ellipse 340px 220px at 50% 18%,
      transparent 0%,
      transparent 54%,
      rgba(0, 0, 0, 0.18) 66%,
      #000 78%,
      #000 100%
    );
}

html.rm-gate #reflectme-splash .splash-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.splash-logo-img {
  position: relative;
  z-index: 1;
  width: 168px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
  transform: translateY(-96px);
}

.rm-gate-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 34px 30px 28px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 26px 72px rgba(28, 45, 92, 0.10),
    0 10px 28px rgba(87, 120, 211, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
}

.rm-gate-title {
  font-size: 33px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: #0f1b44;
  margin: 0;
}

.rm-gate-desc {
  max-width: 300px;
  margin: 14px auto 0;
  font-size: 16px;
  line-height: 1.42;
  font-weight: 600;
  color: #6a7894;
}

.rm-code-shell {
  position: relative;
  width: 100%;
  margin: 28px auto 0;
}

.rm-code-hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 66px;
  opacity: 0;
  border: 0;
  outline: 0;
  cursor: text;
  z-index: 3;
}

.rm-code-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.rm-code-slot {
  position: relative;
  height: 66px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(198, 207, 226, 0.82);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1c2440;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.rm-code-slot:not(.is-filled) {
  color: #c8d1e1;
}

.rm-code-slot.is-filled {
  background: rgba(255,255,255,0.93);
  color: #1c2440;
}

.rm-code-slot.is-active {
  border-color: rgba(115, 112, 255, 0.88);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 0 0 4px rgba(120, 118, 255, 0.10);
}

.rm-code-slot.is-active::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 30px;
  border-radius: 2px;
  background: #7c8398;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.rm-gate-primary {
  margin-top: 24px;
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: #3b82f6;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 16px 30px rgba(59, 130, 246, 0.22);
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.rm-gate-primary:hover {
  background: #2f74f3;
}

.rm-gate-primary:active {
  transform: translateY(1px) scale(0.99);
}

.rm-gate-primary:disabled {
  cursor: wait;
  opacity: 0.76;
  filter: saturate(0.88);
}

.rm-gate-trust {
  margin: 20px auto 0;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: #73819b;
  text-align: center;
}

.rm-gate-trust-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2b6ef2;
  flex-shrink: 0;
  transform: translateY(1px);
}

.rm-gate-status {
  display: none;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

html.rm-gate #rm-app {
  display: none;
}

@media (min-width: 768px) and (max-width: 1180px) {
  html.rm-gate #reflectme-splash {
    padding: 32px 28px;
  }

  html.rm-gate #reflectme-splash .splash-inner {
    max-width: 520px;
    transform: translateY(-72px);
  }

  .splash-logo-img {
    width: 196px;
    margin-bottom: 18px;
    transform: translateY(-28px);
  }

  .rm-gate-box {
    max-width: 520px;
    padding: 36px 30px 28px;
    border-radius: 30px;
  }

  .rm-gate-title {
    font-size: 34px;
  }

  .rm-code-shell {
    margin-top: 26px;
  }

  .rm-code-slot {
    height: 64px;
    font-size: 22px;
  }

  .rm-code-hidden-input {
    height: 64px;
  }

  .rm-gate-primary {
    min-height: 60px;
    font-size: 18px;
  }

  .rm-gate-trust {
    margin-top: 18px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  html.rm-gate #reflectme-splash {
    padding: 16px;
    background:
      radial-gradient(
        ellipse 300px 210px at 50% 17%,
        rgba(248, 251, 255, 0.99) 0%,
        rgba(248, 251, 255, 0.96) 44%,
        rgba(248, 251, 255, 0.00) 72%
      ),
      radial-gradient(circle at 82% 16%, rgba(139, 92, 246, 0.06), transparent 28%),
      radial-gradient(circle at 10% 90%, rgba(59, 130, 246, 0.14), transparent 34%),
      radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.76), transparent 44%),
      linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
  }

  html.rm-gate #reflectme-splash::before {
    inset: -26%;
    opacity: 0.86;
    transform: rotate(-7deg);
    background-size: 100% 100%;
    -webkit-mask-image:
      radial-gradient(
        ellipse 270px 190px at 50% 17%,
        transparent 0%,
        transparent 56%,
        rgba(0, 0, 0, 0.18) 69%,
        #000 82%,
        #000 100%
      );
    mask-image:
      radial-gradient(
        ellipse 270px 190px at 50% 17%,
        transparent 0%,
        transparent 56%,
        rgba(0, 0, 0, 0.18) 69%,
        #000 82%,
        #000 100%
      );
  }

  html.rm-gate #reflectme-splash::after {
    inset: 0;
    opacity: 0.54;
    background-size: 230% 142%;
    background-position: 48% 62%;
    -webkit-mask-image:
      radial-gradient(
        ellipse 270px 190px at 50% 17%,
        transparent 0%,
        transparent 56%,
        rgba(0, 0, 0, 0.18) 69%,
        #000 82%,
        #000 100%
      );
    mask-image:
      radial-gradient(
        ellipse 270px 190px at 50% 17%,
        transparent 0%,
        transparent 56%,
        rgba(0, 0, 0, 0.18) 69%,
        #000 82%,
        #000 100%
      );
  }

  html.rm-gate #reflectme-splash .splash-inner {
    max-width: 100%;
    transform: translateY(-34px);
  }

  .splash-logo-img {
    width: 184px;
    margin-bottom: 1px;
    transform: translateY(-122px);
  }

  .rm-gate-box {
    max-width: 100%;
    padding: 30px 18px 24px;
    border-radius: 28px;
  }

  .rm-gate-title {
    font-size: 28px;
  }

  .rm-gate-desc {
    margin-top: 12px;
    font-size: 15px;
    max-width: 260px;
  }

  .rm-code-shell {
    margin-top: 24px;
  }

  .rm-code-slots {
    gap: 8px;
  }

  .rm-code-slot {
    height: 56px;
    border-radius: 15px;
    font-size: 21px;
  }

  .rm-code-slot.is-active::after {
    height: 26px;
  }

  .rm-code-hidden-input {
    height: 56px;
  }

  .rm-gate-primary {
    min-height: 56px;
    margin-top: 24px;
    font-size: 17px;
    border-radius: 18px;
  }

  .rm-gate-trust {
    max-width: 270px;
    margin-top: 22px;
    font-size: 12.5px;
    line-height: 1.42;
  }
}


/* ========== privacy view ========== */
.rm-privacy-block { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.rm-privacy-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.7); border: 0.5px solid #DCE4F0;
  border-radius: 14px; padding: 14px;
}
.rm-privacy-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rm-privacy-icon i { font-size: 16px; }
.rm-privacy-title { font-size: 13px; font-weight: 600; color: #0F1A29; margin-bottom: 3px; }
.rm-privacy-desc { font-size: 12px; color: #5B6B82; line-height: 1.45; }

/* privacy link as button */
.rm-privacy-link {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #1E40AF; padding: 10px 2px;
  font-family: inherit; opacity: 0.85;
}
.rm-privacy-link:hover { opacity: 1; }
.rm-privacy-link i { font-size: 14px; }

/* ========== settings extras ========== */
.rm-setting-divider { height: 0.5px; background: #DCE4F0; margin: 4px 0; }
.rm-setting-version { font-size: 11px; color: #A0AABB; text-align: center; margin: 8px 0 0; }
.rm-btn-danger-soft {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #FEF2F2; border: 0.5px solid #FECACA; color: #B91C1C;
  border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
}
.rm-btn-danger-soft:hover { background: #FEE2E2; }

/* ========== privacy critical card emphasis ========== */
.rm-privacy-item.rm-privacy-critical {
  border: 1px solid #FCD34D;
  background: linear-gradient(180deg, #FFFBEB 0%, rgba(255,255,255,0.78) 100%);
}

.rm-privacy-item.rm-privacy-critical .rm-privacy-title {
  color: #92400E;
}

/* ========== settings display (read-only Kod klasy) ========== */
.rm-setting-display {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 4px 12px;
}
.rm-setting-display .rm-setting-k {
  font-size: 11px; color: #5B6B82; text-transform: uppercase; letter-spacing: 0.5px;
}
.rm-setting-display .rm-setting-v {
  font-size: 18px; font-weight: 600; color: #0F1A29; letter-spacing: 0.08em;
}


/* ReflectMe v1 signal status messaging */
.rm-add-msg-row{display:flex;gap:8px;margin-top:12px;align-items:center}.rm-msg-input{width:100%;border:1px solid rgba(17,24,39,.14);border-radius:14px;padding:12px 14px;font:inherit;background:#fff;outline:none}.rm-msg-input:focus{border-color:rgba(64,80,181,.45);box-shadow:0 0 0 4px rgba(64,80,181,.08)}.rm-msg-btn{border:0;border-radius:14px;background:#111827;color:#fff;font-weight:700;padding:12px 14px;white-space:nowrap}.rm-msg-thread{margin:18px 16px 0}.rm-msg-bubble{background:#fff;border:1px solid rgba(17,24,39,.08);border-radius:16px;padding:12px 14px;margin:8px 0;box-shadow:0 8px 24px rgba(17,24,39,.04)}.rm-msg-bubble.staff{background:#f8fafc}.rm-msg-bubble small{display:block;margin-top:6px;color:#6b7280;font-size:12px}.rm-case-status.waiting{background:#fff7ed;color:#9a3412}.rm-step.active .rm-step-dot,.rm-step.done .rm-step-dot{box-shadow:0 0 0 4px rgba(64,80,181,.1)}

/* ========== response continuity: notifications, drafts, follow-ups, critical support ========== */
.rm-draft-banner,
.rm-followup-banner {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.78); border: 0.5px solid #DCE4F0;
  border-radius: 16px; padding: 12px 14px; margin: 12px 0;
  box-shadow: 0 10px 30px rgba(15,26,41,.06); color: #0F1A29;
}
.rm-draft-banner { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; font-size: 13px; }
.rm-followup-banner { cursor: pointer; text-align: left; font-family: inherit; }
.rm-followup-banner .rm-cases-icon { background: #ECFDF5; color: #047857; }
.rm-critical-card {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 14px 16px; padding: 16px;
  border: 1px solid #FCA5A5; border-radius: 18px;
  background: linear-gradient(180deg, #FFF7F7 0%, #FFFFFF 100%);
  box-shadow: 0 16px 38px rgba(153,27,27,.08);
}
.rm-critical-icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #FEE2E2; color: #991B1B;
}
.rm-critical-body h2 { margin: 0 0 6px; font-size: 17px; color: #991B1B; }
.rm-critical-body p { margin: 0; font-size: 13px; line-height: 1.55; color: #374151; }
.rm-critical-actions { display: grid; gap: 8px; margin: 12px 0; }
.rm-critical-actions a {
  display: block; text-decoration: none; text-align: center;
  border-radius: 13px; padding: 11px 12px; font-size: 13px; font-weight: 700;
  color: #fff; background: #991B1B;
}
.rm-critical-note { font-size: 12px !important; color: #6B7280 !important; }
.rm-followup-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.rm-followup-card {
  background: #fff; border: 0.5px solid #DCE4F0; border-radius: 18px;
  padding: 14px; box-shadow: 0 12px 32px rgba(15,26,41,.06);
}
.rm-followup-title { font-size: 16px; font-weight: 700; color: #0F1A29; }
.rm-followup-sub { margin-top: 4px; font-size: 13px; color: #5B6B82; line-height: 1.45; }
.rm-followup-note {
  width: 100%; min-height: 70px; margin-top: 12px; border: 1px solid #DCE4F0;
  border-radius: 14px; padding: 12px; font-family: inherit; font-size: 13px; resize: vertical;
}
.rm-followup-actions { display: grid; gap: 8px; margin-top: 12px; }
.rm-followup-actions button {
  border: 0; border-radius: 13px; padding: 11px 12px;
  font-family: inherit; font-weight: 700; font-size: 13px; color: #0F1A29;
  background: #EFF6FF; cursor: pointer;
}
.rm-followup-actions button:nth-child(2), .rm-followup-actions button:nth-child(3) { background: #FEE2E2; color: #991B1B; }
.rm-notification-settings { display: flex; flex-direction: column; gap: 8px; }
.rm-setting-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-draft-banner { cursor: pointer; text-align: left; font-family: inherit; }


/* ========== fatal runtime fallback ========== */
.rm-fatal-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #fbfdff 0%, #edf6ff 48%, #d8eaff 100%);
}

.rm-fatal-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .14);
}

.rm-fatal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FEE2E2;
  color: #991B1B;
  font-weight: 800;
  font-size: 20px;
}

.rm-fatal-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.rm-fatal-card p {
  margin: 0 0 18px;
  color: #4B5563;
  font-size: 14px;
  line-height: 1.45;
}

.rm-fatal-card button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: #0b4fd6;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}


/* ============================================================
 * Intro / Onboarding (po wpisaniu kodu klasy, pierwsze wejście)
 * Kierunek: Sticker hero — duża ilustracja-bohater z soft glow,
 * radial gradient bg, dots morph, gradient CTA z ikoną.
 * Renderowane do #reflectme-splash .splash-inner przez gate.js
 * ============================================================ */

.rm-intro {
  width: 100%;
  max-width: 390px;
  display: flex;
  justify-content: center;
  padding: 0;
}

.rm-intro-card {
  width: 100%;
  background: radial-gradient(circle at 50% 0%, #dbeafe 0%, #ecf4ff 22%, #f8fbff 50%, #ffffff 100%);
  border: 0.5px solid #D5E2F3;
  border-radius: 32px;
  padding: 18px 18px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 24px 60px -22px rgba(11, 79, 214, 0.22),
    0 8px 20px -8px rgba(15, 26, 41, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translateY(8px);
  animation: rm-intro-scene-in 0.5s cubic-bezier(.22,.94,.36,1) forwards;
}

@keyframes rm-intro-scene-in {
  to { opacity: 1; transform: translateY(0); }
}

.rm-intro-card.is-glinting::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: rm-intro-glint 0.9s cubic-bezier(.22,.94,.36,1) forwards;
}
@keyframes rm-intro-glint {
  to { transform: translateX(100%); }
}

.rm-intro-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

.rm-intro-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0F1A29;
}
.rm-intro-brand-accent { color: #0b4fd6; }

.rm-intro-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.rm-intro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D5E2F3;
  transition: width 0.35s cubic-bezier(.22,.94,.36,1), background-color 0.35s ease;
}
.rm-intro-dot.is-active {
  width: 20px;
  border-radius: 999px;
  background: #0b4fd6;
}

.rm-intro-hero {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 8px 0 8px;
}
.rm-intro-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.rm-intro-glow-far {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(11,79,214,.08) 0%, transparent 60%);
  filter: blur(12px);
}
.rm-intro-glow-near {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(11,79,214,.22) 0%, rgba(11,79,214,.06) 40%, transparent 70%);
  filter: blur(6px);
}
.rm-intro-visual {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 180px;
}
.rm-intro-visual svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* animacje ilustracji — JEDYNIE translateY, żeby NIE nadpisywać transform="translate(x y)" na elementach SVG */
.rm-drift { animation: rm-drift 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.rm-drift-2 { animation: rm-drift-2 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.rm-drift-3 { animation: rm-drift-3 5.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.rm-orbit { animation: rm-orbit 40s linear infinite; }

@keyframes rm-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rm-drift-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes rm-drift-3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes rm-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.rm-intro-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
}
.rm-intro-stage.is-entering .rm-intro-eyebrow,
.rm-intro-stage.is-entering .rm-intro-title,
.rm-intro-stage.is-entering .rm-intro-body,
.rm-intro-stage.is-entering .rm-intro-meta,
.rm-intro-stage.is-entering .rm-intro-visual {
  animation: rm-intro-text-in 0.45s cubic-bezier(.22,.94,.36,1) both;
}
.rm-intro-stage.is-entering .rm-intro-eyebrow { animation-delay: 0.04s; }
.rm-intro-stage.is-entering .rm-intro-title { animation-delay: 0.10s; }
.rm-intro-stage.is-entering .rm-intro-body { animation-delay: 0.16s; }
.rm-intro-stage.is-entering .rm-intro-meta { animation-delay: 0.22s; }

@keyframes rm-intro-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rm-intro-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: #0b4fd6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.rm-intro-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.08;
  margin: 0 14px 10px;
  color: #0F1A29;
}

.rm-intro-body {
  font-size: 14px;
  line-height: 1.5;
  color: #5B6B82;
  margin: 0 14px 18px;
  max-width: 320px;
}

.rm-intro-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 0.5px solid #D5E2F3;
  font-size: 12.5px;
  font-weight: 600;
  color: #1E40AF;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px -2px rgba(11, 79, 214, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rm-intro-meta i {
  font-size: 15px;
  color: #0b4fd6;
}

.rm-intro-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 4px;
}

.rm-intro-skip {
  background: transparent;
  border: none;
  color: #5B6B82;
  font-size: 13.5px;
  font-weight: 500;
  padding: 14px 6px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
.rm-intro-skip:hover { color: #0F1A29; }
.rm-intro-skip:active { transform: scale(0.97); }

.rm-intro-next {
  flex: 1;
  background: linear-gradient(180deg, #1660e8 0%, #0b4fd6 100%);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 16px;
  font-family: inherit;
  letter-spacing: -0.01em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 8px 22px -4px rgba(11, 79, 214, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.rm-intro-next:hover {
  box-shadow:
    0 10px 26px -4px rgba(11, 79, 214, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.rm-intro-next:active { transform: scale(0.98); }
.rm-intro-next i { font-size: 16px; }

@media (max-height: 680px) {
  .rm-intro-hero { height: 170px; }
  .rm-intro-visual { width: 170px; height: 150px; }
  .rm-intro-glow-near { width: 170px; height: 170px; }
  .rm-intro-glow-far { width: 210px; height: 210px; }
  .rm-intro-title { font-size: 24px; }
  .rm-intro-body { font-size: 13.5px; margin-bottom: 14px; }
  .rm-intro-meta { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-intro-card,
  .rm-intro-card.is-glinting::after,
  .rm-intro-stage.is-entering .rm-intro-eyebrow,
  .rm-intro-stage.is-entering .rm-intro-title,
  .rm-intro-stage.is-entering .rm-intro-body,
  .rm-intro-stage.is-entering .rm-intro-meta,
  .rm-intro-stage.is-entering .rm-intro-visual,
  .rm-drift, .rm-drift-2, .rm-drift-3, .rm-orbit {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Case-thread / student signal model */
.rm-handler-card,
.rm-add-msg-card,
.rm-event-thread {
  margin: 14px 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  border: 1px solid rgba(15,23,42,.07);
  box-shadow:
    0 18px 44px rgba(15,23,42,.07),
    inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rm-handler-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px;
}

.rm-handler-icon {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #EEF2FF, #E0E7FF);
  color: #3730A3;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.rm-handler-icon i {
  font-size: 19px;
}

.rm-handler-body {
  min-width: 0;
}

.rm-handler-eyebrow,
.rm-add-msg-eyebrow {
  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 4px;
}

.rm-handler-title {
  font-weight: 850;
  font-size: 14px;
  line-height: 1.2;
  color: #0F172A;
  margin-bottom: 4px;
}

.rm-handler-text,
.rm-thread-hint {
  font-size: 13px;
  color: #475569;
  line-height: 1.42;
  margin: 0;
}

.rm-event-thread {
  padding: 14px;
}

.rm-event-item {
  padding: 11px 0;
  border-top: 1px solid rgba(15,23,42,.07);
  font-size: 13px;
  color: #0F172A;
  line-height: 1.4;
}

.rm-event-item:first-of-type {
  border-top: 0;
}

.rm-event-item small,
.rm-msg-bubble small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #64748B;
}

.rm-msg-bubble strong {
  display: block;
  font-size: 11px;
  color: #64748B;
  margin-bottom: 4px;
}

.rm-add-msg-card {
  padding: 15px;
}

.rm-add-msg-card.is-waiting {
  border-color: rgba(180,83,9,.16);
  background:
    linear-gradient(180deg, rgba(255,251,235,.96), rgba(255,255,255,.86));
}

.rm-add-msg-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.rm-add-msg-icon {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ECFDF5, #D1FAE5);
  color: #047857;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.rm-add-msg-card.is-waiting .rm-add-msg-icon {
  background: linear-gradient(180deg, #FEF3C7, #FDE68A);
  color: #92400E;
}

.rm-add-msg-icon i {
  font-size: 19px;
}

.rm-add-msg-card .rm-section-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
  color: #0F172A;
}

.rm-add-msg-card .rm-thread-hint {
  margin-top: 9px;
}

.rm-add-msg-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 17px;
  background: rgba(248,250,252,.88);
  border: 1px solid rgba(15,23,42,.07);
}

.rm-msg-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0F172A;
  font-size: 14px;
  padding: 0 4px;
}

.rm-msg-input::placeholder {
  color: #94A3B8;
}

.rm-msg-btn {
  height: 40px;
  min-width: 72px;
  border: 0;
  border-radius: 13px;
  padding: 0 14px;
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15,23,42,.16);
}

.rm-msg-btn:active {
  transform: translateY(1px);
}

@media (max-width: 380px) {
  .rm-handler-card,
  .rm-add-msg-card,
  .rm-event-thread {
    margin-left: 12px;
    margin-right: 12px;
    border-radius: 20px;
  }

  .rm-add-msg-row {
    gap: 6px;
  }

  .rm-msg-btn {
    min-width: 64px;
    padding: 0 12px;
  }
}

/* ============================================================
 * ReflectMe Gate — VARIANT 4 final background override
 * Cel: miękkie diagonalne ribbons + subtelne linie/particles.
 * Ten blok jest na końcu pliku celowo, żeby nadpisać wcześniejsze
 * eksperymenty tła bez ruszania logiki gate.js.
 * ============================================================ */

html.rm-gate,
html.rm-gate body {
  min-height: 100%;
  background:
    radial-gradient(circle at 84% 18%, rgba(139, 92, 246, 0.10), transparent 30%),
    radial-gradient(circle at 12% 90%, rgba(59, 130, 246, 0.13), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
}

html.rm-gate #reflectme-splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 18%, rgba(139, 92, 246, 0.10), transparent 30%),
    radial-gradient(circle at 12% 90%, rgba(59, 130, 246, 0.13), transparent 32%),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.80), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
  z-index: 10000;
}

html.rm-gate #reflectme-splash::before {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  opacity: 1.00;
  background:
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 9%,
      rgba(255, 255, 255, 0.60) 10%,
      rgba(255, 255, 255, 0.18) 21%,
      transparent 22%,
      transparent 100%
    ),
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 38%,
      rgba(139, 92, 246, 0.11) 39%,
      rgba(255, 255, 255, 0.28) 50%,
      transparent 51%,
      transparent 100%
    ),
    linear-gradient(
      128deg,
      transparent 0%,
      transparent 64%,
      rgba(59, 130, 246, 0.10) 65%,
      rgba(255, 255, 255, 0.30) 76%,
      transparent 77%,
      transparent 100%
    );
  transform: rotate(-5deg);
  filter: blur(0.15px);
}

html.rm-gate #reflectme-splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.48;
  background-repeat: no-repeat;
  background-size: 150% 118%;
  background-position: center 58%;
  background-image: url("data:image/svg+xml,%3Csvg width='1100' height='1400' viewBox='0 0 1100 1400' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-120 1180C110 990 226 760 436 578C654 390 760 208 1180 -60' stroke='white' stroke-opacity='.64' stroke-width='2.1'/%3E%3Cpath d='M-130 1240C96 1048 220 830 448 638C676 446 794 272 1190 20' stroke='white' stroke-opacity='.50' stroke-width='1.8'/%3E%3Cpath d='M-140 1300C80 1110 210 900 456 704C696 512 824 338 1200 102' stroke='white' stroke-opacity='.38' stroke-width='1.5'/%3E%3Cpath d='M-150 1360C64 1176 204 978 466 774C718 578 852 410 1210 188' stroke='white' stroke-opacity='.30' stroke-width='1.3'/%3E%3Ccircle cx='140' cy='310' r='3' fill='white' fill-opacity='.58'/%3E%3Ccircle cx='880' cy='280' r='3.5' fill='white' fill-opacity='.52'/%3E%3Ccircle cx='980' cy='760' r='2.5' fill='white' fill-opacity='.46'/%3E%3Ccircle cx='180' cy='920' r='2.5' fill='white' fill-opacity='.42'/%3E%3C/svg%3E");
}

html.rm-gate #reflectme-splash .splash-inner {
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  html.rm-gate #reflectme-splash {
    background:
  radial-gradient(
    ellipse 300px 210px at 50% 17%,
    rgba(248, 251, 255, 0.99) 0%,
    rgba(248, 251, 255, 0.96) 44%,
    rgba(248, 251, 255, 0.00) 72%
  ),
  radial-gradient(circle at 8% 10%, rgba(59, 130, 246, 0.13), transparent 30%),
  radial-gradient(circle at 24% 20%, rgba(139, 92, 246, 0.09), transparent 32%),
  radial-gradient(circle at 82% 16%, rgba(139, 92, 246, 0.06), transparent 28%),
  radial-gradient(circle at 10% 90%, rgba(59, 130, 246, 0.14), transparent 34%),
  radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.76), transparent 44%),
  linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #eaf2fb 100%);
  }

  html.rm-gate #reflectme-splash::before {
    inset: -26%;
    opacity: 0.86;
    transform: rotate(-7deg);
    background-size: 100% 100%;
  }

  html.rm-gate #reflectme-splash::after {
    inset: 0;
    opacity: 0.54;
    background-size: 230% 142%;
    background-position: 48% 62%;
  }
}


/* Status CTA opening the thread */
.rm-add-msg-open {
  width: 100%;
  margin-top: 13px;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 16px;
  background: #0F172A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(15,23,42,.18);
}

.rm-add-msg-open:active {
  transform: translateY(1px);
}

/* ========== thread screen / mobile-grade async thread ========== */
.rm-view-thread {
  padding: 0 16px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 7%, rgba(255,255,255,.78), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(139, 92, 246, .045), transparent 28%),
    linear-gradient(180deg, #F8FBFF 0%, #EEF7FF 42%, #D8ECFF 100%);
}

.rm-thread-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  margin: 0 -16px;
  padding: max(8px, env(safe-area-inset-top, 8px)) 16px 8px;
  background:
    linear-gradient(180deg, rgba(251,253,255,.98), rgba(246,250,255,.91));
  border-bottom: 0.5px solid rgba(197,213,232,.58);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.rm-thread-topbar .rm-back {
  min-height: 44px;
  padding-left: 4px;
  padding-right: 10px;
}

.rm-thread-topbar-minimal {
  justify-content: flex-start;
}

.rm-thread-topbar-fill {
  flex: 1;
  min-width: 0;
}

.rm-thread-topbar-title {
  display: none;
}

.rm-thread-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rm-thread-screen-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0 12px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rm-thread-offline-state,
.rm-thread-error-state {
  margin: 8px 0 0;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 750;
  color: #475569;
  background: rgba(255,255,255,.78);
  border: 0.5px solid rgba(197,213,232,.88);
  box-shadow: 0 10px 22px rgba(15,26,41,.04);
}

.rm-thread-error-state {
  border: 0;
  color: #92400E;
  background: rgba(255,247,237,.92);
  cursor: pointer;
}

.rm-thread-offline-state i,
.rm-thread-error-state i {
  font-size: 15px;
}

.rm-msg-list {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 6px 1px 8px;
}

.rm-thread-date-separator {
  display: flex;
  justify-content: center;
  margin: 9px 0 12px;
}

.rm-thread-date-separator span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.50);
  border: 0.5px solid rgba(197,213,232,.56);
  color: #6F829C;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(15,26,41,.032);
}

.rm-msg-row {
  display: flex;
  width: 100%;
  animation: rm-message-in .17s ease-out both;
}

.rm-msg-row.compact {
  margin-top: -5px;
}

.rm-msg-row.same-author:not(.compact) {
  margin-top: 1px;
}

.rm-msg-row.new-author:not(:first-child) {
  margin-top: 13px;
}

.rm-msg-row.staff {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
}

.rm-msg-row.student {
  justify-content: flex-end;
  align-items: flex-end;
}

.rm-msg-avatar,
.rm-msg-avatar-spacer {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.rm-msg-avatar {
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  border: 0.5px solid rgba(148,163,184,.24);
  color: #5F738E;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(15,26,41,.045);
}

.rm-msg-avatar-spacer {
  opacity: 0;
}

@keyframes rm-message-in {
  from { opacity: 0; transform: translateY(5px) scale(.986); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rm-msg-bubble-chat {
  position: relative;
  max-width: min(78%, 328px);
  padding: 10px 13px 9px;
  border-radius: 22px;
  font-size: 13.8px;
  line-height: 1.47;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 24px rgba(15,26,41,.058);
}

.rm-msg-bubble-chat.staff {
  background:
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(255,255,255,.93));
  border: 0.5px solid rgba(148,163,184,.22);
  color: #0F1A29;
  border-bottom-left-radius: 8px;
  box-shadow: 0 10px 22px rgba(15,26,41,.048);
}

.rm-msg-bubble-chat.student {
  background:
    linear-gradient(180deg, #3A567E 0%, #2B456B 100%);
  border: 0.5px solid rgba(43,69,107,.12);
  color: #FFFFFF;
  border-bottom-right-radius: 8px;
  box-shadow: 0 9px 21px rgba(43,69,107,.115);
}

.rm-msg-bubble-chat.question {
  background:
    linear-gradient(180deg, #FFF8ED 0%, #FFFCF7 100%);
  border: 0.5px solid rgba(217,119,6,.20);
  color: #0F1A29;
}

.rm-msg-bubble-chat.pending {
  opacity: .74;
}

.rm-msg-bubble-chat.failed {
  border-color: rgba(180,83,9,.38);
  box-shadow: 0 12px 28px rgba(180,83,9,.08);
}

.rm-msg-bubble-chat.compact.student {
  border-top-right-radius: 15px;
}

.rm-msg-bubble-chat.compact.staff {
  border-top-left-radius: 15px;
}

.rm-msg-bubble-chat strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  color: inherit;
  opacity: .72;
}

.rm-msg-text {
  white-space: pre-wrap;
}

.rm-msg-bubble-chat small {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.1;
  color: inherit;
  opacity: .58;
}

.rm-msg-state {
  font-weight: 800;
  opacity: .9;
}

.rm-msg-state.failed {
  color: #B45309;
}

.rm-msg-retry {
  margin-top: 8px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255,255,255,.88);
  color: #92400E;
  font-size: 11px;
  font-weight: 850;
  box-shadow: inset 0 0 0 0.5px rgba(180,83,9,.20);
}

.rm-thread-empty-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 112px;
  text-align: center;
}

.rm-thread-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.82);
  border: 0.5px solid #DCE4F0;
  color: #5B6B82;
  font-size: 21px;
  margin-bottom: 10px;
}

.rm-thread-empty-state .rm-thread-hint {
  max-width: 260px;
  margin: 0;
  color: #5B6B82;
  font-size: 12.5px;
  line-height: 1.45;
}

.rm-thread-skeleton {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  padding: 20px 2px 24px;
}

.rm-thread-skeleton-bubble {
  width: 62%;
  height: 54px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.46), rgba(255,255,255,.86), rgba(255,255,255,.46));
  background-size: 220% 100%;
  animation: rm-thread-skeleton 1.2s ease-in-out infinite;
  box-shadow: 0 10px 22px rgba(15,26,41,.04);
}

.rm-thread-skeleton-bubble.student {
  align-self: flex-end;
  background:
    linear-gradient(90deg, rgba(43,69,107,.17), rgba(43,69,107,.28), rgba(43,69,107,.17));
  background-size: 220% 100%;
}

.rm-thread-skeleton-bubble.staff {
  align-self: flex-start;
}

.rm-thread-skeleton-bubble.short {
  width: 44%;
}

@keyframes rm-thread-skeleton {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.rm-thread-bottom-jump {
  position: absolute;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 14;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.94);
  color: #3B5A83;
  box-shadow:
    0 14px 28px rgba(15,26,41,.13),
    inset 0 0 0 0.5px rgba(147,171,206,.58);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.96);
  transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease;
}

.rm-thread-bottom-jump.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.rm-thread-bottom-jump:active {
  transform: translateY(1px) scale(.98);
  box-shadow:
    0 10px 20px rgba(15,26,41,.11),
    inset 0 0 0 0.5px rgba(147,171,206,.70);
}

.rm-thread-bottom-jump i {
  font-size: 19px;
}

.rm-thread-composer {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
  margin: 0 -16px;
  padding: 10px 16px max(13px, env(safe-area-inset-bottom, 13px));
  background:
    linear-gradient(180deg, rgba(216,236,255,0), rgba(216,236,255,.94) 30%, rgba(216,236,255,1) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rm-thread-input-shell {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  border: 0.5px solid rgba(147,171,206,.86);
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  box-shadow:
    0 12px 26px rgba(15,26,41,.052),
    inset 0 1px 0 rgba(255,255,255,.82);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.rm-thread-input-shell:focus-within {
  border-color: #2E6BE6;
  box-shadow:
    0 14px 30px rgba(46,107,230,.08),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.rm-thread-ta {
  width: 100%;
  min-height: 50px;
  max-height: 136px;
  resize: none;
  border: 0;
  border-radius: 24px;
  padding: 15px 14px 18px;
  font-family: inherit;
  font-size: 14px;
  color: #0F1A29;
  background: transparent;
  line-height: 1.45;
  outline: none;
}

.rm-thread-ta::placeholder {
  color: #93ABCE;
}

.rm-thread-composer .rm-count {
  right: 14px;
  bottom: 5px;
}

.rm-thread-send {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2B456B;
  color: #FFFFFF;
  box-shadow: 0 12px 24px rgba(43,69,107,.16);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, opacity .14s ease;
}

.rm-thread-send:active:not(:disabled) {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 8px 18px rgba(43,69,107,.15);
}

.rm-thread-send span {
  display: none;
}

.rm-thread-send i {
  font-size: 20px;
}

.rm-thread-send:disabled {
  background: rgba(226,232,240,.94);
  color: #94A3B8;
  box-shadow: none;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .rm-msg-row,
  .rm-thread-skeleton-bubble {
    animation: none;
  }

  .rm-thread-screen-body {
    scroll-behavior: auto;
  }
}

@media (max-width: 380px) {
  .rm-view-thread {
    padding-left: 12px;
    padding-right: 12px;
  }

  .rm-thread-topbar,
  .rm-thread-composer {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .rm-msg-bubble-chat {
    max-width: 86%;
  }

  .rm-thread-send {
    width: 50px;
    height: 50px;
    border-radius: 19px;
  }

  .rm-thread-bottom-jump {
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}
