/* Currency chip (right-center) + clickable scrollable sidebar */

#rcy-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}
#rcy-root:not(.is-open) {
  inset: auto;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  overflow: visible;
}
#rcy-root.is-open {
  pointer-events: none;
}
#rcy-root > * {
  pointer-events: auto;
}

.rcy-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2147483001;
  width: auto;
  min-width: 3.35rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem 0.55rem 0.7rem;
  border: 1px solid rgba(14, 17, 22, 0.12);
  border-right: 0;
  border-radius: 0.85rem 0 0 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #fff;
  color: #0e1116;
  box-shadow: -6px 8px 28px rgba(14, 17, 22, 0.12);
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.rcy-fab:hover {
  box-shadow: -10px 10px 32px rgba(14, 17, 22, 0.16);
}
.rcy-fab.is-hidden {
  visibility: hidden;
  pointer-events: none !important;
  z-index: 0;
}
.rcy-fab__sym {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: #0e1116;
}
.rcy-fab__code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0e1116;
  opacity: 0.72;
  line-height: 1;
  white-space: nowrap;
}

.rcy-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(14, 17, 22, 0.45);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: none;
  pointer-events: auto;
}
.rcy-backdrop.is-open {
  display: block;
}

.rcy-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: min(23rem, 92vw);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0e1116;
  box-shadow: -18px 0 50px rgba(5, 11, 31, 0.28);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}
.rcy-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.rcy-panel__head {
  flex: 0 0 auto;
  padding: 1.05rem 1.1rem 0.85rem;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
}
.rcy-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.rcy-panel__kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
}
.rcy-panel__title {
  margin: 0.2rem 0 0;
  font-family: "Plus Jakarta Sans", "DM Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.rcy-close {
  border: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #0e1116;
  font-size: 1.05rem;
  cursor: pointer;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}
.rcy-search {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  font: 600 0.9rem/1.2 "DM Sans", system-ui;
  color: #0e1116;
  background: #fff;
  outline: none;
  position: relative;
  z-index: 2;
}
.rcy-search:focus {
  border-color: #132a8e;
  box-shadow: 0 0 0 3px rgba(19, 42, 142, 0.1);
}

/* Scrollable currency list — height:0 + flex-grow is the reliable flex scroll trick */
.rcy-list {
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0.45rem 0.55rem 1.5rem;
  position: relative;
  z-index: 2;
  background: #fff;
}

/* Strict one-line rows: [sym] Country · CODE */
.rcy-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 0.72rem 0.65rem;
  border-radius: 0.85rem;
  cursor: pointer;
  font: inherit;
  color: #0e1116;
  position: relative;
  z-index: 3;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto;
  touch-action: pan-y;
  box-sizing: border-box;
}
.rcy-item:hover {
  background: #f3f4f6;
}
.rcy-item.is-active {
  background: #eef2ff;
  outline: 1.5px solid rgba(19, 42, 142, 0.22);
}
.rcy-item.is-default {
  border: 1.5px solid rgba(19, 42, 142, 0.28);
  background: #f8faff;
  margin-bottom: 0.45rem;
}
.rcy-item__sym {
  flex: 0 0 auto;
  min-width: 2.6rem;
  max-width: 3.6rem;
  height: 2.2rem;
  padding: 0 0.4rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0e1116;
  pointer-events: none;
  box-sizing: border-box;
}
.rcy-item__line {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0e1116;
  line-height: 1.2;
  pointer-events: none;
}
.rcy-item__sep {
  color: #9ca3af;
  font-weight: 600;
}
.rcy-item__code {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  white-space: nowrap;
  pointer-events: none;
}

html.rcy-sidebar-open,
html.rcy-sidebar-open body {
  overflow: hidden !important;
}

@media (min-width: 900px) {
  .rcy-panel { width: 26rem; }
  .rcy-fab { min-width: 3.6rem; min-height: 2.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rcy-panel { transition: none; }
}
