.dy-funding-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 5px;
  border: 1px solid #cbd9f0;
  border-radius: 16px;
  background: #eef4ff;
}

.dy-funding-tabs button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #506582;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dy-funding-tabs button.is-active {
  color: #fff;
  border-color: #5640ed;
  background: linear-gradient(135deg, #6854f5, #5140dd);
  box-shadow: 0 8px 20px rgba(79, 63, 216, .24);
}

.dy-funding-panel[hidden],
.dy-voice-dialog > [hidden] {
  display: none !important;
}

.dy-voice-dialog-head .dy-voice-header-rules[hidden] {
  display: none !important;
}

.dy-funding-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dy-funding-qwen-status {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dy-funding-qwen-status.is-ready { color: #087653; background: #ddf8ee; }
.dy-funding-qwen-status.is-analyzing,
.dy-funding-qwen-status.is-connecting { color: #5948d8; background: #eeeaff; }
.dy-funding-qwen-status.is-waiting-evidence { color: #2d65a2; background: #e8f3ff; }
.dy-funding-qwen-status.is-safe-fallback { color: #986000; background: #fff0c7; }
.dy-funding-qwen-status.is-unavailable { color: #b23847; background: #ffebed; }

.dy-funding-smart {
  padding: 14px;
  border: 1px solid #b8d7ce;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(230, 251, 245, .62), rgba(238, 247, 255, .62));
}

.dy-funding-smart-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.dy-funding-smart-toggle input {
  width: 22px;
  height: 22px;
  accent-color: #0b9a76;
}

.dy-funding-smart-toggle strong {
  color: #0c6e58;
  font-size: 16px;
}

.dy-funding-smart-toggle span {
  color: #5c7087;
  font-size: 13px;
  line-height: 1.55;
}

.dy-funding-states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dy-funding-state {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #d5dfec;
  border-radius: 13px;
  background: rgba(250, 252, 255, .6);
}

.dy-funding-state strong {
  color: #1d3556;
}

.dy-funding-state > span {
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.dy-funding-fresh {
  color: #087e5d;
  background: #def8ef;
}

.dy-funding-unavailable {
  color: #a66700;
  background: #fff1cf;
}

.dy-funding-state small,
.dy-funding-state p,
.dy-funding-why {
  grid-column: 1 / -1;
  margin: 0;
  color: #6d7e94;
  line-height: 1.5;
}

.dy-funding-user-status {
  padding: 9px 10px;
  border-left: 4px solid #8c78ef;
  border-radius: 8px;
  background: rgba(244, 241, 255, .62);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.dy-funding-layer-badges {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dy-funding-layer-badges span {
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.dy-funding-layer-badges .is-ready {
  border-color: #9ddbc8;
  background: #e6faf3;
  color: #087557;
}

.dy-funding-layer-badges .is-wait {
  border-color: #edcd85;
  background: #fff6dc;
  color: #895900;
}

.dy-funding-current-state,
.dy-funding-trigger-state,
.dy-funding-next-missing {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.5;
}

.dy-funding-current-state { background: rgba(232, 244, 255, .82); color: #24517e; }
.dy-funding-trigger-state { background: rgba(235, 251, 244, .82); color: #126b54; }
.dy-funding-next-missing { background: rgba(255, 247, 225, .86); color: #805500; }

.dy-funding-why {
  border-top: 1px dashed #ccd7e5;
  padding-top: 8px;
  font-size: 12px;
}

.dy-funding-why summary {
  width: fit-content;
  color: #315f9d;
  font-weight: 800;
  cursor: pointer;
}

.dy-funding-why p {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(237, 245, 255, .64);
}

.dy-funding-rule {
  border-left-color: #0ba67b;
}

.dy-funding-rule .dy-voice-rule-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .dy-funding-smart-toggle {
    grid-template-columns: auto 1fr;
  }

  .dy-funding-smart-toggle span {
    grid-column: 1 / -1;
  }

  .dy-funding-states {
    grid-template-columns: 1fr;
  }

  .dy-funding-rule .dy-voice-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .dy-funding-tabs {
    gap: 6px;
  }

  .dy-funding-tabs button {
    min-height: 42px;
    padding: 7px;
    font-size: 13px;
  }

  .dy-funding-rule .dy-voice-rule-grid {
    grid-template-columns: 1fr;
  }

  .dy-funding-state {
    grid-template-columns: 1fr;
  }

  .dy-funding-state > span {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dy-funding-tabs button {
    transition: none !important;
  }
}
