/* App shell: page column, large titles, the back-navigation bar, flash messages, the bottom
   tab bar with its raised ＋ button, and the Add-to-Home-Screen tip. */

.rh-shell-main {
  max-width: var(--rh-max-width);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--rh-space-3)) var(--rh-space-4)
    calc(env(safe-area-inset-bottom) + var(--rh-tabbar-h) + 48px);
}

.rh-shell-title {
  font-size: var(--rh-text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: var(--rh-space-3) 0 var(--rh-space-1);
}

.rh-shell-subtitle {
  color: var(--rh-color-muted);
  font-size: var(--rh-text-s);
  margin-bottom: var(--rh-space-2);
}

.rh-shell-navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--rh-tap);
  margin: 0 calc(-1 * var(--rh-space-1)) var(--rh-space-2);
}

.rh-shell-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--rh-text-m);
  min-height: var(--rh-tap);
}

.rh-shell-back .rh-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

.rh-shell-navbar-title {
  font-weight: 700;
  font-size: var(--rh-text-m);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.rh-shell-navbar-end {
  justify-self: end;
}

.rh-shell-flash {
  margin: var(--rh-space-3) 0;
  padding: var(--rh-space-3) var(--rh-space-4);
  border-radius: var(--rh-radius-m);
  background: var(--rh-color-ok-bg);
  color: var(--rh-color-ok);
  font-weight: 600;
  font-size: var(--rh-text-s);
  animation: rh-shell-drop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rh-shell-flash--error {
  background: var(--rh-color-alert-bg);
  color: var(--rh-color-alert);
}

@keyframes rh-shell-drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* Bottom tab bar */
.rh-shell-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
  padding: 6px max(8px, env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 6px);
  min-height: var(--rh-tabbar-h);
  background: var(--rh-color-bar);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--rh-color-border);
}

.rh-shell-tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--rh-color-muted);
}

.rh-body .rh-shell-tab {
  color: var(--rh-color-muted);
}

.rh-body .rh-shell-tab.is-active,
.rh-body .rh-shell-tab:hover,
.rh-body .rh-shell-tab:active,
.rh-body .rh-shell-tab:focus-visible {
  color: var(--rh-color-primary);
}

.rh-shell-tab-icon {
  position: relative;
  display: grid;
}

.rh-shell-tab-icon .rh-icon {
  width: 25px;
  height: 25px;
}

.rh-shell-tab-badge {
  position: absolute;
  top: -5px;
  left: 16px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--rh-radius-pill);
  background: var(--rh-color-accent);
  color: var(--rh-color-accent-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.rh-body .rh-shell-plus {
  justify-self: center;
  width: 54px;
  height: 54px;
  margin-top: -16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rh-color-accent);
  color: var(--rh-color-accent-ink);
  box-shadow: var(--rh-shadow-float);
}

.rh-shell-plus .rh-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
}

.rh-shell-plus:active {
  transform: scale(0.94);
}

/* Add-to-Home-Screen tip (public/js/install-tip.js reveals it in Safari only) */
.rh-shell-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--rh-space-3);
  align-items: center;
  margin: var(--rh-space-3) 0;
  padding: var(--rh-space-3) var(--rh-space-4);
  border-radius: var(--rh-radius-m);
  background: var(--rh-color-wait-bg);
  color: var(--rh-color-wait);
  font-size: var(--rh-text-s);
}

.rh-shell-tip[hidden] {
  display: none;
}

.rh-shell-tip button {
  border: 0;
  background: none;
  color: inherit;
  padding: var(--rh-space-1);
  cursor: pointer;
}

.rh-shell-meta {
  margin-top: var(--rh-space-5);
  text-align: center;
  color: var(--rh-color-muted);
  font-size: var(--rh-text-xs);
}

/* Sign-in screen */
.rh-login {
  max-width: 420px;
  margin: 12vh auto 0;
  text-align: center;
}

.rh-login img {
  border-radius: 16px;
}

.rh-login .rh-form {
  margin-top: var(--rh-space-5);
  text-align: left;
}
