.token-portal-shell {
  --token-portal-header-height: 72px;
  --token-portal-rail-width: 200px;
  --tp-ink: #17171e;
  --tp-muted: #62626b;
  --tp-line: #e8e8ec;
  --tp-accent: #345de9;
  min-height: 100vh;
  color: var(--tp-ink);
  background: #fff;
  font: 14px / 1.5 Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei, Arial, sans-serif;
}

body:has(.token-portal-shell) {
  overflow-x: clip;
}

html:has(.token-portal-shell) {
  overflow-x: clip;
}

.token-portal-shell [hidden] {
  display: none !important;
}

.token-portal-shell :is(a, button):focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: 3px;
}

.tp-skip {
  z-index: 100;
  border: 1px solid var(--tp-accent);
  background: #fff;
  padding: 10px 16px;
  position: fixed;
  top: -70px;
  left: 12px;
}

.tp-skip:focus {
  top: 8px;
}

.tp-header {
  z-index: 30;
  height: var(--token-portal-header-height);
  background: #fff;
  padding-right: 28px;
  position: fixed;
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
}

.tp-header, .tp-identity {
  align-items: center;
  display: flex;
}

.tp-identity {
  flex: 0 0 200px;
  padding-left: 14px;
}

.tp-identity > .tp-divider {
  background: #f0f0f2;
  height: 24px;
  margin-right: 13px;
}

.tp-divider {
  background: var(--tp-line);
  flex: 0 0 1px;
  height: 19px;
}

.tp-account-trigger, .tp-brand, .tp-site-link {
  align-items: center;
  display: inline-flex;
}

.tp-brand img {
  width: auto;
  height: 23px;
}

.tp-brand {
  white-space: nowrap;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.tp-icon-button {
  color: #55565e;
  border-radius: 50%;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  display: inline-grid;
}

.tp-icon-button svg {
  stroke-width: 1.55px;
  width: 17px;
  height: 17px;
}

.tp-icon-button:hover {
  color: var(--tp-ink);
  background: #f3f3f5;
}

.tp-menu-button {
  color: #888990;
  width: 24px;
  margin-right: 9px;
}

.tp-menu-button svg {
  width: 22px;
  height: 22px;
}

.tp-global-nav {
  white-space: nowrap;
  align-items: center;
  gap: 38px;
  height: 100%;
  margin-left: 48px;
  display: flex;
}

.tp-global-nav > a, .tp-top-trigger {
  color: var(--tp-muted);
  align-items: center;
  gap: 5px;
  font-weight: 500;
  display: inline-flex;
}

.tp-global-nav > a {
  height: 100%;
}

.tp-global-nav > a:hover, .tp-global-nav > a[aria-current], .tp-top-trigger[aria-current] {
  color: var(--tp-accent);
}

.tp-top-menu {
  align-items: center;
  height: 100%;
  display: flex;
  position: relative;
}

.tp-top-trigger {
  border-radius: 19px;
  height: 34px;
  margin: 0 -9px;
  padding: 3px 9px;
}

.tp-top-trigger[aria-expanded="true"] {
  color: var(--tp-ink);
  background: #f5f5f6;
}

.tp-site-link svg, .tp-site-menu-link svg, .tp-top-trigger svg {
  stroke-width: 1.6px;
  width: 12px;
  height: 12px;
}

.tp-popup {
  z-index: 40;
  background: #fff;
  border: 1px solid #e9e9ed;
  border-radius: 15px;
  min-width: 154px;
  padding: 6px;
  position: absolute;
  box-shadow: 0 6px 23px rgba(28, 36, 53, .1);
}

.tp-top-popup {
  top: calc(50% + 21px);
  bottom: auto;
  left: -12px;
  right: auto;
}

.tp-popup a, .tp-popup button {
  text-align: left;
  white-space: nowrap;
  border-radius: 9px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  display: block;
}

.tp-popup a:hover, .tp-popup button:hover {
  background: #f4f5f8;
}

.tp-userbar {
  align-items: center;
  gap: 16px;
  margin-left: auto;
  display: flex;
}

.tp-site-link {
  color: var(--tp-muted);
  white-space: nowrap;
  gap: 7px;
  font-size: 13px;
}

.tp-account-menu {
  position: relative;
}

.tp-account-trigger {
  gap: 9px;
}

.tp-account-label {
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 150px;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
}

.tp-avatar {
  color: #3656bb;
  background: linear-gradient(130deg, #e8edff, #dce9ff);
  border-radius: 50%;
  place-items: center;
  width: 32px;
  height: 32px;
  display: grid;
}

.tp-avatar svg {
  stroke-width: 1.65px;
  width: 15px;
  height: 15px;
}

.tp-account-popup {
  top: calc(100% + 11px);
  bottom: auto;
  left: auto;
  right: 0;
}

.tp-account-popup .tp-site-menu-link {
  display: none;
}

.tp-account-details {
  border-bottom: 1px solid var(--tp-line);
  overflow-wrap: anywhere;
  gap: 4px;
  width: min(220px, 75vw);
  margin-bottom: 4px;
  padding: 7px 8px 9px;
  display: grid;
}

.tp-account-details p, .tp-account-status {
  color: var(--tp-muted);
  font-size: 12px;
}

.tp-account-status {
  padding: 8px;
}

.tp-account-popup .tp-sign-out {
  color: #b42318;
}

.tp-rail {
  z-index: 25;
  inset: var(--token-portal-header-height) auto 0 0;
  width: var(--token-portal-rail-width);
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0);
  flex-direction: column;
  padding: 0 11px 14px 12px;
  display: flex;
  position: fixed;
}

.tp-rail:before {
  pointer-events: none;
  content: "";
  background: linear-gradient(#fff, #f2f2f2 18%, #ededf0 38% 61%, #f6f6f8 79%, #fff);
  width: 1px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: auto;
  right: -1px;
}

.tp-rail-scroll {
  scrollbar-width: thin;
  overscroll-behavior: contain;
  min-height: 0;
  padding-top: 1px;
  overflow-y: auto;
}

.tp-rail-rows {
  gap: 2px;
  display: grid;
}

.tp-navitem {
  color: #434449;
  text-align: left;
  white-space: nowrap;
  border-radius: 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  position: relative;
}

.tp-navitem > svg {
  color: #2b2c32;
  stroke-width: 1.5px;
  flex: none;
  width: 18px;
  height: 18px;
}

.tp-navitem .tp-nav-arrow {
  width: 12px;
  height: 12px;
  color: var(--tp-muted);
  position: absolute;
  right: 13px;
}

.tp-navitem:has(.tp-nav-arrow) .tp-rail-text {
  padding-right: 17px;
}

.tp-navitem:hover {
  background: #f7f7f8;
}

.tp-navitem[aria-current="page"] {
  color: #14151c;
  background: #f1f1f2;
  font-weight: 600;
}

.token-portal-shell :is(.tp-navitem, .tp-backgroup):focus-visible {
  outline-offset: -2px;
}

.tp-rail-text {
  text-overflow: ellipsis;
  overflow: hidden;
}

.tp-rail-group {
  color: #c7c7c9;
  margin: 12px 12px 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

@media (prefers-contrast: more) {
  .tp-rail-group {
    color: #676870;
  }
}

.tp-backgroup {
  white-space: nowrap;
  border-radius: 20px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 16px;
  padding: 0 13px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
}

.tp-backgroup svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.tp-backgroup:hover {
  background: #f7f7f8;
}

.tp-rail-bottom {
  flex: none;
  margin-top: auto;
  padding-top: 10px;
}

.tp-shortcuts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  display: grid;
}

.tp-shortcuts a {
  border: 1px solid var(--tp-line);
  color: #484950;
  border-radius: 16px;
  place-items: center;
  height: 32px;
  font-size: 12px;
  display: grid;
}

.tp-shortcuts svg {
  stroke-width: 1.55px;
  width: 14px;
  height: 14px;
}

.tp-key-action:hover, .tp-shortcuts a:hover {
  background: #f6f7ff;
}

.tp-key-action {
  color: #52535b;
  background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(114deg, #ff91ad, #ffd7ed 18%, #dce7fc 42%, #d9f4f7 63%, #f2f1f7 87%) border-box;
  border: 1px solid rgba(0, 0, 0, 0);
  border-radius: 23px;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  display: flex;
  box-shadow: 0 4px 11px rgba(21, 22, 38, .11);
}

.tp-key-action svg {
  color: #282930;
  stroke-width: 1.55px;
  flex: none;
  width: 17px;
  height: 17px;
}

.tp-fold {
  z-index: 1;
  top: calc(50% + 3px);
  left: calc(var(--token-portal-rail-width) - 7px);
  color: #787982;
  background: #f2f2f4;
  border-radius: 10px;
  place-items: center;
  width: 14px;
  height: 42px;
  display: grid;
  position: fixed;
  transform: translateY(-50%);
}

.tp-fold svg {
  stroke-width: 1.85px;
  width: 11px;
  height: 11px;
}

.tp-fold:hover {
  color: var(--tp-ink);
  background: #e8e8ec;
}

.token-portal-shell[data-compact="true"] {
  --token-portal-rail-width: 60px;
}

.token-portal-shell[data-compact="true"] .tp-rail {
  padding-inline-start: 8px;
  padding-inline-end: 8px;
}

.token-portal-shell[data-compact="true"] .tp-rail :is(.tp-navitem, .tp-key-action, .tp-backgroup) {
  justify-content: center;
  width: 36px;
  margin-inline-start: auto;
  margin-inline-end: auto;
  padding: 0;
}

.token-portal-shell[data-compact="true"] .tp-rail :is(.tp-rail-text, .tp-rail-group span, .tp-nav-arrow) {
  display: none;
}

.token-portal-shell[data-compact="true"] .tp-rail-group {
  background: var(--tp-line);
  height: 1px;
  margin: 18px 7px;
}

.token-portal-shell[data-compact="true"] .tp-rail .tp-shortcuts {
  flex-direction: column;
  gap: 0;
  display: flex;
}

.token-portal-shell[data-compact="true"] .tp-rail .tp-shortcuts a {
  border: 0;
}

.token-portal-shell[data-compact="true"] .tp-fold svg {
  transform: rotate(180deg);
}

.tp-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--token-portal-rail-width);
  padding-top: var(--token-portal-header-height);
}

.tp-main:focus {
  outline: none;
}

.tp-console-content {
  width: 100%;
  max-width: 1520px;
  margin-inline-start: auto;
  margin-inline-end: auto;
  padding: 28px clamp(22px, 4vw, 64px) 56px;
}

.tp-console-content [id^="token-console-"] {
  scroll-margin-top: calc(var(--token-portal-header-height) + 16px);
}

.tp-drawer:not([open]) {
  display: none;
}

@media (max-width: 1023px) {
  .tp-global-nav {
    gap: 24px;
    margin-left: 20px;
  }

  .tp-userbar {
    gap: 8px;
  }

  .tp-site-link, .tp-userbar > .tp-divider {
    display: none;
  }

  .tp-account-popup .tp-site-menu-link {
    align-items: center;
    gap: 6px;
    min-height: 44px;
    display: flex;
  }
}

@media (max-width: 700px) {
  .token-portal-shell, .token-portal-shell[data-compact="true"] {
    --token-portal-header-height: 57px;
    --token-portal-rail-width: 0px;
  }

  .tp-header {
    border-bottom: 1px solid #f1f1f4;
    padding: 0 11px 0 5px;
  }

  .tp-identity {
    flex: none;
    gap: 5px;
    padding: 0;
  }

  .tp-account-label, .tp-identity > .tp-divider, .tp-rail, .tp-support {
    display: none;
  }

  .tp-menu-button {
    width: 30px;
    height: 44px;
    margin-right: 4px;
  }

  .tp-brand img {
    height: 18px;
  }

  .tp-brand {
    gap: 4px;
    font-size: 12px;
  }

  .tp-global-nav {
    gap: 16px;
    margin-left: 15px;
    font-size: 13px;
  }

  .tp-account-trigger, .tp-top-trigger {
    min-height: 44px;
  }

  .tp-account-label[data-identified="true"] {
    max-width: clamp(42px, 14vw, 80px);
    display: block;
  }

  .tp-avatar {
    width: 30px;
    height: 30px;
  }

  .tp-console-content {
    padding: 21px 14px 42px;
  }

  .tp-drawer {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    color: var(--tp-ink);
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .tp-drawer::backdrop {
    background: rgba(21, 21, 34, .27);
  }

  .tp-drawer-content {
    width: min(245px, 100% - 44px);
    height: 100%;
    padding: max(10px,env(safe-area-inset-top)) 12px max(16px,env(safe-area-inset-bottom));
    background: #fff;
    flex-direction: column;
    display: flex;
    box-shadow: 5px 0 20px rgba(21, 21, 34, .1);
  }

  .tp-drawer-close {
    align-self: flex-end;
    width: 44px;
    height: 44px;
  }

  .tp-drawer :is(.tp-navitem, .tp-shortcuts a, .tp-key-action) {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .tp-account-trigger {
    justify-content: flex-end;
    min-width: 44px;
  }

  .tp-account-label[data-identified="true"] + .tp-avatar {
    display: none;
  }
}

@media (max-width: 360px) {
  .tp-brand img {
    display: none;
  }

  .tp-global-nav {
    gap: 8px;
    margin-left: 5px;
    font-size: 12px;
  }
}
