.market-workspace-header { display: contents; }

@media (min-width: 1024px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  html body { padding-bottom: 0; background: #05080c; }
  .market-shell { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 340px); grid-template-rows: 52px minmax(0, 1fr); width: 100vw; height: 100dvh; min-height: 0; overflow: hidden; background: #05080c; }
  .market-topbar { position: relative; display: flex !important; grid-column: 1 / -1; grid-row: 1; min-height: 52px; padding: 5px 10px; border-color: rgba(124, 143, 164, .16); background: #080d13; backdrop-filter: none; }
  .market-back, .top-action { width: 36px; height: 36px; border-radius: 8px; }
  .market-brand__mark { width: 31px; height: 31px; border-radius: 8px; }
  .market-main { grid-column: 1; grid-row: 2; display: grid !important; grid-template-rows: 50px minmax(0, 1fr); gap: 8px; width: 100%; max-width: none; min-width: 0; min-height: 0; margin: 0; padding: 8px 8px 10px 10px; overflow: hidden; }
  .market-workspace-header { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(430px, 1.3fr); min-width: 0; overflow: hidden; border: 1px solid rgba(124, 143, 164, .16); border-radius: 8px; background: #0a1017; }
  .instrument-strip { min-width: 0; padding: 5px 10px; border-right: 1px solid rgba(124, 143, 164, .14); }
  .instrument-icon { width: 32px; height: 32px; border-radius: 7px; }
  .instrument-title h1 { font-size: 15px; }
  .instrument-title p { margin-top: 3px; font-size: 8px; }
  .quote-block strong { font-size: 18px; }
  .market-selector { min-width: 0; padding: 4px 6px; border: 0; }
  .asset-rail, .timeframe-rail { min-width: 0; }
  .asset-chip { min-height: 30px; padding-inline: 7px; }
  .timeframe-rail button { height: 28px; min-width: 29px; padding-inline: 6px; }
  .chart-card { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid rgba(124, 143, 164, .2); border-radius: 8px; box-shadow: none; }
  .workspace-commandbar { flex: 0 0 38px; min-height: 38px; padding: 3px 7px; }
  .chart-workspace { flex: 1 1 auto; width: 100%; height: auto; min-height: 0 !important; overflow: hidden; }
  .chart-stage { width: 100%; height: 100%; min-height: 0 !important; }
  .chart-mount, .chart-mount > div, .chart-mount canvas { max-width: none; }
  .quick-toolbar { min-height: 0; overflow-x: hidden; overflow-y: auto; }
  .quick-toolbar button { min-height: 38px; }
  .chart-statusbar { flex: 0 0 36px; min-height: 36px; padding: 3px 8px; }

  html .market-shell > .market-hub-view { grid-column: 2; grid-row: 2; display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: auto; max-width: none; height: auto; min-height: 0; margin: 8px 10px 10px 0; padding: 0; overflow: hidden; border: 1px solid rgba(124, 143, 164, .2); border-radius: 8px; background: #090f16; color: #edf1f6; }
  html .market-shell > .market-hub-view.is-active { display: grid; }
  html .market-hub-view .market-hub-head { position: relative; top: auto; z-index: 1; margin: 0; padding: 8px 9px 7px; border-bottom: 1px solid rgba(124, 143, 164, .14); background: #0b121a; backdrop-filter: none; }
  html .market-hub-view .market-hub-titlebar h1 { margin-top: 3px; font-size: 14px; letter-spacing: -.02em; }
  html .market-hub-view .market-hub-titlebar p { display: none; }
  html .market-hub-view .market-hub-kicker { color: #7b8797; font-size: 6px; }
  html .market-hub-view .market-hub-add { width: 30px; height: 30px; border-radius: 7px; font-size: 18px; }
  html .market-hub-view .market-hub-search { grid-template-columns: 17px minmax(0, 1fr) 23px; gap: 4px; margin-top: 7px; padding-inline: 7px; border-radius: 7px; }
  html .market-hub-view .market-hub-search input { height: 32px; min-width: 0; font-size: 9px; }
  html .market-hub-view .market-hub-search svg { width: 14px; height: 14px; }
  html .market-hub-view .market-hub-tabs { gap: 3px; margin-top: 6px; }
  html .market-hub-view .market-hub-tabs button { height: 24px; padding-inline: 8px; border-radius: 6px; font-size: 6px; }
  html .market-hub-view .market-hub-section-head { align-items: center; min-height: 28px; padding: 5px 9px; border-bottom: 1px solid rgba(124, 143, 164, .1); background: #090f16; }
  html .market-hub-view .market-hub-section-head strong { color: #718094; font: 750 7px/1 "IBM Plex Mono", monospace; text-transform: uppercase; }
  html .market-hub-view .market-hub-section-head span { font-size: 6px; }
  html .market-hub-view .market-hub-list { min-height: 0; overflow-y: auto; border-top: 0; scrollbar-color: #25303e transparent; scrollbar-width: thin; }
  html .market-hub-view .hub-asset-row { grid-template-columns: 28px minmax(0, 1fr) minmax(76px, auto) 24px; gap: 6px; min-height: 50px; padding: 5px 7px; border-color: rgba(124, 143, 164, .09); }
  html .market-hub-view .hub-asset-row:hover { background: rgba(255, 255, 255, .025); }
  html .market-hub-view .hub-asset-row:has(.hub-row-hit:focus-visible) { outline: 1px solid rgba(245, 196, 0, .4); outline-offset: -1px; }
  html .market-hub-view .hub-asset-badge { width: 26px; height: 26px; border-radius: 6px; font-size: 6px; }
  html .market-hub-view .hub-asset-copy strong { font-size: 9px; }
  html .market-hub-view .hub-asset-copy span { margin-top: 3px; font-size: 6px; }
  html .market-hub-view .hub-asset-price strong { min-width: 0; font-size: 9px; }
  html .market-hub-view .hub-asset-price span { margin-top: 3px; font-size: 6.5px; }
  html .market-hub-view .hub-asset-fav { width: 24px; height: 28px; font-size: 14px; }
  html .market-hub-view .hub-row-hit { inset: 0 29px 0 0; cursor: pointer; }
  html .market-bottom-nav { display: none !important; }

  /* market-launch.css is injected after the base bundle. Keep its mobile
     presentation from reclaiming the desktop workspace when data arrives. */
  body.market-launch-ready .market-shell > .market-main {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 8px 10px 10px !important;
  }
  body.market-launch-ready .market-workspace-header {
    margin: 0 !important;
  }
  body.market-launch-ready .market-workspace-header > .instrument-strip,
  body.market-launch-ready .market-workspace-header > .market-selector,
  body.market-launch-ready .market-main > .chart-card {
    margin: 0 !important;
  }
  body.market-launch-ready .market-main > .chart-card {
    min-height: 0 !important;
    border-radius: 8px !important;
  }
  body.market-launch-ready .market-shell > .market-hub-view {
    display: grid !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 8px 10px 10px 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #090f16 !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-head {
    margin: 0 !important;
    padding: 8px 9px 7px !important;
    background: #0b121a !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-titlebar {
    grid-template-columns: minmax(0, 1fr) 30px !important;
    gap: 7px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-back,
  body.market-launch-ready .market-hub-view .market-hub-kicker {
    display: none !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-titlebar h1 {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 30px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-add {
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 7px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-search {
    margin-top: 7px !important;
    border-radius: 7px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-search input {
    height: 32px !important;
    min-height: 32px !important;
    font-size: 9px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-tabs {
    gap: 3px !important;
    margin-top: 6px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-tabs button {
    width: auto !important;
    min-width: 0 !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    font-size: 6px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-section-head {
    min-height: 28px !important;
    padding: 5px 9px !important;
    background: #090f16 !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-row {
    grid-template-columns: 28px minmax(0, 1fr) minmax(76px, auto) 24px !important;
    gap: 6px !important;
    min-height: 50px !important;
    padding: 5px 7px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-badge {
    width: 26px !important;
    height: 26px !important;
    border-radius: 6px !important;
    font-size: 6px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-copy strong,
  body.market-launch-ready .market-hub-view .hub-asset-price strong {
    font-size: 9px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-copy span,
  body.market-launch-ready .market-hub-view .hub-asset-price span {
    margin-top: 3px !important;
    font-size: 6.5px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-fav {
    width: 24px !important;
    height: 28px !important;
    min-height: 28px !important;
    font-size: 14px !important;
  }
  body.market-launch-ready .market-bottom-nav {
    display: none !important;
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .market-shell { grid-template-columns: minmax(0, 1fr) 270px; }
  .market-main { padding-left: 8px; }
  .market-workspace-header { grid-template-columns: minmax(220px, .62fr) minmax(390px, 1.38fr); }
  .instrument-title p, .asset-chip span { display: none; }
  .instrument-strip { padding-inline: 7px; }
  .asset-chip { padding-inline: 5px; font-size: 7px; }
  html .market-hub-view .hub-asset-row { grid-template-columns: 26px minmax(0, 1fr) minmax(68px, auto) 22px; gap: 5px; padding-inline: 6px; }
}

@supports not (height: 100dvh) {
  @media (min-width: 1024px) { .market-shell { height: 100vh; } }
}

@media (min-width: 1024px) {
  #fullscreenBtn { border-color: #8b7217; background: #f5c400; color: #090b0f; box-shadow: 0 0 0 1px rgba(245, 196, 0, .2), 0 7px 20px rgba(245, 196, 0, .13); }
  #fullscreenBtn:hover,
  #fullscreenBtn:focus-visible { border-color: #ffe36a; background: #ffd322; color: #05070b; outline: none; }
  #fullscreenBtn.is-active { border-color: #ffe36a; background: #ffe36a; color: #05070b; }
  #fullscreenBtn .fullscreen-icon--mobile { display: none; }
  #fullscreenBtn .fullscreen-icon--desktop { display: block; }

  .chart-workspace { grid-template-columns: 68px minmax(0, 1fr); }
  .quick-toolbar { gap: 4px; padding: 7px 6px; }
  .quick-toolbar button { min-height: 48px; border-radius: 9px; }
  .quick-toolbar button span:last-child { font-size: 8px; letter-spacing: .01em; }
  .quick-toolbar .quick-glyph { min-width: 23px; min-height: 23px; font-size: 17px; }
  .quick-toolbar .quick-glyph--svg svg,
  .quick-toolbar .quick-glyph--all svg { width: 23px; height: 23px; }
  .quick-toolbar .all-drawing-tools { margin-top: 2px; border-color: rgba(245, 196, 0, .32); background: rgba(245, 196, 0, .055); color: #d9c45f; }
  .quick-toolbar .all-drawing-tools:hover,
  .quick-toolbar .all-drawing-tools:focus-visible { border-color: #6b5a18; background: #17140a; color: var(--market-gold); outline: none; }

  .overlay-context { gap: 7px; max-width: min(calc(100% - 24px), 760px); min-height: 58px; padding: 8px 9px; border-radius: 13px; }
  .overlay-context__identity>span { width: 34px; height: 34px; font-size: 17px; }
  .overlay-context__identity strong { font-size: 11px; }
  .context-divider { height: 30px; margin-inline: 3px; }
  .context-colors { gap: 6px; }
  .context-colors button { width: 24px; height: 24px; }
  .context-action { flex-basis: 42px; width: 42px; min-width: 42px; height: 42px; border-color: rgba(255, 255, 255, .055); background: rgba(255, 255, 255, .018); font-size: 18px; }
  .context-action svg { width: 21px; height: 21px; stroke-width: 1.8; }
  .context-action--text { min-width: 48px; padding-inline: 9px; font-size: 10px; }
  #overlayContext .context-drag-handle { width: 38px!important; height: 42px!important; flex-basis: 38px!important; }

  #drawingsSheet { align-items: center; padding: 24px; }
  #drawingsSheet .market-sheet__panel { width: min(920px, calc(100vw - 48px)); height: min(720px, calc(100dvh - 80px)); max-height: none; margin: auto; padding-bottom: 0; border: 1px solid #354255; border-radius: 16px; background: radial-gradient(circle at 12% 0, rgba(245, 196, 0, .055), transparent 34%), #090e15; box-shadow: 0 30px 100px rgba(0, 0, 0, .68); animation: desktopToolsIn .18s ease-out both; }
  #drawingsSheet .sheet-handle { display: none; }
  #drawingsSheet .sheet-header { padding: 16px 20px 12px; }
  #drawingsSheet .sheet-header span { font-size: 8px; }
  #drawingsSheet .sheet-header h2 { margin-top: 5px; font-size: 24px; }
  #drawingsSheet .sheet-close { width: 40px; height: 40px; cursor: pointer; }
  #drawingsSheet .tool-search { margin: 2px 20px 12px; padding-inline: 12px; border-radius: 10px; }
  #drawingsSheet .tool-search input { height: 46px; font-size: 14px; }
  #drawingsSheet .tool-category-tabs { gap: 7px; padding: 0 20px 13px; }
  #drawingsSheet .tool-category-tabs button { min-height: 36px; padding-inline: 13px; font-size: 9px; cursor: pointer; }
  #drawingsSheet .tool-sheet-summary { padding: 0 21px 10px; }
  #drawingsSheet .tool-sheet-summary strong { font-size: 13px; }
  #drawingsSheet .tool-sheet-summary small { margin-top: 4px; font-size: 9px; }
  #drawingsSheet .tool-sheet-summary button { height: 32px; font-size: 9px; cursor: pointer; }
  #drawingsSheet .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 18px 18px; }
  #drawingsSheet .tool-card { min-height: 116px; padding: 15px 9px 11px; border-radius: 12px; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
  #drawingsSheet .tool-card:hover,
  #drawingsSheet .tool-card:focus-visible { border-color: rgba(245, 196, 0, .44); background: #12150f; transform: translateY(-1px); outline: none; }
  #drawingsSheet .tool-card__icon { width: 46px; height: 42px; margin-bottom: 10px; }
  #drawingsSheet .tool-card__icon svg { width: 34px; height: 34px; }
  #drawingsSheet .tool-card__icon .glyph { font-size: 18px; }
  #drawingsSheet .tool-card strong { font-size: 11px; line-height: 1.3; }
  #drawingsSheet .tool-card small { margin-top: 5px; font-size: 8px; }
  #drawingsSheet .tool-card__favorite { width: 28px; height: 28px; font-size: 18px; cursor: pointer; }
}

@keyframes desktopToolsIn {
  from { opacity: .5; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

/* Desktop market hub readability: keep the compact terminal layout, but make labels and asset rows readable on a normal monitor. */
@media (min-width: 1024px) {
  body.market-launch-ready .market-hub-view .market-hub-titlebar {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    gap: 9px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-titlebar h1 {
    font-size: 17px !important;
    line-height: 34px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-add {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 21px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-search {
    grid-template-columns: 20px minmax(0, 1fr) 25px !important;
    gap: 6px !important;
    padding-inline: 9px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-search input {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11.5px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-search svg {
    width: 16px !important;
    height: 16px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-tabs {
    gap: 4px !important;
    margin-top: 7px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-tabs button {
    height: 28px !important;
    min-height: 28px !important;
    padding-inline: 9px !important;
    font-size: 8px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-section-head {
    min-height: 32px !important;
    padding: 6px 10px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-section-head strong {
    font-size: 9px !important;
  }
  body.market-launch-ready .market-hub-view .market-hub-section-head span {
    font-size: 8px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(84px, auto) 28px !important;
    gap: 8px !important;
    min-height: 58px !important;
    padding: 6px 8px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-badge {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    font-size: 8px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-copy strong,
  body.market-launch-ready .market-hub-view .hub-asset-price strong {
    font-size: 10.5px !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-copy span,
  body.market-launch-ready .market-hub-view .hub-asset-price span {
    margin-top: 4px !important;
    font-size: 7.5px !important;
    line-height: 1.25 !important;
  }
  body.market-launch-ready .market-hub-view .hub-asset-fav {
    width: 28px !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 17px !important;
  }
  body.market-launch-ready .market-hub-view .hub-row-hit {
    inset: 0 34px 0 0 !important;
  }
  body.market-launch-ready .market-hub-view .hub-add-symbol-row {
    min-height: 56px !important;
    font-size: 10.5px !important;
  }
}
