/* Trade setup, "points and lines" (2026-11-22): the plan above the ticket's
   main button, the funds sheet (a route: from -> cost and time -> to), the
   money line in the account, and the enable-trading sheet. Colours follow the
   three site themes: brand (cream, the default), light and hyperliquid (dark).
   No relational selectors: the page's own rule against them applies here too. */

:root {
  --hgs-paper: #FBF7EF;
  --hgs-card: #FFFDF8;
  --hgs-ink: #16120E;
  --hgs-ink-2: #2A2119;
  --hgs-muted: #6B6358;
  --hgs-line: rgba(22, 18, 14, 0.14);
  --hgs-hair: rgba(22, 18, 14, 0.08);
  --hgs-tint: rgba(22, 18, 14, 0.045);
  --hgs-ok: #2F6B47;
  --hgs-ok-tint: rgba(47, 107, 71, 0.10);
  --hgs-warn: #8A5A12;
  --hgs-warn-tint: rgba(183, 121, 31, 0.12);
  --hgs-primary-bg: #16120E;
  --hgs-primary-fg: #F3EAD8;
  --hgs-primary-shadow: 0 10px 22px rgba(22, 18, 14, 0.16);
  --hgs-scrim: rgba(22, 18, 14, 0.32);
  --hgs-pop: 0 28px 70px rgba(22, 18, 14, 0.24), 0 2px 8px rgba(22, 18, 14, 0.08);
}

html[data-hg-theme="light"] {
  --hgs-paper: #FFFFFF;
  --hgs-card: #F7F8F9;
  --hgs-ink: #111418;
  --hgs-ink-2: #2B3036;
  --hgs-muted: #5B636E;
  --hgs-line: rgba(17, 20, 24, 0.14);
  --hgs-hair: rgba(17, 20, 24, 0.08);
  --hgs-tint: rgba(17, 20, 24, 0.04);
  --hgs-ok: #1F7A4D;
  --hgs-ok-tint: rgba(31, 122, 77, 0.10);
  --hgs-warn: #8A5A12;
  --hgs-warn-tint: rgba(183, 121, 31, 0.12);
  --hgs-primary-bg: #111418;
  --hgs-primary-fg: #FFFFFF;
  --hgs-primary-shadow: 0 10px 22px rgba(17, 20, 24, 0.14);
  --hgs-scrim: rgba(17, 20, 24, 0.34);
  --hgs-pop: 0 28px 70px rgba(17, 20, 24, 0.20), 0 2px 8px rgba(17, 20, 24, 0.08);
}

html[data-hg-theme="hyperliquid"] {
  --hgs-paper: #14181D;
  --hgs-card: #1A1F25;
  --hgs-ink: #ECEFF4;
  --hgs-ink-2: #D5DAE1;
  --hgs-muted: #98A1AD;
  --hgs-line: rgba(255, 255, 255, 0.13);
  --hgs-hair: rgba(255, 255, 255, 0.07);
  --hgs-tint: rgba(255, 255, 255, 0.05);
  --hgs-ok: #6DCDA8;
  --hgs-ok-tint: rgba(109, 205, 168, 0.13);
  --hgs-warn: #E8B060;
  --hgs-warn-tint: rgba(232, 176, 96, 0.12);
  --hgs-primary-bg: #55D8C6;
  --hgs-primary-fg: #0B0E11;
  --hgs-primary-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --hgs-scrim: rgba(0, 0, 0, 0.62);
  --hgs-pop: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* ---- ticket: nothing in the trade stack may be squeezed to nothing ---- */
#orderTicket .pm-ticket-trade-stack__body > * {
  flex-shrink: 0;
}

/* The plan replaces the inline Builder Code panel and the readiness and
   one-click diagnostics that used to sit in the ticket. */
#orderTicket #builderFeePanel,
#orderTicket #builderNotice,
#orderTicket #ticketReadinessPanel,
#orderTicket #hip4OneClickPanel {
  display: none !important;
}

/* The money line carries the account's two money actions. */
#accountMenu #accountDepositButton,
#accountMenu #accountWithdrawButton {
  display: none !important;
}

#tradeSetupPlan[hidden],
#tradeSetupHelp[hidden],
#tradeAgentLine[hidden],
#tradeAmountLimits[hidden],
#tradePendingPill[hidden] {
  display: none !important;
}

/* ---- the plan: what is left before this order ---- */
.hg-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--hgs-ink);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.hg-plan__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  color: var(--hgs-muted);
}

.hg-plan__top strong {
  font-weight: 700;
  color: var(--hgs-ink);
}

.hg-plan__rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hg-pl {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 10px;
  padding-bottom: 12px;
}

.hg-pl.is-end {
  padding-bottom: 0;
}

.hg-pl::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--hgs-line);
}

.hg-pl.is-end::before {
  display: none;
}

.hg-pl__dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.hg-pl__dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--hgs-muted);
}

.hg-pl.is-now .hg-pl__dot::after {
  width: 10px;
  height: 10px;
  background: var(--hgs-ink);
  box-shadow: 0 0 0 4px var(--hgs-tint);
}

.hg-pl__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hg-pl__line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-height: 20px;
  font-size: 13px;
  color: var(--hgs-muted);
  font-variant-numeric: tabular-nums;
}

.hg-pl__line b {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--hgs-ink-2);
}

.hg-pl.is-now .hg-pl__line b {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--hgs-ink);
}

.hg-pl.is-moving::before {
  background: var(--hgs-ink);
}

.hg-pl.is-moving::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--hgs-ink);
  animation: hg-plan-run 1.3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hg-plan-run {
  0% { opacity: 0; transform: translateY(0); }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(64px); }
}

.hg-pl__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--hgs-card);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
}

.hg-pl__fee {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--hgs-ink-2);
}

.hg-pl__fee-n {
  font-size: 34px;
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--hgs-ink);
  font-variant-numeric: tabular-nums;
}

/* The step's meta ("7 日間有効", "初回だけ", "$22.21 · 約1分") and the card's figure ("7 日間", "1%") stay on one
   line (2026-11-24: "7 日間" broke into three lines at 1440 px); the words beside the figure wrap instead. The buy
   row's meta (the order, which can be long) still wraps. */
.hg-pl[data-step="enable"] .hg-pl__line span,
.hg-pl[data-step="funds"] .hg-pl__line span,
.hg-pl__fee-n {
  flex: none;
  white-space: nowrap;
}

.hg-pl__fee > span:last-child {
  min-width: 0;
}

/* The figure's word unit ("日間", "days") beside its number. */
.hg-pl__fee-n small {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.hg-pl__move {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--hgs-ink-2);
}

.hg-pl__end {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hg-pl__end.is-to {
  align-items: flex-end;
  text-align: right;
}

.hg-pl__end small {
  font-size: 11.5px;
  color: var(--hgs-muted);
}

.hg-pl__move b {
  font-size: 15px;
  font-weight: 750;
  color: var(--hgs-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hg-pl__move svg {
  flex: none;
  color: var(--hgs-muted);
}

.hg-pl__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--hgs-muted);
}

.hg-pl__link {
  align-self: flex-start;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hgs-ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.hg-pl__more summary {
  list-style: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hgs-ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hg-pl__more summary::-webkit-details-marker {
  display: none;
}

.hg-pl__more pre {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--hgs-tint);
  color: var(--hgs-ink-2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.hg-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--hgs-line);
  overflow: hidden;
}

.hg-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 30%;
  border-radius: 2px;
  background: var(--hgs-ink);
  animation: hg-bar 1.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hg-bar {
  to { left: 100%; }
}

.hg-help {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--hgs-muted);
}

/* ---- the agent line: under the button, so the button never moves down (2026-11-24) ---- */
.hg-agent-line {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  color: var(--hgs-muted);
  font-variant-numeric: tabular-nums;
}

.hg-agent-line__off {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hgs-ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.hg-agent-line__off:disabled {
  color: var(--hgs-muted);
  text-decoration: none;
  cursor: default;
}

/* ---- per-order range under the amount ---- */
.hg-amount-limits {
  margin: 6px 2px 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--hgs-muted);
  font-variant-numeric: tabular-nums;
}

.hg-amount-limits[data-over="1"] {
  color: var(--hgs-warn);
  font-weight: 650;
}

.pm-order-field--amount.hg-amount-out-of-range {
  box-shadow: inset 0 0 0 1.5px var(--hgs-warn) !important;
}

/* ---- money on the move, in the top bar ---- */
.hg-pend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hgs-line);
  color: var(--hgs-ink);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hg-spin {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--hgs-line);
  border-top-color: var(--hgs-ink);
  border-radius: 999px;
  animation: hg-spin 0.9s linear infinite;
}

@keyframes hg-spin {
  to { transform: rotate(360deg); }
}

/* ---- the line: where the money is ---- */
.hg-money {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 4px 0 16px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: var(--hgs-paper);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
  color: var(--hgs-ink);
  font-family: "Manrope", "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.hg-line3 {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: start;
  padding-top: 26px;
}

.hg-line3::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 2px;
  border-radius: 1px;
  background: var(--hgs-line);
}

.hg-stop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hg-stop::before {
  content: "";
  position: absolute;
  top: -26px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--hgs-paper);
  box-shadow: inset 0 0 0 2px var(--hgs-muted);
}

.hg-stop.is-a::before {
  left: 0;
}

.hg-stop.is-z {
  align-items: flex-end;
  text-align: right;
}

.hg-stop.is-z::before {
  right: 0;
}

.hg-stop.is-main {
  align-items: center;
  text-align: center;
}

.hg-stop.is-main::before {
  left: 50%;
  margin-left: -8px;
  top: -27px;
  width: 16px;
  height: 16px;
  background: var(--hgs-ink);
  box-shadow: 0 0 0 5px var(--hgs-tint);
}

.hg-stop__name {
  font-size: 12px;
  font-weight: 650;
  color: var(--hgs-muted);
}

.hg-stop__val {
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--hgs-ink);
}

.hg-stop.is-main .hg-stop__val {
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hg-stop__sub {
  font-size: 11.5px;
  color: var(--hgs-muted);
}

.hg-run {
  position: absolute;
  top: 1px;
  left: 6px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--hgs-ink);
  animation: hg-run-in 1.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.hg-run.is-out {
  animation-name: hg-run-out;
}

@keyframes hg-run-in {
  0% { left: 6px; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: calc(50% - 6px); opacity: 0; }
}

@keyframes hg-run-out {
  0% { left: calc(50% - 6px); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 6px; opacity: 0; }
}

.hg-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Trading closed here: the line keeps only Withdraw (2026-11-25). */
.hg-two.is-one {
  grid-template-columns: minmax(0, 1fr);
}

/* ---- buttons shared by the sheets and the line ---- */
.hg-primary {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--hgs-primary-bg);
  color: var(--hgs-primary-fg);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.005em;
  text-decoration: none;
  box-shadow: var(--hgs-primary-shadow);
  cursor: pointer;
}

.hg-money .hg-primary {
  min-height: 48px;
  font-size: 15px;
}

.hg-primary--quiet {
  background: transparent;
  color: var(--hgs-ink);
  box-shadow: inset 0 0 0 1px var(--hgs-line);
}

.hg-primary:disabled {
  background: var(--hgs-tint);
  color: var(--hgs-muted);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
  cursor: default;
}

.hg-primary:focus-visible,
.hg-sheet__close:focus-visible,
.hg-q:focus-visible,
.hg-node:focus-visible,
.hg-row:focus-visible,
.hg-pl__link:focus-visible,
.hg-pl__more summary:focus-visible,
.hg-disclosure summary:focus-visible {
  outline: 2px solid var(--hgs-ink);
  outline-offset: 2px;
}

/* ---- sheet (a dialog on wide screens) ---- */
html.hg-sheet-open,
html.hg-sheet-open body {
  overflow: hidden;
}

.hg-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: "Manrope", "Noto Sans JP", system-ui, sans-serif;
  color: var(--hgs-ink);
  letter-spacing: 0.01em;
}

.hg-sheet-root[hidden],
.hg-sheet [hidden] {
  display: none !important;
}

.hg-sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--hgs-scrim);
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

.hg-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--hgs-paper);
  box-shadow: var(--hgs-pop);
  transform: translateY(40px);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), opacity 220ms ease;
  outline: none;
}

.hg-sheet-root[data-open="1"] .hg-sheet-scrim {
  opacity: 1;
}

.hg-sheet-root[data-open="1"] .hg-sheet {
  transform: none;
  opacity: 1;
}

.hg-sheet__grabber {
  flex: none;
  width: 36px;
  height: 4px;
  margin: 0 auto -6px;
  border-radius: 2px;
  background: var(--hgs-line);
}

.hg-sheet__head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}

.hg-sheet__title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--hgs-ink);
}

.hg-sheet__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hgs-ink-2);
  cursor: pointer;
}

.hg-sheet__back {
  margin: 0 0 0 -12px;
}

.hg-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
  text-align: center;
}

.hg-hero__amt {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-size: 54px;
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--hgs-ink);
}

.hg-hero__amt small {
  margin-left: 6px;
  font-size: 0.34em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--hgs-muted);
}

.hg-hero__cur {
  margin-right: 3px;
  font-size: 0.6em;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--hgs-muted);
}

.hg-hero__amt input {
  width: 4ch;
  min-width: 1ch;
  max-width: 9ch;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  font-variant-numeric: tabular-nums;
  caret-color: var(--hgs-ink);
}

.hg-hero__amt input:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

.hg-hero__title {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

.hg-hero__sub {
  min-height: 20px;
  font-size: 13px;
  color: var(--hgs-muted);
  font-variant-numeric: tabular-nums;
}

.hg-hero__sub.is-warn {
  color: var(--hgs-warn);
  font-weight: 650;
}

.hg-seal {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--hgs-ok-tint);
  color: var(--hgs-ok);
  animation: hg-seal 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes hg-seal {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

.hg-quick {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hg-q {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--hgs-line);
  color: var(--hgs-ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.hg-q.is-on {
  background: var(--hgs-ink);
  color: var(--hgs-paper);
  box-shadow: none;
}

/* the route: where the money leaves, what the path costs, where it lands */
.hg-route {
  display: flex;
  flex-direction: column;
}

.hg-node {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--hgs-card);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
  color: var(--hgs-ink);
  font: inherit;
  text-align: left;
}

button.hg-node {
  cursor: pointer;
}

button.hg-node:disabled {
  cursor: default;
  color: var(--hgs-ink);
}

.hg-node__ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--hgs-tint);
  color: var(--hgs-ink-2);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hg-node__ic.is-own {
  background: var(--hgs-ink);
  color: var(--hgs-paper);
}

.hg-node__ic.is-ok {
  background: var(--hgs-ok-tint);
  color: var(--hgs-ok);
}

.hg-node__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hg-node__name {
  font-size: 14.5px;
  font-weight: 700;
}

.hg-node__sub {
  font-size: 12.5px;
  color: var(--hgs-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.hg-node__val {
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hg-node__go {
  display: grid;
  color: var(--hgs-muted);
}

.hg-rail {
  position: relative;
  display: flex;
  align-items: center;
  height: 30px;
  margin-left: 31px;
  padding-left: 32px;
  border-left: 2px dotted var(--hgs-line);
  font-size: 12.5px;
  color: var(--hgs-muted);
  font-variant-numeric: tabular-nums;
}

.hg-route.is-moving .hg-rail {
  border-left: 2px solid var(--hgs-ink);
  color: var(--hgs-ink);
  font-weight: 650;
}

.hg-route.is-moving .hg-rail::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--hgs-ink);
  box-shadow: 0 0 0 4px var(--hgs-tint);
  animation: hg-rail 1.3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hg-rail {
  0% { opacity: 0; transform: translateY(-6px); }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(26px); }
}

.hg-route.is-done .hg-rail {
  border-left: 2px solid var(--hgs-ok);
  color: var(--hgs-ok);
  font-weight: 650;
}

.hg-funds__notice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--hgs-card);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
}

.hg-funds__notice strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--hgs-ink);
}

.hg-funds__notice p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--hgs-ink-2);
}

.hg-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.hg-status[data-tone="wait"] {
  background: var(--hgs-tint);
  color: var(--hgs-ink-2);
}

.hg-status[data-tone="ok"] {
  background: var(--hgs-ok-tint);
  color: var(--hgs-ok);
  font-weight: 650;
}

.hg-status[data-tone="warn"] {
  background: var(--hgs-warn-tint);
  color: var(--hgs-warn);
}

.hg-status.is-spinning::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 2px solid var(--hgs-line);
  border-top-color: var(--hgs-ink);
  border-radius: 999px;
  animation: hg-spin 0.9s linear infinite;
}

.hg-fine {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  color: var(--hgs-muted);
}

.hg-facts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hg-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--hgs-ink-2);
}

.hg-facts svg {
  flex: none;
  margin-top: 3px;
  color: var(--hgs-ok);
}

.hg-disclosure {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
}

.hg-disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hgs-ink-2);
  cursor: pointer;
}

.hg-disclosure summary::-webkit-details-marker {
  display: none;
}

.hg-disclosure[open] summary svg {
  transform: rotate(180deg);
}

.hg-disclosure__body {
  margin: 0 14px 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--hgs-tint);
  color: var(--hgs-ink-2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* source picker */
.hg-rows {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--hgs-card);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
  overflow: hidden;
}

.hg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  box-shadow: 0 -1px 0 var(--hgs-hair);
  color: var(--hgs-ink);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.hg-row__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hg-row__main b {
  font-weight: 700;
}

.hg-row__main small {
  font-size: 12.5px;
  color: var(--hgs-muted);
}

.hg-row__val {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hg-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--hgs-ok-tint);
  color: var(--hgs-ok);
  font-size: 11px;
  font-weight: 750;
  vertical-align: 1px;
}

a.hg-funds__external {
  color: var(--hgs-primary-fg);
}

/* Wide screens: the sheet becomes a centred dialog and the market stays in view. */
@media (min-width: 720px) {
  .hg-sheet-root {
    align-items: center;
    padding: 24px;
  }

  .hg-sheet {
    width: 420px;
    max-height: calc(100dvh - 48px);
    padding: 18px 22px 22px;
    border-radius: 22px;
    transform: translateY(10px) scale(0.985);
  }

  .hg-sheet__grabber {
    display: none;
  }

  .hg-q {
    height: 36px;
    padding: 0 14px;
  }
}

@media (max-width: 719px) {
  .hg-pl__link {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hg-sheet,
  .hg-sheet-scrim {
    transition: none;
  }

  .hg-seal,
  .hg-spin,
  .hg-run,
  .hg-bar::after,
  .hg-pl.is-moving::after,
  .hg-status.is-spinning::before,
  .hg-route.is-moving .hg-rail::before {
    animation: none;
  }
}

/* ---- the market list's notice (2026-11-24): "the saved list is shown", and the list's other notices ----
   The baseline gives it amber text on a see-through brown, 1.14:1 on the cream page. Here it is an opaque card in
   each theme's own warning colours: at least 4.5:1 in brand (5.1:1), light (4.9:1) and hyperliquid (6.7:1). */
.pm-market-grid .pm-market-notice {
  border: 0;
  background: linear-gradient(var(--hgs-warn-tint), var(--hgs-warn-tint)), var(--hgs-card);
  box-shadow: inset 0 0 0 1px var(--hgs-line);
  color: var(--hgs-warn);
}

/* ---- the onboarding dialog's heading (2026-11-24) ----
   Its panel is dark in every theme, while its title and subtitle took the page's own ink (dark on dark in brand and
   light). They get the light colours its step rows already use. */
#onboardingModal .pm-onboarding-shell > header h2 {
  color: #ffffff;
}

#onboardingModal .pm-onboarding-shell > header p {
  color: rgba(226, 232, 240, 0.8);
}

/* The page does not set border-box everywhere; these parts are laid out with it. */
.hg-plan,
.hg-plan *,
.hg-money,
.hg-money *,
.hg-sheet,
.hg-sheet *,
.hg-pend,
.hg-help,
.hg-agent-line,
.hg-amount-limits {
  box-sizing: border-box;
}

/* The account menu styles every button it contains; the line keeps its own two. */
#accountMenu #accountMoneyLine .hg-primary {
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--hgs-primary-bg);
  color: var(--hgs-primary-fg);
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--hgs-primary-shadow);
}

#accountMenu #accountMoneyLine .hg-primary.hg-primary--quiet {
  background: transparent;
  color: var(--hgs-ink);
  box-shadow: inset 0 0 0 1px var(--hgs-line);
}

#accountMenu #accountMoneyLine .hg-primary:disabled {
  background: var(--hgs-tint);
  color: var(--hgs-muted);
  box-shadow: inset 0 0 0 1px var(--hgs-hair);
}

/* Short screens (small laptops): the plan tightens so the main button stays in
   view. What is signed is still shown by the wallet itself. */
@media (min-width: 1100px) and (max-height: 800px) {
  .hg-plan {
    gap: 6px;
    margin-bottom: 8px;
  }

  .hg-pl {
    padding-bottom: 6px;
  }

  .hg-pl__body {
    gap: 6px;
  }

  .hg-pl__card {
    gap: 6px;
    padding: 10px 12px;
  }

  .hg-pl__more {
    display: none;
  }

  .hg-pl__fee-n {
    font-size: 30px;
  }
}
