@font-face {
  font-family: "OurFont";
  src: url("./assets/Inter-Regular.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: dark;
  font-family: "OurFont", system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --hl-accent-soft: #50d2c1;
  --hl-accent: #97fce4;
  --hl-accent-text: #04060c;
  --text: #f3f8f5;
  --line: rgba(255, 255, 255, 0.1);
  --green: #7cffb2;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0f1a1f;
}

.hyperliquid-frame {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0f1a1f;
}

.trade-panel {
  position: fixed;
  z-index: 2;
  top: 55px;
  right: 0;
  bottom: 30px;
  width: calc(18.75vw + 0px);
  overflow-x: hidden;
  overflow-y: auto;
  color: #f6fefd;
  border: 3px solid #101e23;
  border-bottom: 0;
  background: #0f1a1f;
  font-family: "OurFont", system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  scrollbar-color: #354248 transparent;
  scrollbar-width: thin;
}

.trade-panel,
.parent-connect-layer {
  visibility: hidden;
  opacity: 0;
}

html.embed-ready .trade-panel,
html.embed-ready .parent-connect-layer {
  visibility: visible;
  opacity: 1;
}

.trade-panel button {
  font-family: inherit;
  font-weight: 400;
}

.order-entry {
  min-height: 686px;
  border-bottom: 3px solid #101e23;
  background: #0f1a1f;
}

.order-tabs {
  display: grid;
  height: 35px;
  margin: 7px 10px 0;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

.order-tab {
  position: relative;
  padding: 0;
  color: #949e9c;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 34px;
  cursor: pointer;
}

.order-tab.is-active {
  color: #f6fefd;
}

.order-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: #50d2c1;
  content: "";
}

.order-tab-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.tab-chevron {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1px solid #949e9c;
  border-bottom: 1px solid #949e9c;
  transform: rotate(45deg);
}

.side-switch {
  display: grid;
  height: 33px;
  margin: 16px 10px 0;
  padding: 2px 4px;
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
  background: #273035;
}

.side-button {
  padding: 0;
  color: #f6fefd;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  line-height: 29px;
  cursor: pointer;
}

.side-button.is-selected {
  color: #02231e;
  background: #50d2c1;
}

.balance-row,
.order-stats > div,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-row {
  height: 15px;
  margin: 16px 10px 0;
  color: #949e9c;
  font-size: 12px;
  line-height: 15px;
}

.balance-row strong {
  color: #f6fefd;
  font-size: 12px;
  font-weight: 400;
  line-height: 15px;
}

.underlined-label {
  text-decoration-line: underline;
  text-decoration-color: rgba(170, 184, 188, 0.52);
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.size-input {
  display: flex;
  width: calc(100% - 20px);
  height: 33px;
  margin: 8px 10px 0;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;
  color: #949e9c;
  border: 1px solid #273035;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  line-height: 15px;
  text-align: left;
  cursor: pointer;
}

.asset-selector {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #f6fefd;
}

.asset-selector i {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1px solid #d8e1e3;
  border-bottom: 1px solid #d8e1e3;
  transform: rotate(45deg);
}

.size-control {
  display: grid;
  height: 33px;
  margin: 8px 10px 0;
  grid-template-columns: minmax(0, 1fr) 60px;
  gap: 10px;
  align-items: center;
}

.slider-shell {
  position: relative;
  width: 100%;
  height: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slider-shell::before {
  position: absolute;
  top: 7px;
  right: 0;
  left: 7px;
  height: 5px;
  border-radius: 4px;
  background: #344047;
  content: "";
}

.slider-thumb {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 17px;
  height: 17px;
  border: 2px solid #50d2c1;
  border-radius: 50%;
  background: #0f1a1f;
}

.slider-dot {
  position: absolute;
  z-index: 1;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #69757a;
}

.dot-one { left: 25%; }
.dot-two { left: 50%; }
.dot-three { left: 75%; }
.dot-four { right: 0; }

.percent-input {
  display: flex;
  height: 33px;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;
  color: #f6fefd;
  border: 1px solid #273035;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  line-height: 31px;
}

.percent-input strong {
  font-weight: 600;
}

.connect-reserved {
  height: 335.5px;
}

.trade-connect-button {
  display: block;
  width: calc(100% - 20px);
  height: 33px;
  margin: 0 10px 15px;
  padding: 0 16px;
  color: var(--hl-accent-text);
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--hl-accent-soft);
  font-size: 12px;
  line-height: 31px;
  text-align: center;
  cursor: pointer;
}

.order-stats {
  padding: 0 10px 12px;
}

.order-stats > div {
  min-height: 25px;
  color: #949e9c;
  font-size: 12px;
  line-height: 15px;
}

.order-stats strong {
  color: #f6fefd;
  font-weight: 400;
}

.order-stats .accent-value {
  color: #24cfc0;
}

.account-panel {
  min-height: 230px;
  padding: 13px 10px 24px;
  background: #0f1a1f;
}

.fund-actions {
  display: grid;
  height: 34px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fund-button {
  border: 1px solid #1b5454;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  line-height: 31px;
  cursor: pointer;
}

.deposit-button {
  color: #081414;
  border-color: #19594f;
  background: #16554d;
}

.withdraw-button {
  color: #175451;
}

.trade-panel button:hover,
.trade-panel button:focus-visible {
  filter: brightness(1.08);
}

.trade-panel button:focus-visible {
  outline: 1px solid #50d2c1;
  outline-offset: 2px;
}

.account-divider {
  height: 1px;
  margin: 14px 0 11px;
  background: #26343a;
}

.account-panel h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
}

.summary-row {
  min-height: 26px;
  color: #9ca9ad;
  font-size: 12px;
}

.summary-row strong {
  color: #fff;
  font-weight: 400;
}

.ratio-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #24cfc0 !important;
}

.ratio-value i {
  position: relative;
  width: 17px;
  height: 8px;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background: conic-gradient(from 270deg at 50% 100%, #50d2c1 0deg 118deg, #fb6671 118deg 180deg, transparent 180deg);
}

.parent-connect-layer {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.parent-connect {
  position: absolute;
  height: 33px;
  padding: 0 16px;
  color: var(--hl-accent-text);
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--hl-accent-soft);
  font-family: "OurFont", system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 31px;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}

.parent-connect::before {
  position: absolute;
  inset: -10px;
  content: "";
  background: transparent;
  pointer-events: auto;
}

.parent-connect:hover,
.parent-connect:focus-visible {
  background: var(--hl-accent);
}

.parent-connect:disabled,
.trade-connect-button:disabled {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  opacity: 0.85;
}

.parent-connect:disabled:hover,
.trade-connect-button:disabled:hover {
  background: var(--hl-accent-soft);
}

.parent-connect:focus-visible {
  outline: 1px solid var(--hl-accent);
  outline-offset: 2px;
}

.parent-connect-top {
  top: 11.5px;
  right: 90.29px;
  width: 81.13px;
}

.wallet-dialog {
  width: min(540px, calc(100% - 28px));
  max-height: min(790px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  color: var(--text);
  background: #0a100f;
  box-shadow: 0 42px 120px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(124, 255, 178, 0.035);
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", system-ui, sans-serif;
  pointer-events: auto;
}

.wallet-dialog::backdrop {
  background: rgba(2, 5, 4, 0.78);
  backdrop-filter: blur(11px);
  animation: fade-in 180ms ease-out;
}

.wallet-dialog[open] {
  animation: dialog-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wallet-dialog button {
  color: inherit;
  font: inherit;
}

.dialog-frame {
  display: flex;
  max-height: min(790px, calc(100dvh - 28px));
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.dialog-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.dialog-logo {
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #f6aa4c;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #f9a52c, #d96f0e);
  box-shadow: 0 10px 26px rgba(247, 147, 26, 0.18);
  font-family: "DM Mono", monospace;
  font-size: 25px;
}

.hyperliquid-dialog-logo {
  display: block;
  width: 115px;
  height: 32px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hyperliquid-dialog-logo img {
  display: block;
  width: 115px;
  height: 32px;
}

.dialog-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.dialog-brand h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.close-button {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.close-button span {
  position: absolute;
  top: 17px;
  left: 10px;
  width: 15px;
  height: 1.5px;
  border-radius: 2px;
  background: #ccd4d0;
}

.close-button span:first-child {
  transform: rotate(45deg);
}

.close-button span:last-child {
  transform: rotate(-45deg);
}

.close-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(5deg);
}

.wallet-option:focus-visible,
.close-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.dialog-description {
  margin: 17px 24px 15px;
  color: #7e8a84;
  font-size: 12px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 24px 16px;
  padding: 11px 13px;
  border: 1px solid rgba(124, 255, 178, 0.11);
  border-radius: 10px;
  background: rgba(124, 255, 178, 0.035);
}

.security-note-icon {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #06100b;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.security-note p {
  margin: 0;
  color: #76827c;
  font-size: 10px;
  line-height: 1.55;
}

.security-note strong {
  margin-right: 5px;
  color: #b9c9c0;
  font-weight: 600;
}

.wallet-list {
  margin: 0 12px;
  padding: 0 12px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2e3a34 transparent;
  scrollbar-width: thin;
}

.wallet-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.wallet-option:hover {
  border-color: rgba(124, 255, 178, 0.13);
  background: rgba(124, 255, 178, 0.035);
  transform: translateX(2px);
}

.wallet-icon {
  display: grid;
  width: 38px;
  height: 38px;
  overflow: hidden;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 33px;
  color: #fff;
  background: #1a211f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.wallet-icon img,
.seed-wallet-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.metamask { background: linear-gradient(145deg, #f6a24a, #d65e23); }
.okx { color: #111; background: #fff; font-size: 8px; }
.phantom { background: linear-gradient(145deg, #a781ff, #5d49cf); }
.trust { background: linear-gradient(145deg, #41a5ff, #176dd2); }
.rabby { background: linear-gradient(145deg, #8c82ff, #5147e8); }
.imtoken { background: linear-gradient(145deg, #25b7bd, #087a88); }
.unisat { color: #111; background: linear-gradient(145deg, #ffdf4a, #f49c13); }
.ledger { color: #111; background: #f4f5f4; }
.onekey { color: #06200f; background: #56e977; }
.trezor { background: linear-gradient(145deg, #69a5ff, #2b63c9); }
.exodus { background: linear-gradient(145deg, #8e77ff, #5736dc); }
.tronlink { background: linear-gradient(145deg, #ff5858, #c21f37); font-size: 17px; }
.safepal { background: linear-gradient(145deg, #63d8ff, #216fb6); }

.wallet-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  color: #e2e8e5;
  font-size: 12px;
  font-weight: 650;
}

.wallet-name small {
  overflow: hidden;
  color: #5f6b65;
  font-size: 9px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommended {
  padding: 5px 7px;
  border: 1px solid rgba(124, 255, 178, 0.12);
  border-radius: 5px;
  color: var(--green);
  background: rgba(124, 255, 178, 0.055);
  font-size: 8px;
}

.chevron {
  color: #536059;
  font-size: 21px;
  font-weight: 300;
  transition: color 150ms ease, transform 150ms ease;
}

.wallet-option:hover .chevron {
  color: var(--green);
  transform: translateX(2px);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: min(390px, calc(100% - 32px));
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid rgba(124, 255, 178, 0.18);
  border-radius: 13px;
  visibility: hidden;
  opacity: 0;
  background: rgba(12, 22, 18, 0.96);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", system-ui, sans-serif;
  pointer-events: auto;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.toast.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #06100b;
  background: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.toast p {
  margin: 0;
  color: #92a099;
  font-size: 11px;
  line-height: 1.55;
}

.toast strong {
  color: #d8e3dd;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.dialog-view {
  display: flex;
  min-height: 0;
  max-height: min(790px, calc(100dvh - 28px));
  flex-direction: column;
}

.dialog-view[hidden] {
  display: none;
}

.wallet-view .wallet-list {
  flex: 1 1 auto;
}

.back-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #ccd4d0;
  background: rgba(255, 255, 255, 0.025);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.back-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(-2px);
}

.back-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.seed-wallet-logo {
  font-family: "OurFont", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.seed-toggle {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 24px 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
}

.seed-toggle-option {
  padding: 7px 18px;
  border: 0;
  border-radius: 8px;
  color: #8a968f;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.seed-toggle-option.is-active {
  color: #06100b;
  background: var(--green);
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 24px;
  padding-bottom: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2e3a34 transparent;
  scrollbar-width: thin;
}

.seed-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 150ms ease, background 150ms ease;
}

.seed-input-wrap:focus-within {
  border-color: rgba(124, 255, 178, 0.4);
  background: rgba(124, 255, 178, 0.04);
}

.seed-input-wrap.is-invalid {
  border-color: rgba(255, 107, 107, 0.55);
  background: rgba(255, 107, 107, 0.06);
}

.seed-input-index {
  min-width: 16px;
  color: #55625b;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-align: right;
  user-select: none;
}

.seed-input {
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.seed-input::placeholder {
  color: #3f4a44;
}

.seed-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
}

.seed-message {
  min-height: 16px;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.seed-message.is-error {
  color: #ff8f8f;
}

.seed-message.is-ok {
  color: var(--green);
}

.seed-submit {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 11px;
  color: var(--hl-accent-text);
  background: var(--hl-accent-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}

.seed-submit:hover:not(:disabled) {
  background: var(--hl-accent);
}

.seed-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.seed-submit:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(0.975); }
}

@media (min-width: 821px) and (max-width: 1420px) {
  .trade-panel {
    width: calc(28.125vw + 10px);
  }
}

@media (max-width: 820px) {
  .trade-panel {
    display: none;
  }

  .parent-connect-top {
    right: 90px;
  }

  .wallet-dialog,
  .dialog-frame {
    max-height: calc(100dvh - 18px);
  }

  .wallet-dialog {
    width: calc(100% - 18px);
    border-radius: 19px;
  }

  .dialog-header {
    padding: 20px 18px 0;
  }

  .dialog-description {
    margin-right: 18px;
    margin-left: 18px;
  }

  .security-note {
    margin-right: 18px;
    margin-left: 18px;
  }

  .wallet-list {
    margin: 0 5px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .recommended {
    display: none;
  }

  .wallet-option {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
  }

  .seed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 18px;
  }

  .seed-toggle {
    margin-left: 18px;
  }

  .dialog-view .dialog-description {
    margin-right: 18px;
    margin-left: 18px;
  }

  .seed-footer {
    padding: 16px 18px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-dialog,
  .wallet-dialog::backdrop,
  .wallet-dialog *,
  .toast {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
