:root {
  color-scheme: light dark;
}

body {
  background: var(--bulma-body-background-color, #f5f5f5);
  color: var(--bulma-body-color, #0a0a0a);
}

.section {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.hero {
  min-height: 100vh;
}

.is-mono {
  font-family: monospace;
  word-break: break-all;
}

.account-address {
  word-break: break-all;
  font-size: 0.85rem;
}

.bottom-actions {
  position: relative;
  margin-top: 2rem;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .balance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .balance-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.balance-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
  white-space: normal;
}

.balance-amount-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.balance-amount .has-text-weight-semibold {
  white-space: nowrap;
}

.balance-meta {
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .button.is-light,
  .tag.is-light {
    background-color: var(--bulma-scheme-main-ter, #1f1f1f);
    border-color: var(--bulma-border-strong, #3a3a3a);
    color: var(--bulma-text, #f5f5f5);
  }

  .button.is-light:hover {
    background-color: var(--bulma-scheme-main, #2a2a2a);
  }

  .button.is-light.is-link,
  .tag.is-light.is-link {
    color: var(--bulma-link, #7db8ff);
  }

  .tag.is-light.is-info {
    color: var(--bulma-info, #7dd8ff);
  }
}

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.8rem;
}

.box-title {
  margin-bottom: 0.5rem;
}

.op-card,
.offer-card {
  border-left: 3px solid #485fc7;
}

.op-card.is-failed,
.box.is-failed {
  border-left: 3px solid #f14668;
  background: rgba(241, 70, 104, 0.08);
  box-shadow: inset 0 0 0 1px rgba(241, 70, 104, 0.12);
}

@media (prefers-color-scheme: dark) {
  .op-card.is-failed,
  .box.is-failed {
    background: rgba(241, 70, 104, 0.18);
    box-shadow: inset 0 0 0 1px rgba(241, 70, 104, 0.22);
  }
}

/* Popover styles */
.popover-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.popover-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 200px;
  max-width: 300px;
  background-color: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02);
  padding: 0.75rem;
  margin-top: 4px;
  cursor: default;
}

.popover-wrapper.is-active .popover-content {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .popover-content {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    box-shadow: 0 0.5em 1em -0.125em rgba(0, 0, 0, 0.5);
    color: #f5f5f5;
  }
}

.popover-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 0.85rem;
}

.popover-divider {
  border-top: 1px solid #dbdbdb;
  margin: 0.5rem 0;
}

@media (prefers-color-scheme: dark) {
  .popover-divider {
    border-color: #4a4a4a;
  }
}

/* Helper classes */
.h-100 {
  height: 100%;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.break-word {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Threshold Stats */
.threshold-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.threshold-item {
  display: flex;
  flex-direction: column;
}

.threshold-label {
  font-size: 0.75rem;
  color: #b5b5b5; /* grey-light equivalent */
  text-transform: uppercase;
  font-weight: 600;
}

.threshold-value {
  font-size: 1.25rem;
  font-weight: bold;
}

/* Signer Item */
.signer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dbdbdb;
  overflow: hidden;
}

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

.signer-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 0.5rem;
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  .signer-item {
    border-color: #3a3a3a;
  }
}

/* Data Item */
.data-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.data-key {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 0.25rem;
  display: block;
}

.data-value-box {
  background-color: #f5f5f5;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .data-value-box {
    background-color: #2a2a2a;
  }
}
