.grid-stack-item > .ui-resizable-ne,
.grid-stack-item > .ui-resizable-nw,
.grid-stack-item > .ui-resizable-se,
.grid-stack-item > .ui-resizable-sw {
    background-image: none !important;
}

/* Mobile */
@media (max-width: 576px) {
    .grid-stack { width: 100% !important; }
    .grid-stack-item { width: 100% !important; }
    .grid-stack-item-content { left: 4px !important; right: 4px !important; }
}

/* Tablette */
@media (max-width: 768px) {
    .grid-stack-item-content > .dashboard-card { width: 100% !important; }
}

.section-content.dashboard {
    display: block;
    width: 100%;
    min-height: 100%;
}

.grid-stack-item-content > .dashboard-card {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}

.grid-stack-item-content { overflow: visible !important; }

/* skeleton */
@keyframes skeleton {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

.skeleton {
    position: absolute;
    inset: 0;
    opacity: 1;
    z-index: 1200;
    background: linear-gradient(90deg,
            #eee 25%,
            #f5f5f5 37%,
            #eee 63%);
    background-size: 400% 100%;
    animation: skeleton 1.4s ease infinite;
    transform: translateY(0);
    transition:
        opacity 500ms ease,
        transform 300ms ease;
    pointer-events: none;
}

.skeleton.hidden {
    opacity: 0;
    transform: translateY(6px);
}

.dashboard-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-card);
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
    padding: 10px;
}

.dashboard-card [data-field='market'] {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    font-size: small;
    font-weight: 700;
    padding-top: 5px;
    display: inline-flex;
    /* aligne texte + svg */
    align-items: center;
    justify-content: center;
    /* alignement vertical propre */
    gap: 4px;
    /* espace entre texte et icône */
    white-space: nowrap;
    /* PAS de retour à la ligne */
}

.dashboard-card [data-field='lastupdate'] {
    position: absolute;
    bottom: 1px;
    right: 5px;
    font-size: 10px;
}

.dashboard-card {
  overflow: hidden;
}

.dashboard-card .chart-wrap,
.dashboard-card > .chart {
  position: relative;
  width: 100%;
  height: 140px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.dashboard-card.btc-trend .chart-wrap {
  height: 120px !important;
}

.dashboard-card canvas.chart,
.dashboard-card > .chart > canvas[data-role='signalchart'] {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.dashboard-card.has-help [data-field='title'] {
  padding-right: 34px;
}

.dashboard-card.has-zoom [data-field='title'] {
  padding-right: 34px;
}

.dashboard-card.has-help.has-zoom [data-field='title'] {
  padding-right: 68px;
}

.dashboard-card-zoom {
  position: absolute;
  top: 6px;
  right: 6px;
}

.dashboard-card.has-help .dashboard-card-zoom {
  right: 40px;
}

.dashboard-card-help {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-card-help:hover,
.dashboard-card-help:focus-visible {
  background: var(--bg-hover);
}

.dashboard-helper-popover {
  max-width: min(380px, calc(100vw - 24px)) !important;
}

.dashboard-helper-popover .popover-body,
.dashboard-helper-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 575.98px) {
  .dashboard-helper-popover {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px) !important;
  }
}

.dashboard-helper-content p {
  margin: 8px 0;
  line-height: 1.5;
}

.dashboard-helper-content h4 {
  margin: 12px 0 4px;
  font-size: .9rem;
}

.dashboard-helper-title {
  display: block;
  color: #1d4ed8;
  font-size: 1rem;
}

.dashboard-card-zoom,
.wallet-popover-toggle {
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 5px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}

.wallet-popover-toggle:hover,
.wallet-popover-toggle:focus-visible,
.dashboard-card-zoom:hover,
.dashboard-card-zoom:focus-visible {
  background: var(--bg-hover);
}

.wallet-popover-toggle svg, .dashboard-card-zoom svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}



.dashboard-card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1990;
  background: rgba(0, 0, 0, 0.55);
}

.dashboard-card.is-zoomed {
  position: fixed;
  inset: calc(var(--menu-height) + 12px) 20px 20px 20px;
  z-index: 2000;
  width: auto !important;
  height: auto !important;
  max-width: none;
  overflow: hidden;
}

.dashboard-card.is-zoomed .chart-wrap {
  height: auto !important;
  min-height: 0;
  flex: 1 1 auto;
}

.dashboard-card.is-zoomed.btc-trend .chart-wrap {
  height: auto !important;
}

.dashboard-card.is-zoomed.btc-trend canvas.chart {
  height: 100% !important;
}

.dashboard-card-placeholder {
  box-sizing: border-box;
  flex-shrink: 0;
}

body.dashboard-card-modal-open {
  overflow: hidden;
}

body.dashboard-card-modal-open > .popover {
  z-index: 2100 !important;
}

@media (max-width: 576px) {
  .dashboard-card.is-zoomed {
    inset: calc(var(--menu-height) + 8px) 8px 8px 8px;
    width: auto !important;
  }
}

.dashboard-card.btc-ma .ma-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: auto;

  font-size: large;
}

.dashboard-card.btc-ma .ma-row {
  display: flex;
  flex-wrap: nowrap;
}

.dashboard-card.btc-ma .price-row {
  font-size: large;
  margin-top: 15px;
  margin-bottom: 15px;
}

.dashboard-card.btc-ma .price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.dashboard-card.btc-ma .ma-usd-price {
  margin-top: 2px;
  color: #777;
  font-family: inherit;
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.2;
}

.dashboard-card.btc-ma .ma-row .label,
.dashboard-card.btc-ma .price-row {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.05em;
  font-weight: 400;
  color: #777;
  margin-right: auto;
}

.dashboard-card.btc-ma .ma-row .value {
  font-weight: 600;
  width: 75px;
  text-align: center;
}

.dashboard-card.btc-ma .indicator-content {
  display: flex;
  flex-direction: column;
  gap: 0.33rem;
  padding-top: 20px;
}

.dashboard-card.btc-ma .indicator {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  border: 1px solid var(--border);
}

.dashboard-card.btc-ma .indicator .attribut-label {
  display: flex;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  background: var(--border);
  padding-left: 7px;
}

.dashboard-card.btc-ma .indicator .attribut {
  min-width: 80px;
  margin-left: auto;
  text-align: center;
  font-weight: 900;
}


.btc-trend-signal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  font-size: 12px;
}

.btc-trend-signal strong {
  font-size: 13px;
  font-weight: 600;
}

.btc-trend-signal small {
  opacity: 0.75;
  white-space: nowrap;
}

[data-field="summary"] {
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 576px) {

  .dashboard-card.btc-trend .chart-wrap,
  .dashboard-card.btc-trend canvas.chart {
    height: 160px !important;
  }

  .btc-trend-signal {
    font-size: 11px;
    gap: 8px;
  }

  .btc-trend-signal strong {
    font-size: 12px;
  }
}


/* Desktop */
.btc-event-popover {
  max-width: 360px !important;
}

.btc-event-popover .popover-body {
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

/* Mobile */
@media (max-width:768px) {

  .btc-event-popover {
    position: fixed !important;

    left: 8px !important;
    right: 8px !important;
    top: auto !important;

    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;

    transform: none !important;
  }

  .btc-event-popover .popover-body {
    max-height: 65vh;
  }

  /* plus utile en plein écran mobile */
  .btc-event-popover .arrow {
    display: none;
  }
}

.btc-lastevent-category-popover {
  width: 340px;
  max-width: 340px;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.btc-lastevent-category-popover .popover-date {
  font-weight: 600;
  margin-bottom: 4px;
}

.btc-lastevent-category-popover .popover-title,
.btc-lastevent-category-popover .popover-summary {
  margin-bottom: 8px;
}

.btc-lastevent-category-popover .popover-table {
  width: 100%;
  table-layout: fixed;
}

.btc-lastevent-category-popover .popover-label {
  width: 110px;
  font-weight: 600;
  vertical-align: top;
}

.btc-lastevent-category-popover .wrap {
  overflow-wrap: anywhere;
}

.btc-lastevent-category-popover hr {
  margin: 8px 0;
}

.btc-lastevent-category-popover .popover-source {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.7;
}

.theme-title {
  gap: 2px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

.btc-wallet .dropdown-menu {
  background: blue;
}
