:root {
  --rb-navy: #071d39;
  --rb-ink: #10264a;
  --rb-muted: #657793;
  --rb-line: #d7e1ed;
  --rb-blue: #2170ec;
  --rb-canvas: #f3f7fb;
  --rb-danger: #b42318;
}

.rb-account-beta-features {
  margin: 14px 0 12px;
  padding: 13px;
  border: 1px solid #bcd5ed;
  border-radius: 12px;
  background: linear-gradient(135deg,#f2f8ff,#f8fbff);
}
.rb-account-beta-features > strong {
  display: block;
  margin-bottom: 9px;
  color: #1d5b92;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
}
.rb-account-beta-features > div {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}
.rb-account-beta-features button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #b8cee2;
  border-radius: 9px;
  color: #1a456c;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.rb-account-beta-features button:hover {
  border-color: #4d91d0;
  background: #edf6ff;
  transform: translateY(-1px);
}
.rb-account-beta-features button span { font-size: 11px; font-weight: 820; }
.rb-account-beta-features button small { color: #6a8094; font-size: 8px; line-height: 1.45; }
@media (max-width: 620px) {
  .rb-account-beta-features > div { grid-template-columns: 1fr; }
  .rb-account-beta-features button { min-height: 54px; }
}

html.rb-auth-pending #root { visibility: hidden; }

.rb-hidden { display: none !important; }

.rb-auth-shell,
.rb-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  color: var(--rb-ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(33, 103, 236, .16), transparent 36%),
    linear-gradient(145deg, #eef5fc, #f8fbff 55%, #eaf3fb);
  font-family: Inter, "Noto Sans SC", "Segoe UI", sans-serif;
}

.rb-modal-shell { background: rgba(7, 29, 57, .48); backdrop-filter: blur(5px); }

.rb-auth-card,
.rb-modal-card {
  width: min(100%, 480px);
  padding: 30px;
  border: 1px solid var(--rb-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 70px rgba(7, 29, 57, .18);
}
.rb-auth-card-minimal { width: min(100%, 430px); }
.rb-auth-card-minimal .rb-auth-brand-row { margin-bottom: 20px; }
.rb-auth-card-minimal h1 { margin-bottom: 20px; }

.rb-modal-card { width: min(100%, 660px); max-height: calc(100vh - 40px); overflow: auto; }
.rb-modal-card.rb-wide { width: min(100%, 820px); }

.rb-auth-brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.rb-brand { display: flex; align-items: center; gap: 12px; }
.rb-brand-mark { display: grid; place-items: center; width: 46px; height: 46px; color: white; border-radius: 14px; background: linear-gradient(145deg, #2b7cf5, #1552d5); font-weight: 900; box-shadow: 0 9px 24px rgba(33,103,236,.28); }
.rb-brand-mark .rb-logo-svg { width: 100%; height: 100%; }
.rb-brand strong { display: block; font-size: 17px; }
.rb-brand small { display: block; margin-top: 2px; color: var(--rb-muted); font-size: 11px; }
.rb-auth-language select { max-width: 150px; min-height: 38px; padding: 0 30px 0 10px; color: #36536f; border: 1px solid var(--rb-line); border-radius: 9px; background: white; font-size: 11px; }

.rb-auth-card h1,
.rb-modal-card h2 { margin: 0; color: #0b2143; font-size: 26px; line-height: 1.2; }
.rb-auth-card > p,
.rb-modal-card > p { margin: 8px 0 22px; color: var(--rb-muted); font-size: 13px; line-height:1.7; }

.rb-form { display: grid; gap: 14px; }
.rb-field { display: grid; gap: 6px; }
.rb-field > span { color: #334f70; font-size: 12px; font-weight: 750; }
.rb-field input,
.rb-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: #183453;
  border: 1px solid #bfcee0;
  border-radius: 10px;
  outline: none;
  background: white;
  font: inherit;
  font-size: 14px;
}
.rb-field input:focus,
.rb-field select:focus { border-color: #6e9bea; box-shadow: 0 0 0 3px rgba(33, 103, 236, .12); }

.rb-preference-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--rb-line);
  border-radius: 12px;
  background: #f8fbff;
}
.rb-preference-card > p {
  margin: 0;
  color: var(--rb-muted);
  font-size: 11px;
  line-height:1.7;
}
.rb-theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.rb-theme-dot {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #b9c7d6;
  cursor: pointer;
}
.rb-theme-dot.active { box-shadow: 0 0 0 3px #9bb9df; }
.rb-theme-dot.graphite { background: linear-gradient(145deg,#4b4e54,#090a0c); }
.rb-theme-dot.blue { background: #2170ec; }
.rb-theme-dot.teal { background: #17086d; }
.rb-theme-dot.purple { background: #7652c7; }
.rb-theme-dot.amber { background: #b66a14; }
.rb-theme-dot.rose { background: #c24c73; }
.rb-theme-dot.indigo { background: #4f5fc7; }
.rb-theme-dot.emerald { background: #170866; }
.rb-theme-dot.slate { background: #52677d; }
.rb-theme-dot.coral { background: #c75f4c; }
.rb-theme-dot.sky { background: #1387b8; }

.rb-cross-role-busy {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 1.8fr);
  gap: 14px;
  max-width: 1540px;
  margin: 0 auto 18px;
  padding: 13px 15px;
  color: #344a63;
  background: #f5f7fa;
  border: 1px solid #d6dde6;
  border-radius: 13px;
}
.rb-cross-role-busy header strong,
.rb-cross-role-busy header small { display: block; }
.rb-cross-role-busy header small {
  margin-top: 4px;
  color: #708095;
  font-size: 10px;
  line-height: 1.45;
}
.rb-cross-role-busy > div {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}
.rb-cross-role-busy > div span {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 128px;
  padding: 8px 10px;
  color: #526274;
  background:
    repeating-linear-gradient(
      135deg,
      #fff 0,
      #fff 8px,
      #f0f3f6 8px,
      #f0f3f6 16px
    );
  border: 1px solid #d3dbe4;
  border-radius: 9px;
  font-size: 11px;
}
.rb-cross-role-busy > div b { color: #233b58; font-size: 10px; }

:root[data-rb-theme="graphite"] { --rb-navy:#090a0c; --rb-ink:#202226; --rb-muted:#666a70; --rb-line:#d7d9dc; --rb-blue:#34373c; --rb-blue-deep:#0b0c0e; --rb-canvas:#f3f4f5; --navy:#08090b; --navy-soft:#1c1e22; --ink:#202226; --muted:#686c72; --line:#d7d9dc; --canvas:#f3f4f5; --blue:#34373c; --blue-deep:#0b0c0e; }
:root[data-rb-theme="teal"] { --rb-blue:#17086d; --rb-blue-deep:#0d6f59; --blue:#17086d; --blue-deep:#0d6f59; }
:root[data-rb-theme="purple"] { --rb-blue:#7652c7; --rb-blue-deep:#5836a5; --blue:#7652c7; --blue-deep:#5836a5; }
:root[data-rb-theme="amber"] { --rb-blue:#b66a14; --rb-blue-deep:#8c4e0c; --blue:#b66a14; --blue-deep:#8c4e0c; }
:root[data-rb-theme="rose"] { --rb-blue:#c24c73; --rb-blue-deep:#9d3156; --blue:#c24c73; --blue-deep:#9d3156; }
:root[data-rb-theme="indigo"] { --rb-blue:#4f5fc7; --rb-blue-deep:#3746a8; --blue:#4f5fc7; --blue-deep:#3746a8; }
:root[data-rb-theme="emerald"] { --rb-blue:#170866; --rb-blue-deep:#0d6c50; --blue:#170866; --blue-deep:#0d6c50; }
:root[data-rb-theme="slate"] { --rb-blue:#52677d; --rb-blue-deep:#364a60; --blue:#52677d; --blue-deep:#364a60; }
:root[data-rb-theme="coral"] { --rb-blue:#c75f4c; --rb-blue-deep:#a34232; --blue:#c75f4c; --blue-deep:#a34232; }
:root[data-rb-theme="sky"] { --rb-blue:#1387b8; --rb-blue-deep:#09668e; --blue:#1387b8; --blue-deep:#09668e; }

@media (max-width: 720px) {
  .rb-cross-role-busy { grid-template-columns: 1fr; }
}

.rb-primary,
.rb-secondary,
.rb-link-button,
.rb-danger-button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}
.rb-primary { color: white; background: var(--rb-blue); box-shadow: 0 7px 18px rgba(33,103,236,.22); }
.rb-primary:hover { background: #1552d5; }
.rb-primary:disabled,
.rb-secondary:disabled { opacity: .55; cursor: wait; }
.rb-secondary { color: #28598f; border: 1px solid #b8cae0; background: #fff; }
.rb-secondary:hover { background: #f2f7ff; }
.rb-danger-button { color: white; background: var(--rb-danger); }
.rb-link-button { min-height: 32px; padding: 0; color: #175ac0; background: transparent; }

.rb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.rb-auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.rb-auth-note { margin: 16px 0 0; padding: 11px 12px; color: #61758c; border: 1px solid #d8e3ef; border-radius: 9px; background: #f8fbff; font-size: 11px; line-height: 1.55; }
.rb-data-warning { margin-top: 18px; padding: 13px 14px; color: #6b4b12; border: 1px solid #e7c777; border-radius: 11px; background: #fff9e8; font-size: 11px; line-height: 1.6; }
.rb-data-warning strong { display: block; color: #70490a; font-size: 12px; }
.rb-data-warning p { margin: 5px 0; }
.rb-data-warning small { display: block; color: #806c44; font-size: 9px; line-height: 1.5; }

.rb-message { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.rb-message.rb-error { color: #932018; border: 1px solid #f0b9b2; background: #fff2f0; }
.rb-message.rb-success { color: #136c55; border: 1px solid #aadbc9; background: #effbf6; }
.rb-message.rb-warning { color: #865914; border: 1px solid #edd19b; background: #fff9e9; }

.rb-account-button {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 5px 10px 5px 6px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  background: rgba(7,29,57,.94);
  box-shadow: 0 10px 30px rgba(7,29,57,.24);
  cursor: pointer;
  font: inherit;
}
.rb-account-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: #0b365f; background: #dff4ff; font-size: 11px; font-weight: 900; }
.rb-account-copy { min-width: 0; text-align: left; }
.rb-account-button strong { display: block; max-width: 170px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rb-account-button small { display: block; color: #bcd3eb; font-size: 9px; }
.rb-sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #2ad7af; box-shadow: 0 0 0 4px rgba(42,215,175,.14); }
.rb-sync-dot[data-status="saving"] { background: #f3b640; }
.rb-sync-dot[data-status="offline"],
.rb-sync-dot[data-status="conflict"],
.rb-sync-dot[data-status="paused"] { background: #ef6155; }
.rb-sync-toast { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; z-index: 2147483000; display: flex; align-items: center; gap: 9px; min-height: 40px; max-width: calc(100vw - 116px); padding: 8px 14px; pointer-events: none; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(7,29,57,.94); box-shadow: 0 10px 35px rgba(7,29,57,.23); opacity: 0; transform: translate(-50%, -14px); transition: opacity .9s ease, transform .9s ease; }
.rb-sync-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.rb-sync-toast strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rb-sync-toast.persistent { pointer-events: auto; }

.rb-download-portal-active { background: #eef4fb; }
.rb-download-portal-active body { min-height: 100vh; margin: 0; color: #170756; background: radial-gradient(circle at 82% 8%, #dceeff 0, transparent 31%), linear-gradient(155deg,#f7fbff,#eaf2fa); font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC",sans-serif; }
.rb-portal { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 26px; }
.rb-portal-hero { padding: clamp(24px,5vw,54px); border: 1px solid #cbdced; border-radius: 26px; background: rgba(255,255,255,.93); box-shadow: 0 24px 70px rgba(22,61,99,.12); }
.rb-portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rb-portal-brand { display: flex; align-items: center; gap: 9px; color: #175f6d; }
.rb-portal-brand > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(145deg,#2170ec,#114dbb); font-weight: 900; }
.rb-portal-brand strong { font-size: 14px; }
.rb-portal-brand small { margin-left: auto; padding: 5px 8px; border-radius: 99px; color: #1e64b9; background: #eaf3ff; font-size: 10px; font-weight: 800; }
.rb-portal-copy { max-width: 760px; margin-top: 45px; }
.rb-portal-kicker { color: #2370ce; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.rb-portal-copy h1 { margin: 11px 0 12px; color: #0d2d50; font-size: clamp(34px,6vw,62px); letter-spacing: -.045em; line-height: 1.02; }
.rb-portal-copy p { margin: 0; color: #617891; font-size: clamp(15px,2vw,19px); line-height: 1.7; }
.rb-portal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.rb-portal-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 19px; border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 850; }
.rb-portal-primary { color: #fff; background: #2170ec; box-shadow: 0 10px 25px rgba(33,103,236,.25); }
.rb-portal-participant { color: #fff; background: #246d5b; box-shadow: 0 10px 25px rgba(36,109,91,.23); }
.rb-portal-secondary { color: #235689; border: 1px solid #b8cee5; background: #f7fbff; }
.rb-portal-device-note { margin: 17px 0 0; color: #6b7e90; font-size: 11px; line-height: 1.6; }
.rb-portal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin-top: 15px; }
.rb-portal-grid article { padding: 20px; border: 1px solid #ceddeb; border-radius: 16px; background: rgba(255,255,255,.82); }
.rb-portal-grid b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #1759ae; background: #e5efff; font-size: 11px; }
.rb-portal-grid h2 { margin: 14px 0 6px; color: #175a61; font-size: 15px; }
.rb-portal-grid p { margin: 0; color: #6a7e91; font-size: 11px; line-height:1.7; }
.rb-role-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.rb-role-choice-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 92px; padding: 18px; border: 1px solid #ceddeb; border-radius: 16px; color: inherit; background: rgba(255,255,255,.9); text-decoration: none; box-shadow: 0 9px 24px rgba(22,61,99,.07); transition: transform .16s ease,border-color .16s ease,box-shadow .16s ease; }
.rb-role-choice-card:hover { transform: translateY(-2px); border-color: #7eaddd; box-shadow: 0 14px 30px rgba(22,61,99,.13); }
.rb-role-choice-card b { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }
.rb-role-choice-card h2 { margin: 0 0 4px; }
.rb-role-choice-card i { color: #4f77a1; font-size: 28px; font-style: normal; }
.rb-role-chooser { max-width: 880px; }
.rb-role-chooser-head { padding: 28px 32px; }
.rb-role-chooser-head .rb-portal-copy { margin-top: 28px; }
.rb-role-chooser-head .rb-portal-copy h1 { margin-bottom: 0; font-size: clamp(30px,5vw,48px); }
.rb-role-chooser .rb-role-choice-grid { margin-top: 14px; }
.rb-portal-notice { margin-top: 15px; padding: 22px 24px; border: 1px solid #ead28d; border-radius: 16px; color: #65501f; background: #fffaf0; }
.rb-portal-notice h2 { margin: 0 0 10px; font-size: 15px; }
.rb-portal-notice ul { display: grid; gap: 6px; margin: 0; padding-left: 20px; font-size: 11px; line-height:1.7; }
.rb-portal-footer { display: flex; justify-content: space-between; gap: 14px; padding: 20px 4px 0; color: #71849a; font-size: 10px; }
.rb-portal-footer a { color: #2862a4; text-decoration: none; font-weight: 800; }
.rb-public-entry { min-height: 100dvh; display: grid; place-items: center; padding-block: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-bottom)); }
.rb-public-entry-card { width: min(680px,100%); }
.rb-public-entry-card .rb-portal-copy { margin-top: 34px; }
.rb-public-entry-card .rb-portal-copy h1 { margin-bottom: 0; font-size: clamp(32px,5vw,48px); }
.rb-public-entry-card .rb-portal-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.rb-public-entry-card .rb-portal-actions .rb-portal-participant { grid-column: 1/-1; }
.rb-download-account { display: inline-flex; gap: 5px; margin: 22px 0 0; padding: 8px 11px; border-radius: 9px; color: #4e6884; background: #f0f6fd; font-size: 10px; }
.rb-device-downloads { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-top: 15px; }
.rb-device-card { display: flex; flex-direction: column; min-height: 420px; padding: 26px; border: 1px solid #cdddea; border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: 0 12px 34px rgba(22,61,99,.08); }
.rb-device-card.rb-device-android { border-color: #b9ddcf; background: linear-gradient(150deg,#fff,#f1fbf6); }
.rb-device-tag { align-self: flex-start; padding: 5px 8px; border-radius: 99px; color: #1f65b8; background: #e8f2ff; font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.rb-device-android .rb-device-tag { color: #197052; background: #dff5ea; }
.rb-device-card h2 { margin: 18px 0 8px; color: #153a61; font-size: 22px; }
.rb-device-card p { margin: 0; color: #61788f; font-size: 12px; line-height: 1.7; }
.rb-device-card ol { display: grid; gap: 7px; margin: 20px 0; padding-left: 21px; color: #526d87; font-size: 11px; line-height: 1.55; }
.rb-device-card > a { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: auto; padding: 0 16px; border-radius: 11px; text-align: center; text-decoration: none; font-size: 12px; font-weight: 850; }
.rb-device-card > small { margin-top: 11px; color: #688077; font-size: 9px; line-height: 1.55; }
.rb-footer-button { padding: 0; border: 0; color: #2862a4; background: transparent; cursor: pointer; font: inherit; font-weight: 800; }

.rb-admin-portal { width: min(1180px, calc(100% - 32px)); }
.rb-admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 30px; color: #175a61; border: 1px solid #cbdced; border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 18px 55px rgba(22,61,99,.1); }
.rb-admin-head h1 { margin: 8px 0 6px; color: #0d2d50; font-size: clamp(28px,4vw,44px); letter-spacing: -.035em; }
.rb-admin-head p { max-width: 760px; margin: 0; color: #617891; font-size: 12px; line-height: 1.7; }
.rb-admin-actions { display: flex; flex: none; gap: 8px; }
.rb-admin-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.rb-admin-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.rb-admin-metrics article { padding: 20px; border: 1px solid #cfdeeb; border-radius: 16px; background: rgba(255,255,255,.9); }
.rb-admin-metrics span { display: block; color: #667d93; font-size: 10px; font-weight: 800; }
.rb-admin-metrics strong { display: block; margin-top: 7px; color: #143d70; font-size: 30px; line-height: 1.1; }
.rb-admin-metrics strong.rb-admin-ok { color: #127158; font-size: 20px; }
.rb-admin-metrics small { display: block; margin-top: 6px; color: #72869a; font-size: 9px; }
.rb-admin-service { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 14px; padding: 13px 16px; color: #5e748a; border: 1px solid #d5e1ec; border-radius: 13px; background: rgba(255,255,255,.78); font-size: 10px; }
.rb-admin-service span { display: inline-flex; align-items: center; gap: 6px; }
.rb-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aaaba; }
.rb-status-online { background: #20a77e; box-shadow: 0 0 0 3px rgba(32,170,126,.12); }
.rb-status-offline { background: #d99029; box-shadow: 0 0 0 3px rgba(217,144,41,.12); }
.rb-admin-table-card { margin-top: 14px; overflow: hidden; border: 1px solid #cfddea; border-radius: 17px; background: rgba(255,255,255,.94); }
.rb-admin-table-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #dae4ee; }
.rb-admin-table-title h2 { margin: 0; color: #175a61; font-size: 16px; }
.rb-admin-table-title small { color: #708399; font-size: 9px; }
.rb-admin-table-wrap { overflow-x: auto; }
.rb-admin-table { width: 100%; border-collapse: collapse; color: #405a73; font-size: 10px; }
.rb-admin-table th { padding: 11px 14px; text-align: left; color: #6b8095; background: #f5f8fb; font-size: 9px; white-space: nowrap; }
.rb-admin-table td { padding: 13px 14px; border-top: 1px solid #e4ebf2; white-space: nowrap; }
.rb-admin-table td strong { color: #244b72; font-size: 11px; }
.rb-online-badge { display: inline-flex; align-items: center; gap: 6px; min-width: 52px; padding: 5px 8px; border-radius: 99px; font-weight: 850; }
.rb-online-badge b { width: 7px; height: 7px; border-radius: 50%; }
.rb-online-badge.online { color: #11704f; background: #e3f7ef; }
.rb-online-badge.online b { background: #20a77e; box-shadow: 0 0 0 3px rgba(32,170,126,.12); }
.rb-online-badge.offline { color: #6e7e8e; background: #eef2f5; }
.rb-online-badge.offline b { background: #9aabba; }
.rb-admin-empty { padding: 32px !important; text-align: center; color: #71859a; }

.rb-tabs { display: flex; gap: 5px; margin: 20px 0 16px; padding: 4px; overflow-x: auto; border-radius: 11px; background: #eef4fa; }
.rb-tabs button { min-height: 34px; padding: 0 11px; color: #5c718d; border: 0; border-radius: 8px; background: transparent; cursor: pointer; white-space: nowrap; font: inherit; font-size: 11px; font-weight: 750; }
.rb-tabs button.active { color: #1856b3; background: white; box-shadow: 0 3px 10px rgba(25,55,91,.08); }
.rb-identity-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 13px 0;
  padding: 11px 12px;
  border: 1px solid #d8e3ef;
  border-radius: 11px;
  background: #f8fbff;
}
.rb-identity-switch > strong { color: #48627e; font-size: 10px; }
.rb-identity-switch > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.rb-identity-switch button {
  min-height: 30px;
  padding: 0 9px;
  color: #28547d;
  border: 1px solid #cddceb;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}
.rb-identity-switch button.active { color: white; border-color: #2170ec; background: #2170ec; }
.rb-panel-section { display: grid; gap: 12px; }
.rb-panel-section h3 { margin: 4px 0 0; color: #183453; font-size: 14px; }
.rb-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-info-card { padding: 13px; border: 1px solid #d8e3ef; border-radius: 11px; background: #f8fbff; }
.rb-info-card strong { display: block; font-size: 12px; }
.rb-info-card small { display: block; margin-top: 4px; color: var(--rb-muted); font-size: 10px; line-height: 1.5; }

.rb-list { display: grid; gap: 8px; }
.rb-list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #dbe4ef; border-radius: 10px; background: white; }
.rb-list-item strong { display: block; font-size: 12px; }
.rb-list-item small { display: block; margin-top: 3px; color: var(--rb-muted); font-size: 9px; }
.rb-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; color: #1758b5; border-radius: 99px; background: #e9f1ff; font-size: 9px; font-weight: 800; }
.rb-item-actions { display: flex; align-items: center; gap: 7px; }
.rb-item-actions button { min-height: 29px; padding: 0 9px; color: #8d2a22; border: 1px solid #ecc6c2; border-radius: 7px; background: #fff7f6; cursor: pointer; font: inherit; font-size: 9px; font-weight: 700; }

.rb-conflict-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.rb-choice { display: grid; align-content: start; gap: 7px; min-height: 150px; padding: 16px; text-align: left; border: 1px solid #cbd9e9; border-radius: 13px; background: #f9fbfe; cursor: pointer; }
.rb-choice:hover { border-color: #73a0e2; background: #f2f7ff; }
.rb-choice strong { color: #143d70; font-size: 14px; }
.rb-choice small { color: var(--rb-muted); font-size: 11px; line-height: 1.55; }
.rb-choice.recommended {
  border-color: #2a77d4;
  background: #edf5ff;
  box-shadow: 0 0 0 2px rgba(42,119,212,.12);
}
.rb-choice strong em {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: #2a77d4;
  font-size: 9px;
  font-style: normal;
}
.rb-copy-field { display: flex; gap: 8px; }
.rb-copy-field input { flex: 1; min-width: 0; }
.rb-short-code { margin: 16px 0; padding: 18px; border: 1px solid #a8cabe; border-radius: 13px; color: #1f624f; background: #ecf8f3; text-align: center; font: 900 30px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .14em; }
.rb-panel-copy { margin: 0; color: var(--rb-muted); font-size: 11px; line-height:1.7; }
.rb-participant-code-item { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.rb-response-code { grid-column: 1/-1; width: 100%; min-height: 72px; padding: 9px; border: 1px solid #d3dfeb; border-radius: 8px; color: #52677e; background: #f7faff; font: 9px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; resize: vertical; }
.rb-copy-response-button { color: #175d4c !important; border-color: #add4c7 !important; background: #eef9f5 !important; }

.rb-loading { display: flex; align-items: center; gap: 10px; color: var(--rb-muted); }
.rb-spinner { width: 20px; height: 20px; border: 3px solid #dbe5f0; border-top-color: var(--rb-blue); border-radius: 50%; animation: rb-spin .8s linear infinite; }
@keyframes rb-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .rb-auth-shell, .rb-modal-shell {
    align-items: start;
    min-height: 100dvh;
    padding: max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  }
  .rb-auth-card, .rb-modal-card { width:100%; margin-top: 0; padding: 18px 16px; border-radius: 16px; }
  .rb-auth-card-minimal { margin-block:auto; }
  .rb-auth-brand-row { align-items:center; gap:8px; margin-bottom:18px; }
  .rb-brand { min-width:0; gap:9px; }
  .rb-brand-mark { width:40px; height:40px; flex:0 0 40px; border-radius:12px; }
  .rb-brand strong { font-size:15px; }
  .rb-brand small { font-size:9px; }
  .rb-auth-language { min-width:0; max-width:42%; }
  .rb-auth-language select { width:100%; max-width:100%; min-height:40px; padding-inline:8px 24px; font-size:10px; }
  .rb-auth-card h1 { font-size:24px; }
  .rb-auth-card-minimal h1 { margin-bottom:18px; }
  .rb-field input,.rb-field select { height:48px; font-size:16px; }
  .rb-primary,.rb-secondary,.rb-danger-button { min-height:48px; }
  .rb-auth-links { align-items:center; flex-wrap:wrap; margin-top:14px; }
  .rb-form-row, .rb-panel-grid, .rb-conflict-choices { grid-template-columns: 1fr; }
  .rb-account-button { top: max(9px, env(safe-area-inset-top)); right: 9px; width: 40px; padding: 5px; border-radius: 12px; }
  .rb-account-copy { display: none; }
  .rb-account-avatar { width: 28px; height: 28px; }
  .rb-sync-toast { top: max(9px, env(safe-area-inset-top)); max-width: calc(100vw - 110px); min-height: 40px; padding: 7px 12px; }
  .rb-portal { width: min(100% - 20px, 1080px); padding: max(8px,env(safe-area-inset-top)) 0 max(16px,env(safe-area-inset-bottom)); }
  .rb-portal-hero { padding: 22px 18px; border-radius: 18px; }
  .rb-portal-copy { margin-top: 34px; }
  .rb-portal-actions { display: grid; }
  .rb-portal-actions a { width: 100%; }
  .rb-public-entry { width: min(100% - 20px,680px); padding-block: max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-bottom)); }
  .rb-public-entry-card { padding: 20px 17px; }
  .rb-public-entry-card .rb-portal-copy { margin-top: 26px; }
  .rb-public-entry-card .rb-portal-copy h1 { font-size: 30px; }
  .rb-public-entry-card .rb-portal-actions { grid-template-columns: 1fr; margin-top: 22px; }
  .rb-public-entry-card .rb-portal-actions .rb-portal-participant { grid-column: auto; }
  .rb-portal-grid { grid-template-columns: 1fr; }
  .rb-role-choice-grid { grid-template-columns: 1fr; }
  .rb-role-chooser { width:min(100% - 16px,880px); }
  .rb-role-chooser-head { padding:16px; border-radius:17px; }
  .rb-role-chooser-head .rb-portal-head { align-items:center; }
  .rb-role-chooser-head .rb-portal-copy { margin-top:22px; }
  .rb-role-chooser-head .rb-portal-copy h1 { font-size:30px; }
  .rb-role-chooser .rb-role-choice-grid { gap:9px; margin-top:10px; }
  .rb-role-choice-card { grid-template-columns:42px minmax(0,1fr) 22px; min-height:66px; padding:11px 13px; border-radius:14px; }
  .rb-role-choice-card h2 { margin:0; font-size:15px; }
  .rb-role-choice-card i { font-size:24px; }
  .rb-device-downloads { grid-template-columns: 1fr; }
  .rb-device-card { min-height: 0; padding: 21px 18px; border-radius: 17px; }
  .rb-device-card > a { margin-top: 16px; }
  .rb-portal-notice { padding: 18px; }
  .rb-admin-portal { width: min(100% - 20px, 1180px); }
  .rb-admin-head { display: grid; align-items: start; padding: 22px 18px; border-radius: 17px; }
  .rb-admin-actions { width: 100%; }
  .rb-admin-actions button,
  .rb-admin-actions a { flex: 1; }
  .rb-admin-metrics { grid-template-columns: 1fr 1fr; }
  .rb-admin-metrics article { padding: 16px; }
  .rb-admin-table-title { display: grid; }
  .rb-identity-switch { align-items: flex-start; flex-direction: column; }
  .rb-identity-switch > div { justify-content: flex-start; }
}

.rb-sync-centre-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.rb-sync-centre-heading h3 { margin: 0; }
.rb-sync-centre-heading p {
  max-width: 660px;
  margin: 5px 0 0;
  color: #627990;
  font-size: 12px;
  line-height:1.7;
}
.rb-device-manager {
  display: grid;
  gap: 11px;
  margin: 4px 0 8px;
  padding: 15px;
  border: 1px solid #bfd4e7;
  border-radius: 14px;
  background: #f4f9ff;
}
.rb-device-manager > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.rb-device-manager > header h3 { margin: 0; }
.rb-device-manager > header p { max-width: 650px; margin: 5px 0 0; color: #607991; font-size: 10px; line-height: 1.6; }
.rb-device-manager > header > span { flex:none; max-width:240px; overflow:hidden; padding:6px 9px; border-radius:999px; color:#155b9f; background:#e5f1ff; font-size:9px; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.rb-device-list { display: grid; gap: 9px; }
.rb-device-row {
  display: grid;
  grid-template-columns: minmax(150px,1.2fr) minmax(130px,1fr) minmax(170px,1.2fr) auto;
  align-items: end;
  gap: 9px;
  padding: 11px;
  border: 1px solid #d2e1ef;
  border-radius: 11px;
  background: #fff;
}
.rb-device-identity { display: grid; align-content: center; gap: 3px; min-width: 0; }
.rb-device-identity strong { overflow: hidden; color: #244d75; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rb-device-identity small { color: #70859a; font-size: 8px; line-height: 1.45; }
.rb-device-identity span { width: fit-content; padding: 3px 7px; border-radius: 999px; color: #17614e; background: #e7f7f1; font-size: 8px; font-weight: 800; }
.rb-device-row label { display: grid; gap: 5px; color: #59728a; font-size: 8px; font-weight: 800; }
.rb-device-row input,.rb-device-row select { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #c9d8e7; border-radius: 8px; color: #294b6e; background: #fff; font: inherit; font-size: 10px; }
.rb-device-actions { display: flex; align-items: center; gap: 6px; }
.rb-device-actions button { min-height: 38px; white-space: nowrap; }
.rb-device-policy-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 5px; }
.rb-device-policy-options .rb-choice { min-height: 112px; padding: 13px; }
.rb-device-policy-options .rb-choice:last-child { grid-column: 1/-1; min-height: 88px; }
.rb-sync-comparison {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 17px 0;
}
.rb-sync-comparison article {
  display: grid;
  gap: 5px;
  min-height: 102px;
  padding: 13px;
  background: #f6f9fc;
  border: 1px solid #d6e1eb;
  border-radius: 12px;
}
.rb-sync-comparison article.selected {
  color: #145c4b;
  background: #ecf9f5;
  border-color: #a9d8c9;
}
.rb-sync-comparison small {
  color: #688097;
  font-size: 10px;
  font-weight: 800;
}
.rb-sync-comparison strong { font-size: 13px; line-height: 1.45; }
.rb-sync-comparison span { color: #647a90; font-size: 10px; }
.rb-sync-metrics,
.rb-sync-undo {
  padding: 15px;
  background: #f8fbfd;
  border: 1px solid #d5e1eb;
  border-radius: 13px;
}
.rb-sync-metrics header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rb-sync-metrics header small { color: #6c8195; }
.rb-sync-metrics > div:not(.rb-sync-difference) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.rb-sync-metrics > div > span {
  display: grid;
  gap: 4px;
  padding: 9px;
  color: #687f95;
  background: white;
  border: 1px solid #dbe4ec;
  border-radius: 9px;
  font-size: 9px;
}
.rb-sync-metrics > div > span b {
  color: #244d75;
  font-size: 14px;
}
.rb-sync-difference {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.rb-sync-difference span {
  padding: 5px 8px !important;
  color: #4f6880 !important;
  background: #edf3f8 !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 9px !important;
}
.rb-sync-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 17px;
}
.rb-sync-undo strong { font-size: 13px; }
.rb-sync-undo p {
  max-width: 620px;
  margin: 4px 0 0;
  color: #647a90;
  font-size: 10px;
  line-height: 1.55;
}
.rb-sync-undo button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.rb-recovery-centre > h3 { margin-top: 19px; }
.rb-recovery-centre .rb-list-item { align-items: flex-start; }
.rb-recovery-centre .rb-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.rb-recovery-centre .rb-item-actions button { min-height: 34px; }
.rb-activity-list .rb-list-item small + small { margin-top: 3px; }
.rb-time-preview-card { width: min(820px, calc(100vw - 28px)); }
.rb-time-preview-head,
.rb-time-preview-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.rb-time-preview-head { margin: 14px 0 7px; }
.rb-time-preview-head > span {
  display: grid;
  gap: 3px;
  color: #244d75;
  font-size: 12px;
  font-weight: 850;
}
.rb-time-preview-head small { color: #6b7f92; font-size: 9px; font-weight: 650; }
.rb-time-preview-list {
  display: grid;
  max-height: min(46vh, 440px);
  margin-bottom: 10px;
  overflow: auto;
  border: 1px solid #d8e3eb;
  border-radius: 13px;
  background: #f8fbfd;
}
.rb-time-preview-list > div {
  position: relative;
  padding: 10px 12px 10px 34px;
  border-bottom: 1px solid #e1e9ef;
}
.rb-time-preview-list > div:last-child { border-bottom: 0; }
.rb-time-preview-list > div > b {
  position: absolute;
  top: 12px;
  left: 12px;
  color: #7a8d9e;
  font-size: 10px;
}
.rb-time-preview-list span { display: grid; gap: 2px; color: #294a65; font-size: 11px; }
.rb-time-preview-list span small { color: #728697; font-size: 9px; }
@media (max-width: 680px) {
  .rb-sync-centre-heading,
  .rb-sync-undo {
    align-items: stretch;
    flex-direction: column;
  }
  .rb-sync-comparison { grid-template-columns: 1fr; }
  .rb-device-manager > header { flex-direction: column; }
  .rb-device-manager > header > span { max-width: 100%; }
  .rb-device-row { grid-template-columns: 1fr; align-items: stretch; }
  .rb-device-actions button { flex: 1; }
  .rb-device-policy-options { grid-template-columns: 1fr; }
  .rb-device-policy-options .rb-choice:last-child { grid-column: auto; }
  .rb-sync-metrics > div:not(.rb-sync-difference) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rb-recovery-centre .rb-item-actions {
    width: 100%;
    justify-content: stretch;
  }
  .rb-recovery-centre .rb-item-actions button { flex: 1; }
  .rb-time-preview-head,
  .rb-time-preview-list > div { grid-template-columns: 1fr; }
}

/* ResearchBook 1.57 account calendar actions: keep import/export inside Account & sync. */
.rb-account-calendar-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 14px;padding:10px 0;border-top:1px solid rgba(116,141,170,.18);border-bottom:1px solid rgba(116,141,170,.18)}
.rb-account-calendar-actions .rb-secondary{min-height:36px;padding:8px 12px}
.rb-account-preferences{margin:10px 0;padding:4px 0;border-top:1px solid rgba(116,141,170,.18);border-bottom:1px solid rgba(116,141,170,.18)}
.rb-account-preferences>button{display:grid;grid-template-columns:36px minmax(0,1fr) 18px;align-items:center;gap:10px;width:100%;min-height:56px;padding:7px 10px;color:#203e60;text-align:left;background:#f8fbff;border:1px solid #cfdae7;border-radius:11px;cursor:pointer}
.rb-account-preferences>button:hover{color:#154f9f;background:#eef5ff;border-color:#8eafe0}
.rb-account-preferences>button>span:nth-child(2){display:grid;gap:2px;min-width:0}
.rb-account-preferences strong{font-size:12px}.rb-account-preferences small{color:#586f89;font-size:10px}.rb-account-preferences small b{color:inherit}.rb-account-preferences i{color:#5b718a;font-size:23px;font-style:normal;font-weight:350}
.rb-account-preference-icon{display:grid;place-items:center;width:34px;height:34px;color:#175fc4;background:#e6efff;border-radius:10px;font-size:18px;font-weight:800}


/* ResearchBook 1.99 — researcher account panel owns its scroll on mobile. */
html.rb-account-panel-open,
html.rb-account-panel-open body{overscroll-behavior:none!important}
#rb-account-panel.rb-modal-shell{
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
}
#rb-account-panel .rb-modal-card{
  max-height:calc(100vh - 24px)!important;
  max-height:calc(100dvh - 24px)!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
}
@media (max-width:720px){
  #rb-account-panel.rb-modal-shell{
    place-items:stretch center!important;
    padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom))!important;
    overflow:hidden!important;
  }
  #rb-account-panel .rb-modal-card{
    width:100%!important;
    max-height:100%!important;
  }
}
