/* Archivo, Geist and Geist Mono (SIL Open Font License), self-hosted from Google Fonts so no stylesheet
   or font loads from another origin. Variable fonts, split by unicode range as Google serves them. */
/* Archivo · vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/332e6f66de84927cdffc60894e4e186ced783f5cb4b3e88200f45b7c1d306810/archivo-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Archivo · latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/5717f37059660ca5c899bad6c48ee22c3ac55cb3c484055241689d0f905a1a86/archivo-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Archivo · latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/e3a28eade21a900c7155a247757f4b2834c07bb7ef07ad7efa55cebaac1e8f5e/archivo-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Geist · cyrillic-ext */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/2317fa4bb293c9c0b110e18315d529235c47a0ddd3338cea3d8c7955e927899e/geist-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* Geist · cyrillic */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/6894439694946a589d157ece003086960a6a4013d74a813dab7602efdb3d8c09/geist-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Geist · vietnamese */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/8fa40e5d248247735eb97a0bd593b8852440430600d6ba01364c31fe0abc1fe1/geist-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Geist · latin-ext */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/824f485b5d26e2f2da3c2b236132ece1bc8e4e43373452950bb0e40548b4313f/geist-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Geist · latin */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/19f9c92546aa300c312235e3125af1b81394d8db9a4bc4a425cd5b641d2d54e1/geist-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Geist Mono · cyrillic-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/cd8800999070b729e1cc0bf7a48da6c3ac096a044251171b9a7574b56d96d4b4/geist-mono-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* Geist Mono · cyrillic */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/4866787fc952dbdbd591d6923d67bc21c2d894b93f34ab69d0cdf25d47bfb2df/geist-mono-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Geist Mono · symbols2 */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/5bb66d8319ba1602bb2eb67dce8d79c2b4687be8ce183a0574433e949b3c60ad/geist-mono-symbols2.woff2") format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
/* Geist Mono · vietnamese */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/d39b60889a94a527a7f73c7988a2d6efb6c081614aef683b0b386c02d74c2175/geist-mono-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Geist Mono · latin-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/1a189eb997c3e2ece68373e387afaec9e8617424186c4b1ab3cff7c54ba6223b/geist-mono-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Geist Mono · latin */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/684ad5b531f81d43c1e8c7038262d5db7cdc1f68006e04d6c7769efa8d33c8cc/geist-mono-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Two themes share every token below: Carbon Mint (dark, the default) here and Porcelain Mint (light) in the
     :root[data-theme="light"] block that follows. theme.js sets data-theme before the body parses. A colour that
     is not a token cannot follow the theme, so component rules never hold a literal colour; see docs/themes.md.

     Carbon Mint. Big Board palette: black-green ground, mint up/bid, coral down/ask, amber environment only.
     Control surfaces and their edges are carbon: a warm charcoal that leans toward the amber and pink, so a
     field, a chosen cell or a selected row never reads as a dimmed mint, and the mint stands out as the one
     cool colour. Each step keeps the luminance of the green-grey it replaced (2026-10-12). */
  --ground: #040605;
  --ground-rgb: 4 6 5;
  /* Paint ground surfaces with this fill, never the bare colour. Chrome draws a tile holding nothing but one flat
     colour as a solid-colour quad, and on macOS those quads render this near-black a visibly darker shade than
     rasterized tiles: black bars wherever a stretch of ground is empty (the 404 page, loading states, DAO,
     Trading). The transparent image layer keeps every tile rasterized; background-color overrides still show. */
  --ground-fill: linear-gradient(transparent, transparent) var(--ground);
  --bg: var(--ground);
  --bg-elevated: #100e0d;
  --bg-elevated-soft: #171513;
  --border-subtle: var(--text);
  --accent: var(--text);
  --accent-soft: rgb(var(--text-rgb) / .1);
  --danger: #ff5a6e;
  --danger-rgb: 255 90 110;
  --danger-soft: #ff8795;
  --danger-soft-rgb: 255 135 149;
  --danger-strong: #d8384f;
  /* The Sell fill's hover and the ink set on it. */
  --danger-soft-hover: #ffa0ab;
  --on-danger-soft: #250c12;
  --text: #ecf2ef;
  --text-rgb: 236 242 239;
  --text-soft: #aab5af;
  --text-soft-rgb: 170 181 175;
  --text-muted: #808b85;
  --positive: #3fe9a2;
  --positive-rgb: 63 233 162;
  --positive-soft: #8ff2c6;
  --on-positive: #02130b;
  --focus: #a3f7d2;
  /* Fills. --positive and --danger-soft are type and thin marks: prices, lines, lamps, meters. A filled thing
     (a button, the Buy or Sell key, a wash, selected text, the logo) takes the fill tokens, under the --on-
     inks. On the dark ground one mint and one pink do both jobs; on the light ground the same bright fills
     stay and the type takes deeper colours that can be read. A wash is written once, as
     rgb(var(--positive-fill-rgb) / calc(.16 * var(--positive-wash))), and is stronger where the fill is light. */
  --positive-fill: var(--positive);
  --positive-fill-rgb: var(--positive-rgb);
  --positive-fill-hover: var(--positive-soft);
  --positive-wash: 1;
  --danger-soft-fill: var(--danger-soft);
  --danger-soft-fill-rgb: var(--danger-soft-rgb);
  --danger-soft-wash: 1;
  /* Selected text is the primary pair, a mint fill under its dark ink; never a dark mint wash. */
  --selection: var(--positive-fill);
  --on-selection: var(--on-positive);
  --network-label: #f5b056;
  --network-label-rgb: 245 176 86;
  --control-foreground: var(--text);
  --rule-strong: #332f2c;
  --rule-bright: #524d49;
  /* Translucent overlays from the older base layer: a foreground tint for hover fills and a rule tint for
     hairlines. Each is the foreground of its theme, so the same alpha reads the same way on either ground. */
  --tint-rgb: 242 242 242;
  --tint-rule-rgb: 148 163 184;
  /* Shadows and dialog scrims: a colour and a strength, so one declaration is deep on black and soft on white. */
  --shadow-rgb: 0 0 0;
  --shadow-strength: 1;
  --scrim-rgb: 0 0 0;
  --scrim-strength: 1;
  --governance-strip: #0b1712;
  /* One-colour marks are black artwork: inverted to white on the dark ground, left as drawn on white. */
  --mono-invert: 1;
  --lockup-invert: .83;
  /* Bitcoin orange: the drawn blocks, and the ink of the word "Bitcoin" beside them. */
  --lb-btc: #ff931e;
  --lb-btc-ink: #ff931e;
  --lb-btc-rgb: 255 147 30;
  --lb-btc-core: rgb(117 69 16);
  /* The select chevron is drawn in text-soft; a data URI cannot read a token, so each theme carries its own. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23aab5af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  --font-sans: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Archivo", "Geist", system-ui, sans-serif;
  --fontfam-term: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Porcelain Mint: plain white and neutral greys, so the mint and the pink are the only colours on the screen.
   The roles are the dark theme's. Filled things keep the dark theme's own mint and pink, under dark ink: the
   buttons, the Buy and Sell keys, washes, selected text and the logo. Type cannot be that light on white, so
   price up and the Buy side in type are a deep emerald, and down, ask and sell a crimson; the brick red is
   errors; the dark amber is the environment and data warnings. Every step was checked for contrast on the
   ground, the field and the chosen fill (text and signals at 4.5:1 or better, ink on each fill likewise). */
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #ffffff;
  --ground-rgb: 255 255 255;
  --bg-elevated: #f6f6f6;
  --bg-elevated-soft: #f2f2f2;
  --danger: #c0271b;
  --danger-rgb: 192 39 27;
  --danger-soft: #bf2440;
  --danger-soft-rgb: 191 36 64;
  --danger-strong: #971d14;
  --danger-soft-hover: #ef7987;
  --on-danger-soft: #2b0810;
  --text: #131313;
  --text-rgb: 19 19 19;
  --text-soft: #4a4a4a;
  --text-soft-rgb: 74 74 74;
  --text-muted: #636363;
  --positive: #00754c;
  --positive-rgb: 0 117 76;
  --positive-soft: #005c3b;
  --on-positive: #03261a;
  --focus: #00754c;
  --positive-fill: #3fe9a2;
  --positive-fill-rgb: 63 233 162;
  --positive-fill-hover: #20d892;
  --positive-wash: 2.1;
  --danger-soft-fill: #ff8795;
  --danger-soft-fill-rgb: 255 135 149;
  --danger-soft-wash: 2;
  --network-label: #9a5600;
  --network-label-rgb: 154 86 0;
  --rule-strong: #cecece;
  --rule-bright: #a0a0a0;
  --tint-rgb: 19 19 19;
  --tint-rule-rgb: 107 107 107;
  --shadow-rgb: 38 38 38;
  --shadow-strength: .3;
  --scrim-rgb: 19 19 19;
  --scrim-strength: .55;
  --governance-strip: #d9fbec;
  --mono-invert: 0;
  --lockup-invert: .3;
  --lb-btc: #d9730d;
  --lb-btc-ink: #a85600;
  --lb-btc-rgb: 217 115 13;
  --lb-btc-core: rgb(255 226 190);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234a4a4a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  min-height: 100%;
  height: auto;
  /*font-family: var(--font-sans);*/
  /*background: radial-gradient(circle at top, #121826 0, #05070a 55%);*/
  background: var(--ground-fill);
  color: var(--text);
  font-family: "Geist", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

a {
  color: var(--text-soft);
  text-decoration: underline;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
  color: var(--accent); 
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, text-decoration 0.3s ease;
}

/* Layout */

.site-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 1.5rem;
  min-height: 54px;
  /*border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(to right, #05070a, #0b1019);*/
}

.header-left {
  display: flex;
  align-items: stretch;
  min-width: 0;
  position: relative;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-right: 0.75rem;
}

.header-menu {
  display: flex;
  align-items: stretch;
  min-height: 100%;
}

.header-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  padding: 0 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.header-menu-toggle::before {
  content: "";
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header-menu-toggle:hover,
.header-menu-toggle:focus-visible,
.site-header.menu-open .header-menu-toggle {
  background-color: var(--positive-fill);
  color: var(--on-positive);
  outline: none;
}

.header-menu-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.header-menu-link:hover,
.header-menu-link:focus-visible {
  background-color: var(--positive-fill);
  color: var(--on-positive);
  text-decoration: none;
  outline: none;
}

.logo-img {
  height: 30px;
  width: auto;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.env-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--network-label);
  line-height: 1.2;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.market-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: none;
}

.market-select {
  background: rgba(0,0,0,0);
  color: var(--text);
  border-radius: var(--radius-panel);
  border: 1px solid var(--border-subtle);
  padding: 10px 20px;
  font-size: 0.85rem;
display: none;
}

.market-select:focus {
  outline: none;
  border-color: var(--accent);
}

.wallet-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wallet-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 12px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(680px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid rgb(var(--tint-rgb) / 0.14);
  border-radius: var(--radius-panel);
  background: var(--terminal-control);
  box-shadow: 0 18px 40px rgb(var(--shadow-rgb) / calc(0.45 * var(--shadow-strength)));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.wallet-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.wallet-banner.is-hiding {
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
}

.wallet-banner[data-level="warn"] {
  border-color: rgb(var(--network-label-rgb) / .35);
}

.wallet-banner[data-level="error"] {
  border-color: rgb(var(--danger-rgb) / 0.45);
}

.wallet-banner-msg {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.wallet-banner-action {
  flex: 0 0 auto;
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 10px;
  padding: 0px 6px;
  min-height: calc(100vh - 120px);
}

.panel {
  /*background: radial-gradient(circle at top left, #151b28 0, #05070a 65%);*/
  background: var(--panel-fill);
  border-radius: var(--radius-panel);
  /*border: 1px solid rgb(var(--tint-rule-rgb) / 0.18);*/
  padding: 16px;
  /*box-shadow: 0 18px 40px rgb(var(--shadow-rgb) / calc(0.55 * var(--shadow-strength)));*/
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
}

.panel-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Token pair */

.token-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  /*background: rgba(17, 24, 39, 0.9);*/
  font-size: 0.8rem;
  display: none;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.token-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--panel-fill);
}

/* Orderbook */

.orderbook {
  display: block;           /* no need for flex here anymore */
  margin-top: 0.5rem;
  border-radius: 6px;
  background: var(--ground-fill);
  padding: 20px;
}

.orderbook-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;      /* ensures matching column widths */

  /*border-top: 1px solid rgb(var(--tint-rule-rgb) / 0.05);*/
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.05);
}

.orderbook-table thead {
  color: var(--text-muted);
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.05);
}

.orderbook-table th,
.orderbook-table td {
  padding: 0.18rem 0.15rem;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.orderbook-table th:first-child,
.orderbook-table td:first-child {
  /*text-align: left;*/         /* price + mid label left, everything else right */
}

/* Mid row now inside the table */
.mid-row td {
  padding-top: 4px;
  padding-bottom: 4px;
  border-top: 1px solid rgb(var(--tint-rule-rgb) / 0.05);
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.05);
  font-size: 0.75rem;
}

.mid-label-cell {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.mid-price-cell {
  /*font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;*/
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--accent);
  text-align: right;       /* aligns to the Price column */
}

/* Keep your bid/ask coloring */
.bid-row td:first-child {
  color: var(--positive-soft);
}

.ask-row td:first-child {
  color: var(--danger-soft);
}

.orderbook-table tbody tr {
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.orderbook-table tbody tr.bid-row,
.orderbook-table tbody tr.ask-row {
  cursor: pointer;
}

.orderbook-table tbody tr.bid-row:hover,
.orderbook-table tbody tr.ask-row:hover {
  background: rgb(var(--tint-rgb) / 0.16);
}


.mid-price {
  /*font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;*/
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--accent);
}


/* Trade panel */

.trade-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-form {
  border-radius: 6px;
  /*border: 1px solid rgb(var(--tint-rule-rgb) / 0.25);*/
  padding: 0.75rem;
  /*background: rgba(15, 23, 42, 0.8);*/
  background: var(--ground-fill);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.form-row > label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.form-input-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-panel);
  background: var(--ground-fill);
  transition: box-shadow 0.2s ease;
}

.form-input-wrapper:focus-within {
  box-shadow: inset 0 0 0 1px rgb(var(--tint-rgb) / 0.28);
}

.form-row input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  height: 51px;
  margin: 0;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--fontfam-term);
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.form-row input:not([type="checkbox"])::placeholder {
  color: var(--text-muted);
}

.form-row input:not([type="checkbox"]):focus {
  outline: none;
}

.form-row input::-webkit-outer-spin-button,
.form-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-row input[type="number"] {
  -moz-appearance: textfield;
}

.form-row-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.order-estimates {
  margin: -0.1rem 0 0.65rem;
}

.order-estimates .form-row-inline {
  margin-bottom: 0.28rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.order-estimates .form-row-inline:last-child {
  margin-bottom: 0;
}

.est-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#order-notional,
#order-expected-filled,
#order-estimated-quote-used,
#order-average-price,
#order-fill-type,
.order-estimate-value {
    /*font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;*/
  font-family: var(--fontfam-term);
}

.order-estimate-value {
  margin-left: auto;
  text-align: right;
}

.form-hint,
.form-mins {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Balances & activity */

.balances,
.activity {
  border-radius: 0.75rem;
  /*border: 1px solid rgb(var(--tint-rule-rgb) / 0.2);*/
  padding: 0.6rem 0.7rem;
  /*background: rgba(15, 23, 42, 0.7);*/
  background: var(--ground-fill);
}

.balances h3,
.activity h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}

.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  padding: 0.55rem 0.35rem;
  margin: 0 -0.35rem;
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.10);
  transition: background-color 0.2s ease;
}

.balance-row:hover {
  background: rgb(var(--tint-rgb) / 0.08);
}

.balance-row:last-child {
  border-bottom: none;
}

.balance-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  row-gap: 6px;
  gap: 10px;
}

.balance-value {
  /*font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;*/
  font-family: var(--fontfam-term);
}


.balance-group {
  margin: 0 -0.35rem;
}

.balance-group:last-child .balance-breakdown > .balance-row--detail:last-child {
  border-bottom: none;
}

.balance-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.balance-expand-btn {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.balance-expand-btn svg {
  transition: transform 0.2s ease;
}

.balance-expand-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.balance-expand-spacer {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.balance-breakdown {
  margin-top: -0.15rem;
  padding-bottom: 0.15rem;
}

.balance-row--detail {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.76rem;
  background: rgb(var(--tint-rgb) / 0.02);
}

.balance-row--detail:hover {
  background: rgb(var(--tint-rgb) / 0.06);
}

.balance-row.is-busy {
  background: rgb(var(--tint-rgb) / 0.08);
}

.balance-busy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--tint-rgb) / 0.12);
  background: rgb(var(--tint-rgb) / 0.05);
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}

.balance-busy-spinner {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.6px solid rgb(var(--tint-rgb) / 0.18);
  border-top-color: currentColor;
  animation: pendingOrderSpin 0.8s linear infinite;
}

.balance-wrap-btn,
.balance-unwrap-btn {
  color: var(--text-soft);
}

.balance-wrap-btn:hover:not(:disabled),
.balance-unwrap-btn:hover:not(:disabled) {
  background: rgb(var(--tint-rgb) / 0.08) !important;
  color: var(--accent);
}

.wrap-token-note {
  margin-top: 0.55rem;
  min-height: 1em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.activity-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  max-height: 120px;
  overflow-y: auto;
}

.activity-log li + li {
  margin-top: 0.2rem;
}

/* Landing footer link icons */

.footer-link-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: currentColor; }

/* Buttons */

.btn {
  border-radius: var(--radius-panel);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  /*transition: transform 0.05s ease, box-shadow 0.05s ease,
    background 0.15s ease, color 0.15s ease;*/
  border-color: var(--control-foreground);
  border-width: 1px;
  border-style: solid;
  background-color: transparent;
  color: var(--control-foreground);
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.btn:not(:disabled):hover {
  color: var(--text);
  background-color: var(--terminal-raised);
  border-color: var(--rule-bright);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn.primary-btn {
  /*background: var(--accent);*/
  /*color: #020617;*/
  /*box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);*/
}

.btn.primary-btn:not(:disabled):hover {
  color: var(--text);
  background-color: var(--terminal-raised);
  border-color: var(--rule-bright);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn.ghost-btn {
  border: 1px solid var(--border-subtle);
  /*color: var(--text-soft);*/
}

.btn.ghost-btn:not(:disabled):hover {
  color: var(--text);
  background-color: var(--terminal-raised);
  border-color: var(--rule-bright);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn.full-width {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
  color: rgb(var(--tint-rgb) / 0.42);
  border-color: rgb(var(--tint-rgb) / 0.18);
  background-color: transparent;
  box-shadow: none;
  filter: none;
}

.btn.danger-btn:disabled,
.btn.danger-btn[disabled] {
  color: rgb(var(--danger-rgb) / 0.46);
  border-color: rgb(var(--danger-rgb) / 0.24);
  background: transparent;
}


/* Modals */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(var(--scrim-rgb) / calc(0.7 * var(--scrim-strength)));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

.modal {
  background: var(--panel-fill);
  border-radius: var(--radius-panel);
  padding: 1rem 1.1rem;
  width: 100%;
  max-width: 380px;
  /*border: 1px solid rgb(var(--tint-rule-rgb) / 0.4);
  box-shadow: 0 18px 45px rgb(var(--shadow-rgb) / calc(0.7 * var(--shadow-strength)));*/
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.modal p {
  margin-top: 0;
  font-size: 0.85rem;
}

.confirm-details {
  margin: 0.4rem 0 0.6rem;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 15px;
}

.tx-hash-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tx-hash {
  font-size: 0.78rem;
  /*font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;*/
  font-family: var(--fontfam-term);
  word-break: break-all;
}

/* Responsive */

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .top-nav {
    order: 3;
  }
}

@media (max-width: 768px) {
  .site-header {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
  }

  .header-left {
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
  }

  .logo-area {
    padding-right: 0.25rem;
  }

  .header-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
    padding: 0 0.85rem;
  }

  .header-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: min(18rem, calc(100vw - 3rem));
    flex-direction: column;
    align-items: stretch;
    background: var(--panel-fill);
    border-radius: var(--radius-panel);
    overflow: hidden;
    box-shadow: 0 18px 36px rgb(var(--shadow-rgb) / calc(0.45 * var(--shadow-strength)));
    z-index: 80;
  }

  .site-header.menu-open .header-menu {
    display: flex;
  }

  .header-menu-link {
    height: auto;
    min-height: 48px;
    padding: 0.75rem 1rem;
  }

  .header-menu-link + .header-menu-link {
    border-top: 1px solid rgb(var(--tint-rgb) / 0.08);
  }

  .wallet-area {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
  }

  #connect-wallet-btn {
    white-space: nowrap;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .logo-img {
    height: 28px;
  }

  .header-menu-toggle {
    padding: 0 0.75rem;
    font-size: 0.9rem;
  }

  #connect-wallet-btn {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .site-header {
    gap: 0.35rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .logo-img {
    height: 26px;
  }

  .header-menu-toggle {
    padding: 0 0.6rem;
    gap: 0.4rem;
  }

  #connect-wallet-btn {
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
  }
}




/* Shared overlay container */
.market-overlay,
.wallet-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
  width: 100%;
}

.market-overlay.visible,
.wallet-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Shared backdrop */
.market-overlay-backdrop,
.wallet-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ground-fill);
}

/* Content, header, list, etc stay exactly as you had */
.market-overlay-content {
  position: relative;
  margin-top: 40px;          /* appears from top of page */
  width: 100%;
  max-width: 640px;
  background: var(--ground-fill);
  border-radius: var(--radius-panel);
  padding: 16px 20px 12px;
  transform: translateY(-6px);
  transition: transform 200ms ease-out;
}

.market-overlay.visible .market-overlay-content,
.wallet-overlay.visible .market-overlay-content {
  transform: translateY(0);
}

.market-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.market-overlay-title h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.market-overlay-title p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.market-overlay-close-btn {
  font-size: 0.8rem;
  padding-inline: 0.8rem;
}

/* List style reused for both markets and wallets */
.market-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.market-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.market-list-item:hover {
  background-color: var(--control-foreground);
  color: var(--ground);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.market-list-item:last-child {
  border-bottom: none;
}

.market-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.market-list-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.market-list-symbols {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.market-list-network {
  font-size: 0.75rem;
  color: var(--text-muted);
}




/* Make the orderbook title clickable */
#market-title {
  display: flex;              /* makes icon + text align nicely */
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

#market-title::before{
  content: "";
  width: 1em;              /* scales with font-size */
  height: 1em;
  background: currentColor; /* icon color */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

#market-title:hover {
  background-color: var(--control-foreground);
  color: var(--ground);
  transition: background-color 0.3s ease, color 0.3s ease;
}



/* =============================================================
   Ledger derivation path step (wallet overlay)
   ============================================================= */

.ledger-step {
  padding: 0;
  margin: 0;
}

.ledger-path-card {
  background: var(--ground-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  border-radius: var(--radius-panel);
  padding: 14px;
}

.ledger-path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ledger-path-label div {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
  font-family: "Geist", sans-serif;
}

.ledger-path-label input {
  width: 100%;
  background: var(--ground-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.22);
  border-radius: var(--radius-panel);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--fontfam-term);
}

.ledger-path-label input:focus {
  outline: none;
  border-color: var(--accent);
}

.ledger-path-preview-wrap {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ledger-path-preview-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ledger-path-preview {
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  text-align: right;
}

.ledger-path-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ledger-status {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

.ledger-preview {
  margin-top: 0.75rem;
  border-top: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ledger-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.ledger-preview-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ledger-preview-value {
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: right;
  word-break: break-all;
}

.ledger-address-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.ledger-address-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--text-soft);
}

.ledger-address-item:last-child {
  border-bottom: none;
}

.ledger-address-item:hover {
  background: rgb(var(--tint-rgb) / 0.08);
}

.ledger-address-item.selected {
  background: rgb(var(--tint-rgb) / 0.16);
  color: var(--accent);
}

.ledger-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

/* =============================================================
   Send token overlay
   ============================================================= */

.send-token-card {
  background: var(--ground-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  border-radius: var(--radius-panel);
  padding: 14px;
}

.send-token-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.send-token-balance-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.send-token-balance-value {
  font-family: var(--fontfam-term);
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-word;
  text-align: right;
}

.send-token-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.send-label,
.send-field {
  display: flex;
  flex-direction: column;
}

.send-label > div,
.send-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
  font-family: "Geist", sans-serif;
}

.send-label input {
  width: 100%;
  background: var(--ground-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.22);
  border-radius: var(--radius-panel);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--fontfam-term);
}

.send-label input:focus {
  outline: none;
  border-color: var(--accent);
}

.send-input-wrapper input {
  display: block;
  width: 100%;
  height: 51px;
  margin: 0;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--fontfam-term);
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.send-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.send-input-wrapper input:focus {
  outline: none;
}

.send-input-wrapper input::-webkit-outer-spin-button,
.send-input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.send-input-wrapper input[type="number"] {
  -moz-appearance: textfield;
}


.send-token-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

.send-token-status {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

.send-token-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .balance-row {
    align-items: flex-start;
  }

  .balance-actions {
    max-width: 68%;
    gap: 8px;
  }

  .balance-busy-pill {
    order: 1;
  }
}

@media (max-width: 480px) {
  .ledger-path-grid {
    grid-template-columns: 1fr;
  }

  .ledger-footer {
    flex-direction: column;
  }

  .ledger-footer .btn {
    width: 100%;
  }

  .send-token-footer {
    flex-direction: column;
  }

  .send-token-footer .btn {
    width: 100%;
  }
}


[hidden] {
  display: none !important;
}

/* =============================================================
   Orders panel (full width under orderbook + order entry)
   ============================================================= */

.orders-panel {
  grid-column: 1 / -1;
}

.orders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: start;
}

.orders-main,
.fills-card {
  background: var(--ground-fill);
  border-radius: var(--radius-panel);
  padding: 10px;
}

.orders-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.orders-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
}

.orders-table-wrap {
  border-radius: var(--radius-panel);
  overflow-x: auto;
  background: var(--ground-fill);
  padding: 10px;
}

.fills-card-header {
  margin-bottom: 0.6rem;
}

.fills-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.orders-main-header {
  margin-bottom: 0.6rem;
}

.orders-main-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.fills-card .panel-subtitle {
  margin-top: 0.2rem;
}

.fills-empty {
  padding-top: 0.2rem;
}

.orders-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.balance-transfer-btn {
  color: var(--text-soft);
}

.balance-transfer-btn:hover:not(:disabled) {
  background: rgb(var(--tint-rgb) / 0.08) !important;
  color: var(--accent);
}

.balance-transfer-btn:disabled {
  color: rgb(var(--tint-rgb) / 0.36);
  opacity: 0.5;
}

.balance-withdraw-btn {
  color: var(--text-soft);
}

.balance-withdraw-btn:hover:not(:disabled) {
  background: rgb(var(--tint-rgb) / 0.08) !important;
  color: var(--accent);
}

.balance-withdraw-btn:disabled {
  color: rgb(var(--tint-rgb) / 0.36);
  opacity: 0.5;
}

.modal-option-check {
  margin-top: 0.75rem;
}

.modal-option-hint {
  margin: 0.4rem 0 0;
  min-height: 1em;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.send-token-option {
  margin-top: 0.75rem;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.orders-table thead {
  color: var(--text-muted);
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
}

.orders-table th,
.orders-table td {
  padding: 0.45rem 0.35rem;
  white-space: nowrap;
  text-align: right;
  font-family: var(--fontfam-term);
}

.orders-table th:first-child,
.orders-table td:first-child {
  text-align: left;
  font-family: "Geist", sans-serif;
}

.orders-table tbody tr {
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.10);
  transition: background-color 0.2s ease;
}

.orders-table tbody tr:hover {
  background: rgb(var(--tint-rgb) / 0.08);
}

.orders-id {
  font-family: var(--fontfam-term);
  color: var(--text-soft);
}

.orders-side.buy {
  color: var(--positive-soft);
  font-weight: 600;
}

.orders-side.sell {
  color: var(--danger-soft);
  font-weight: 600;
}

.orders-status {
  color: var(--text-soft);
  font-family: "Geist", sans-serif;
}

.orders-updated {
  color: var(--text-muted);
  font-family: "Geist", sans-serif;
  font-size: 0.78rem;
}

.orders-actions-cell {
  text-align: right;
}

.orders-actions-cell--empty {
  color: var(--text-muted);
}

.orders-row--pending {
  background: rgb(var(--tint-rgb) / 0.03);
}

.orders-row--pending:hover {
  background: rgb(var(--tint-rgb) / 0.06);
}

.orders-id--pending {
  color: var(--accent);
}

.pending-order-link,
.pending-order-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pending-order-link:hover {
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--accent);
}

.orders-status.pending {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.orders-status--partial {
  color: var(--accent);
}

.orders-status--replacing {
  color: var(--network-label);
  font-weight: 500;
}

.orders-status--canceling {
  color: var(--danger);
  font-weight: 500;
}

@keyframes pendingOrderSpin {
  to {
    transform: rotate(360deg);
  }
}

.btn.small-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn.danger-btn {
  border-color: rgb(var(--danger-rgb) / 0.75);
  color: var(--danger);
}

.btn.danger-btn:not(:disabled):hover {
  background: var(--danger);
  color: var(--ground);
}

/* Replace modal */
.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* Order options (post-only / IOC / FOK) */
.order-options {
  margin-top: 0.2rem;
}

.order-options-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.order-options-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem 0.65rem;
  align-items: stretch;
}

.order-options-grid .option-check {
  height: 100%;
}

.option-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.2;
  user-select: none;
  height: auto !important;
  margin-bottom: 0;
}



.order-options-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

@media (max-width: 1180px) {
  .orders-grid {
    grid-template-columns: 1fr;
  }
}


/* =============================================================
   v4 UI refinements
   ============================================================= */


.option-check {
  padding: 9px 11px;
  border: 1px solid rgb(var(--tint-rgb) / 0.10);
  border-radius: var(--radius-panel);
  background: rgb(var(--tint-rgb) / 0.02);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  margin-bottom: 0;
}

.option-check:hover {
  border-color: rgb(var(--tint-rgb) / 0.2);
  background: rgb(var(--tint-rgb) / 0.05);
  color: var(--accent);
}

.option-check span {
  display: block;
  line-height: 1.2;
}







@supports selector(.option-check:has(input:checked)) {
  .option-check:has(input:checked) {
    border-color: rgb(var(--tint-rgb) / 0.24);
    background: rgb(var(--tint-rgb) / 0.06);
    color: var(--accent);
  }

  .option-check:has(input[disabled]) {
    opacity: 0.65;
  }
}

#submit-order-btn[data-side="buy"]:not(:disabled):hover,
#submit-order-btn[data-side="buy"]:not(:disabled):focus-visible {
  background-color: var(--positive-fill);
  border-color: var(--positive-fill);
  color: var(--on-positive);
}

#submit-order-btn[data-side="sell"]:not(:disabled):hover,
#submit-order-btn[data-side="sell"]:not(:disabled):focus-visible {
  background-color: var(--danger-soft-hover);
  border-color: var(--danger-soft-hover);
  color: var(--on-danger-soft);
}

#orders-title,
.fills-card-header h3 {
  margin: 0;
}

@media (max-width: 680px) {
}


/* =============================================================
   v5 UI refinements
   ============================================================= */

.market-panel-header {
  margin-bottom: 0.75rem;
}

.orderbook {
  margin-top: 0;
}

.section-card-header,
.fills-card-header,
.orders-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.section-card-header h3,
.fills-card-header h3,
.orders-main-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.orderbook-card-header {
  margin-bottom: 0.8rem;
}

.order-form-header {
  margin-bottom: 0.75rem;
}

.orderbook-table thead th,
.orders-table thead th {
  font-family: "Geist", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
}

.orders-table td {
  font-family: var(--fontfam-term);
}

.orders-table td:first-child {
  font-family: "Geist", sans-serif;
}


.order-options-hint {
  display: block;
  min-height: 1.2em;
  white-space: normal;
}

#market-title {
  width: fit-content;
  padding: 0.15rem 0.4rem;
  margin: -0.15rem -0.4rem;
  border-radius: var(--radius-panel);
}

#market-title::before {
  content: none;
}

#market-title::after {
  content: "";
  width: 0.9em;
  height: 0.9em;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.78;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.market-filter-wrap {
  display: block;
  margin: 0 0 0.75rem;
}

.market-filter-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.market-filter-input {
  width: 100%;
  background: var(--panel-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.22);
  border-radius: var(--radius-panel);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: "Geist", sans-serif;
}

.market-filter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.market-filter-empty {
  margin: -0.1rem 0 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}


/* =============================================================
   v6 layout rework
   ============================================================= */

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px) minmax(300px, 380px);
  gap: 10px;
  padding: 0 6px 10px;
  min-height: calc(100vh - 120px);
  align-items: start;
}

.orders-panel,
.orderbook-panel,
.fills-panel,
.trade-panel,
.market-stack {
  min-width: 0;
}

.orders-panel {
  grid-column: 1;
}

.market-stack {
  grid-column: 2;
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
  max-width: 430px;
}

.trade-panel {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
  justify-self: stretch;
}

.orders-main,
.fills-card,
.order-form,
.balances,
.activity,
.orderbook {
  width: 100%;
}

.fills-panel {
  padding: 16px;
}

.fills-panel .fills-card {
  margin: 0;
}

.order-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.5rem;
  align-items: stretch;
}

.order-options-grid .option-check {
  height: 100%;
  min-height: 52px;
}

@media (max-width: 1320px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }

  .orders-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .market-stack {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
  }

  .trade-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    max-width: none;
  }
}

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .orders-panel,
  .market-stack,
  .trade-panel {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 560px) {
  .order-options-grid {
    grid-template-columns: 1fr;
  }
}


/* =============================================================
   Rootstock branding + market stats + trades toggle
   ============================================================= */

#connect-wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.connect-wallet-btn__content {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.connect-wallet-btn__logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 145, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 145, 0, 0.24);
  flex: 0 0 auto;
}

.connect-wallet-btn__logo {
  width: 14px;
  height: 14px;
  display: block;
}

.connect-wallet-btn__label {
  display: inline-block;
  white-space: nowrap;
}

#connect-wallet-btn.is-connected .connect-wallet-btn__logo-wrap {
  background: rgb(var(--tint-rgb) / 0.08);
  box-shadow: inset 0 0 0 1px rgb(var(--tint-rgb) / 0.14);
}

#connect-wallet-btn:not(:disabled):hover .connect-wallet-btn__logo-wrap,
#connect-wallet-btn:not(:disabled):focus-visible .connect-wallet-btn__logo-wrap {
  background: rgba(10, 10, 10, 0.08);
  box-shadow: inset 0 0 0 1px rgba(10, 10, 10, 0.12);
}

.market-panel-header {
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.market-panel-heading {
  min-width: 0;
}

.market-stats {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-left: auto;
}

.market-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.14rem;
  min-width: 118px;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-panel);
  background: var(--ground-fill);
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.14);
}

.market-stat-label {
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.market-stat-value {
  font-family: var(--fontfam-term);
  font-size: 0.96rem;
  color: var(--accent);
}

.market-stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wallet-brand-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.wallet-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wallet-brand-lockup {
  display: block;
  width: auto;
  height: 28px;
  max-width: 100%;
}

.wallet-brand-link:hover .wallet-brand-lockup,
.wallet-brand-link:focus-visible .wallet-brand-lockup {
  opacity: 0.9;
}

.wallet-brand-link:focus-visible {
  outline: none;
}

.wallet-network-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
}

.orderbook-panel-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.section-toggle-heading {
  margin: 0;
}

.section-title-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.16rem 0.42rem;
  margin: -0.16rem -0.42rem;
  border: none;
  border-radius: var(--radius-panel);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.section-title-toggle:hover,
.section-title-toggle:focus-visible {
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--accent);
  outline: none;
}

.section-title-toggle__swap {
  width: 0.9em;
  height: 0.9em;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10l-2.5-2.5M17 17H7l2.5 2.5M17 7l-3.5-3.5M7 17l3.5 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10l-2.5-2.5M17 17H7l2.5 2.5M17 7l-3.5-3.5M7 17l3.5 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.orderbook-view-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.orderbook-content-view,
.orderbook-trades-view {
  min-height: 270px;
}

.orderbook-trades-head,
.trade-row {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(82px, 0.84fr) minmax(92px, 0.94fr);
  gap: 0.55rem;
  align-items: center;
}

.orderbook-trades-head {
  padding: 0 0.2rem 0.45rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
}

.orderbook-trades-head span:nth-child(2),
.orderbook-trades-head span:nth-child(3),
.trade-price,
.trade-amount {
  justify-self: end;
  text-align: right;
}

.orderbook-trades-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.trade-row {
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.10);
  transition: background-color 0.2s ease;
}

.trade-row:hover {
  background: rgb(var(--tint-rgb) / 0.08);
}

.trade-row:last-child {
  border-bottom: none;
}

.trade-time {
  font-family: var(--fontfam-term);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.trade-price,
.trade-amount {
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
}

.trade-row--up .trade-price {
  color: var(--positive-soft);
}

.trade-row--down .trade-price {
  color: var(--danger-soft);
}

.trade-row--flat .trade-price {
  color: var(--text-soft);
}

.orderbook-trades-empty {
  padding-top: 0.25rem;
}

@media (max-width: 768px) {
  .market-stats {
    width: 100%;
    margin-left: 0;
  }

  .market-stat {
    min-width: 0;
    width: 100%;
    align-items: flex-start;
  }

  .wallet-brand-lockup {
    height: 24px;
  }
}

@media (max-width: 560px) {
  .orderbook-trades-head,
  .trade-row {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr) minmax(0, 0.95fr);
    gap: 0.45rem;
  }
}

/* v7 order-management + stats refinements */
.orders-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.orders-cancel-all-btn {
  white-space: nowrap;
}

.market-stats .market-stat {
  min-width: 124px;
}

@media (max-width: 768px) {
  .orders-main-header {
    align-items: flex-start;
  }

  .orders-header-actions {
    width: auto;
    margin-left: auto;
  }

  .orders-cancel-all-btn {
    padding-inline: 0.75rem;
  }

  .market-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .market-stats {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   v7 selector + order max refinements
   ============================================================= */


.market-filter-wrap--compact {
  margin-bottom: 0.65rem;
}

.market-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.15rem;
  border-radius: var(--radius-panel);
  background: var(--panel-fill);
}

.market-type-tab {
  appearance: none;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.market-type-tab:hover,
.market-type-tab:focus-visible,
.market-type-tab.active {
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--accent);
  outline: none;
}

.market-list--table {
  border-top: 1px solid rgb(var(--tint-rule-rgb) / 0.10);
}

.market-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.7fr) minmax(84px, 0.85fr) minmax(108px, 1fr) minmax(82px, 0.85fr);
  gap: 0.8rem;
  align-items: center;
}

.market-list-header {
  padding: 0 0.2rem 0.45rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
}

.market-sort-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  text-align: right;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.market-sort-btn:first-child {
  text-align: left;
}

.market-sort-btn:hover,
.market-sort-btn:focus-visible,
.market-sort-btn.active {
  color: var(--accent);
  outline: none;
}

.market-sort-btn.active::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.35rem;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: translateY(-0.14em) rotate(45deg);
  opacity: 0.78;
}

.market-sort-btn.active[data-sort-dir="asc"]::after {
  transform: translateY(0.12em) rotate(225deg);
}

.market-list--table .market-list-item {
  padding: 0.72rem 0.2rem;
}

.market-list--table .market-list-main {
  min-width: 0;
}

.market-list-stat {
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--fontfam-term);
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: right;
}

.market-list-stat--up {
  color: var(--positive-soft);
}

.market-list-stat--down {
  color: var(--danger-soft);
}

.market-list-stat--flat {
  color: var(--text-soft);
}

@media (max-width: 680px) {

  .market-list-row {
    grid-template-columns: minmax(150px, 1.5fr) minmax(74px, 0.85fr) minmax(88px, 0.95fr) minmax(74px, 0.85fr);
    gap: 0.55rem;
  }

  .market-sort-btn,
  .market-list-stat {
    font-size: 0.75rem;
  }
}

@media (max-width: 520px) {
  .market-overlay-content {
    max-width: calc(100vw - 20px);
    padding-left: 14px;
    padding-right: 14px;
  }

  .market-list-row {
    grid-template-columns: minmax(150px, 1fr) minmax(74px, 0.7fr) minmax(76px, 0.75fr) minmax(68px, 0.65fr);
    gap: 0.45rem;
  }

  .market-list-name,
  .market-list-symbols {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* =============================================================
   v7 compact controls + single-page menu refinements
   ============================================================= */
.header-menu-toggle {
  min-height: 54px;
  border-radius: 0;
  font-weight: 400;
}

.header-menu-toggle::before {
  content: none;
}

.header-menu-link.is-active {
  color: var(--accent);
}

.header-menu-link.is-active:hover,
.header-menu-link.is-active:focus-visible {
  background-color: var(--positive-fill);
  color: var(--on-positive);
}

.page-shell {
  padding: 0 6px 10px;
  min-height: calc(100vh - 120px);
}

.page-placeholder-card {
  min-height: min(420px, calc(100vh - 160px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.65rem;
}

.page-placeholder-card h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
}

.page-placeholder-card p {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 0.95rem;
}


.order-options-grid {
  gap: 0.35rem;
}

.order-options-grid .option-check {
  min-height: 38px;
}

.order-options .option-check {
  padding: 6px 8px;
  gap: 0.35rem;
  border-radius: var(--radius-panel);
  font-size: 0.75rem;
}



@media (max-width: 768px) {
  .header-menu-toggle {
    height: auto;
    min-height: 54px;
    padding: 0 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 680px) {
}


/* =============================================================
   v8 selected-menu indicator + persistent activity column
   ============================================================= */
.header-menu-link {
  position: relative;
}

.header-menu-link.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--positive-fill);
  pointer-events: none;
}

#market-title {
  border-radius: 5px;
}

.main-layout > .page-shell {
  grid-column: 1 / span 2;
  padding: 0;
  min-height: auto;
  width: 100%;
}

.main-layout > .page-shell .page-placeholder-card {
  min-height: min(420px, calc(100vh - 160px));
}

.main-layout--page .trade-panel--activity-only {
  align-self: start;
}

.trade-panel--activity-only .activity {
  flex: 0 0 auto;
}

@media (max-width: 1320px) {
  .main-layout > .page-shell {
    grid-column: 1;
    grid-row: 1;
  }

  .main-layout--page .trade-panel--activity-only {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 960px) {
  .main-layout > .page-shell,
  .main-layout--page .trade-panel--activity-only {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    justify-self: stretch;
  }
}

/* =============================================================
   Series Notes page
   ============================================================= */
.series-notes-page {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: min(640px, calc(100vh - 130px));
}

.series-notes-header,
.series-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.series-notes-header h1,
.series-detail-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 500;
}

.series-notes-header p,
.series-detail-header p,
.series-notes-filter-copy {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.series-notes-selected {
  flex: 0 0 auto;
  max-width: 280px;
  border-radius: 999px;
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--text-soft);
  padding: 0.45rem 0.75rem;
  font-family: var(--fontfam-term);
  font-size: 0.76rem;
  text-align: right;
}

.series-notes-tabs {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  padding: 0.15rem;
  border-radius: var(--radius-panel);
  background: var(--ground-fill);
}

.series-notes-tab {
  appearance: none;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.series-notes-tab:hover,
.series-notes-tab:focus-visible,
.series-notes-tab.active {
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--accent);
  outline: none;
}

.series-notes-list-head,
.series-pool-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(112px, 0.9fr)) minmax(128px, 0.9fr);
  gap: 0.85rem;
  align-items: center;
}

.series-notes-list-head {
  padding: 0.45rem 0.4rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  font-size: 0.75rem;
}

.series-notes-list-head span:not(:first-child) {
  text-align: right;
}

.series-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.series-pool-row {
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.12);
  border-radius: var(--radius-panel);
  padding: 0.75rem 0.7rem;
  background: var(--ground-fill);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.series-pool-row:hover,
.series-pool-row:focus-visible {
  border-color: rgb(var(--tint-rgb) / 0.28);
  background: rgb(var(--tint-rgb) / 0.06);
  outline: none;
}

.series-pool-row.is-selected {
  border-color: rgb(var(--positive-rgb) / 0.85);
  box-shadow: inset 3px 0 0 var(--positive-fill);
}

.series-pool-main {
  min-width: 0;
}

.series-pool-title-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.series-pool-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.93rem;
  font-weight: 500;
}

.series-pool-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.series-status-pill,
.series-on-run {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}

.series-status-pill--active,
.series-on-run {
  background: rgb(var(--positive-fill-rgb) / calc(0.16 * var(--positive-wash)));
  color: var(--positive-soft);
}

.series-status-pill--matured {
  background: rgb(var(--tint-rgb) / 0.10);
  color: var(--text-muted);
}

.series-pool-metric,
.series-pool-market {
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-family: var(--fontfam-term);
  font-size: 0.79rem;
  text-align: right;
}

.series-placeholder {
  color: var(--text-muted);
}

.series-trade-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font: inherit;
  font-family: var(--fontfam-term);
  font-size: 0.79rem;
  text-decoration: underline;
  cursor: pointer;
}

.series-trade-link:hover,
.series-trade-link:focus-visible {
  color: var(--positive-soft);
  text-decoration: none;
  outline: none;
}

.series-notes-detail {
  margin-top: 0.25rem;
  border-top: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
  padding-top: 0.9rem;
}

.series-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.series-detail-item {
  min-width: 0;
  border-radius: var(--radius-panel);
  background: var(--ground-fill);
  padding: 0.65rem 0.7rem;
}

.series-detail-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.28rem;
}

.series-detail-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-family: var(--fontfam-term);
  font-size: 0.82rem;
  font-weight: 400;
}

@media (max-width: 1180px) {
  .series-notes-list-head {
    display: none;
  }

  .series-pool-row {
    grid-template-columns: minmax(0, 1fr) minmax(128px, auto);
  }

  .series-pool-main {
    grid-column: 1 / -1;
  }

  .series-pool-metric,
  .series-pool-market {
    justify-self: stretch;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
  }

  .series-pool-metric::before,
  .series-pool-market::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-family: "Geist", sans-serif;
    font-size: 0.75rem;
    text-align: left;
  }

  .series-detail-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  .series-notes-header,
  .series-detail-header {
    flex-direction: column;
  }

  .series-notes-selected {
    max-width: none;
    text-align: left;
  }

  .series-notes-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .series-pool-row,
  .series-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =============================================================
   Aera DAO page
   ============================================================= */
.aera-dao-page {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 1rem;
  min-height: min(640px, calc(100vh - 130px));
}

.dao-side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.1rem 0.55rem 0.1rem 0;
  border-right: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
}

.dao-side-nav-link {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: var(--radius-panel) 0 0 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  padding: 0.65rem 1rem 0.65rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

.dao-side-nav-link:hover,
.dao-side-nav-link:focus-visible {
  background-color: var(--positive-fill);
  color: var(--on-positive);
  outline: none;
}

.dao-side-nav-link.is-active {
  color: var(--accent);
}

.dao-side-nav-link.is-active::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  right: -0.56rem;
  bottom: 0.45rem;
  width: 2px;
  border-radius: 2px;
  background: var(--positive-fill);
  pointer-events: none;
}

.dao-side-nav-link.is-active:hover,
.dao-side-nav-link.is-active:focus-visible {
  background-color: var(--positive-fill);
  color: var(--on-positive);
}

.dao-main-panel {
  min-width: 0;
  border-radius: var(--radius-panel);
  background: var(--ground-fill);
  padding: 1.15rem;
}

.dao-main-kicker {
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-family: var(--fontfam-term);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dao-main-panel h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 500;
}

.dao-main-panel > p {
  margin: 0.35rem 0 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dao-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.dao-placeholder-card {
  min-width: 0;
  min-height: 132px;
  border: 1px solid rgb(var(--tint-rule-rgb) / 0.12);
  border-radius: var(--radius-panel);
  background: var(--panel-fill);
  padding: 0.8rem;
}

.dao-placeholder-card span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.18rem 0.45rem;
}

.dao-placeholder-card strong {
  display: block;
  margin-top: 0.65rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.dao-placeholder-card p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .dao-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .aera-dao-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .dao-side-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgb(var(--tint-rule-rgb) / 0.18);
    padding: 0 0 0.55rem;
  }

  .dao-side-nav-link {
    flex: 0 0 auto;
    width: auto;
    border-radius: var(--radius-panel);
    white-space: nowrap;
  }

  .dao-side-nav-link.is-active::after {
    top: auto;
    left: 0.7rem;
    right: 0.7rem;
    bottom: -0.56rem;
    width: auto;
    height: 2px;
  }

  .dao-placeholder-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Task context and compact controls shared across the operational screens. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ground-fill);
}
.mobile-trading-nav { display: none; }
.mobile-trading-nav[hidden] { display: none; }
.empty-state-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
fieldset.order-options { min-width: 0; margin: 1rem 0; padding: 0; border: 0; }
.order-options legend { padding: 0; color: var(--text-soft); font-size: 0.875rem; font-weight: 500; }
.option-group-help { margin: 0.4rem 0 0.65rem; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.45; }
.order-options .option-check { font-size: 0.8125rem; }
.order-options .option-check input:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; box-shadow: none; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.header-menu-toggle:focus-visible, .header-menu-link:focus-visible, .dao-side-nav-link:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
#orders-panel, #orderbook-panel, #order-form, #series-notes-page { scroll-margin-top: 5.5rem; }
#orders-panel:focus-visible, #orderbook-panel:focus-visible, #order-form:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 3px; }

@media (max-width: 768px) {
  .site-header { min-height: 72px; padding-top: 0; padding-bottom: 0; }
  .logo-area { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.2rem; }
  .env-tag { font-size: 0.75rem; padding: 0.1rem 0.3rem; }
  .mobile-trading-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: sticky;
    top: 72px;
    z-index: 30;
    padding: 0.35rem 0.75rem;
    gap: 0.4rem;
    background: var(--ground-fill);
    border-bottom: 1px solid rgb(var(--tint-rgb) / 0.18);
  }
  .mobile-trading-nav button {
    min-height: 44px;
    padding: 0.5rem 0.35rem;
    border: 1px solid rgb(var(--tint-rgb) / 0.25);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
  }
  .mobile-trading-nav button:hover { background: var(--accent-soft); }
  #orders-panel, #orderbook-panel, #order-form { scroll-margin-top: 140px; }
  .market-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .market-stat { min-width: 0; align-items: flex-start; padding: 0.55rem; overflow-wrap: anywhere; }
  .orderbook-content-view, .orderbook-trades-view { min-height: 0; }
  .orderbook-panel .orderbook { min-height: 0; }
  .order-options-grid { grid-template-columns: minmax(0, 1fr); }
  .order-options-grid .option-check { min-height: 44px; }
  .btn, .small-btn, .toggle-btn, .series-notes-tab,
  .dao-side-nav-link, .section-title-toggle { min-height: 44px; }
  .page-shell, .series-notes-page, .aera-dao-page, .page-placeholder-card { min-height: 0; }
  .empty-state-actions { flex-direction: column; align-items: stretch; }
}
