/**
 * WordPress layout — theme cascade safety only.
 * Layout rules: frontend/style.css (#fxchart-root section)
 */

#fxchart-root .fx-layout-main {
  position: relative !important;
}

@media (min-width: 1024px) {
  #fxchart-root .fxchart-wp-shell {
    width: var(--page-max-width, 800px) !important;
    max-width: var(--page-max-width, 800px) !important;
    min-width: var(--page-max-width, 800px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 1023px) {
  #fxchart-root .fxchart-wp-shell {
    width: var(--fx-pc-design-width, 800px) !important;
    max-width: var(--fx-pc-design-width, 800px) !important;
    min-width: var(--fx-pc-design-width, 800px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform-origin: top center !important;
    flex: 0 0 auto !important;
  }
}

#fxchart-root .fx-layout-main .charts-box:not(.charts-box--zone2-pair) {
  overflow: hidden !important;
  contain: layout paint !important;
}

#fxchart-root .fx-zone2-chart-grid.charts-box--zone2-pair {
  overflow: hidden !important;
  contain: layout !important;
  isolation: auto !important;
  height: var(--zone2-charts-box-height, var(--chart-display-height, 410px)) !important;
  min-height: var(--zone2-charts-box-height, var(--chart-display-height, 410px)) !important;
  max-height: var(--zone2-charts-box-height, var(--chart-display-height, 410px)) !important;
}

/* Dashboard menu — under page header (normal flow; sticky disabled on FX top) */
body.fxchart-front-page-js #fxchart-root .fx-layout-top .onecobull-page-shell--dashboard {
  width: 100%;
  max-width: var(--page-max-width, 800px);
  margin: 0 auto;
  min-height: 0 !important;
}

body.fxchart-front-page-js #fxchart-root .fx-layout-top .onecobull-page-shell--dashboard .onecobull-page-shell__menu {
  position: static !important;
  top: auto !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.fxchart-front-page-js #fxchart-root .fx-layout-top .onecobull-page-shell--dashboard .onecobull-menu-bar {
  position: static !important;
  width: 100%;
}

#fxchart-root .earthquake-widgets-row {
  width: 100%;
  max-width: var(--page-max-width, 800px);
  margin: 16px 0 0;
  flex: 0 0 auto;
  background: transparent;
}

#fxchart-root .earthquake-widgets-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  table-layout: fixed;
  background: transparent;
}

#fxchart-root .earthquake-widgets-table__cell {
  width: 50%;
  vertical-align: top;
  padding: 0;
  text-align: left;
  background: transparent;
}

#fxchart-root .earthquake-widgets-table__cell--jp,
#fxchart-root .earthquake-widgets-table__cell--world {
  padding: 0;
}

#fxchart-root .earthquake-widgets-row .earthquake-widget-section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

#fxchart-root .earthquake-widget-section {
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 0 0 auto;
  background: transparent;
}

#fxchart-root .eq-chart-mount {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* iframe = 地図 16:9 に合わせる */
#fxchart-root .eq-chart-mount--iframe {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  line-height: 0;
  background: transparent;
}

#fxchart-root .eq-chart-mount--iframe iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#fxchart-root .eq-chart-mount--iframe iframe.eq-earthquake-iframe,
#fxchart-root .eq-chart-mount--iframe iframe.skip-lazy {
  display: block !important;
  visibility: visible !important;
}

#fxchart-root .charts-box.charts-box--zone2-pair::before {
  display: none !important;
  content: none !important;
}

#fxchart-root .fx-zone2-chart-col2.futures-mini-col,
#fxchart-root .futures-mini-sidebar {
  background: transparent !important;
}

#fxchart-root article.futures-mini-card,
#fxchart-root .futures-mini-card {
  background: rgba(255, 255, 255, 0.03) !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: none !important;
  border-radius: 6px !important;
  outline: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  filter: none !important;
}

#fxchart-root .futures-mini-card.futures-mini-closed,
#fxchart-root #futures-mini-nikkei.nikkei-spot-closed,
#fxchart-root .futures-mini-card.nikkei-spot-closed {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

#fxchart-root .futures-mini-card.futures-mini-closed::before,
#fxchart-root .futures-mini-card.futures-mini-closed::after,
#fxchart-root #futures-mini-nikkei.nikkei-spot-closed::before,
#fxchart-root #futures-mini-nikkei.nikkei-spot-closed::after {
  display: none !important;
  content: none !important;
}

#fxchart-root .fx-zone2-chart-grid.charts-box--zone2-pair .chart-panel {
  padding-bottom: 0 !important;
  gap: 0 !important;
}

#fxchart-root .fx-zone2-chart-grid.charts-box--zone2-pair > .fx-zone2-chart-col1,
#fxchart-root .fx-zone2-chart-grid.charts-box--zone2-pair > .fx-zone2-chart-col2 {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

#fxchart-root .fx-zone2-chart-grid.charts-box--zone2-pair .futures-mini-sidebar {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

#fxchart-root .fx-zone2-news-full {
  height: var(--chart-top-bar-height, 2.5rem) !important;
  min-height: var(--chart-top-bar-height, 2.5rem) !important;
  max-height: var(--chart-top-bar-height, 2.5rem) !important;
  overflow: visible !important;
  flex: 0 0 auto !important;
}

#fxchart-root .fx-layout-main > .news-preview-dock,
#fxchart-root .news-preview-dock,
#fxchart-root .news-preview-dock.is-open {
  position: absolute !important;
  top: var(--news-preview-dock-top, var(--chart-top-bar-height, 2.5rem)) !important;
  left: 0 !important;
  right: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  z-index: 45 !important;
}

#fxchart-root .news-preview.visible,
#fxchart-root .news-preview-dock.is-open .news-preview.visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  top: 0 !important;
  left: var(--news-preview-left, var(--safe-inline, 18px)) !important;
  right: auto !important;
  width: var(--news-preview-width, 50%) !important;
  max-width: var(--news-preview-width, 50%) !important;
  min-height: var(--news-preview-min-height, 78px) !important;
  max-height: var(--news-preview-max-height, min(230px, 36vh)) !important;
  transform: none !important;
  pointer-events: auto !important;
  z-index: 45 !important;
}

#fxchart-root .fx-prices-box .price-cards-table {
  display: table !important;
}

.price-card.flat .change{
  color:var(--muted) !important;
}

#fxchart-root .pair-select-wrap.is-open,
#fxchart-root .fx-news-ticker-row:has(.pair-select-wrap.is-open),
#fxchart-root .fx-zone2-chart-head:has(.pair-select-wrap.is-open) {
  overflow: visible !important;
  z-index: 55 !important;
}
